Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Delegate Request (Categories)

edited September 2008 in Vanilla 1.0 Help
Hi!

I need a delegate concerning removing categories:

Vanilla.Control.CategoryForm.php, line 70 (just before redirecting): $this->DelegateParameters['RemovedCategory'] = $CategoryID; $this->DelegateParameters['ReplacementCategory'] = $ReplacementCategoryID; $this->CallDelegate('PostRemoveCategory');

Comments

  • You would need that:
    } elseif ($this->PostBackAction == 'ProcessCategoryRemove' && $this->IsValidFormPostBack()) { if ($this->Context->Session->User->Permission('PERMISSION_REMOVE_CATEGORIES')) { if ($this->CategoryManager->RemoveCategory($CategoryID, $ReplacementCategoryID)) { $this->DelegateParameters['RemovedCategory'] = $CategoryID; $this->DelegateParameters['ReplacementCategory'] = $ReplacementCategoryID; $this->CallDelegate('PostRemoveCategory'); $RedirectUrl = GetUrl( $this->Context->Configuration, $this->Context->SelfUrl, '', '', '', '', 'PostBackAction=Categories&Action=Removed'); } } else { $this->IsPostBack = 0; }
  • I think so ;)
  • edited September 2008
    Added to Vanilla revision 766.
  • thnx

    maybe I come up with more in a few, I'll let you know ;)

    thanks again!
  • which should be the best way to approach the category reordering?
  • What do you mean?
  • I have an xml file with information relative to the categories in the forum. each time a category is added, edited or deleted, I update the xml file.

    I'd like to update the xml file also reflecting the reordering of the categories via the settings->categories form, but AFAIK, this is done directly via AJAX, and I don't know exactly how to update my file in consequence.
  • edited September 2008
    I don't think you can do anything just know except patching the ajax php script. I think ajax request can load extension (they don't by default) and need to make the ajax script use the CatagoryManager.

    If you file like it, you can write the modification needed (a new CatagoryManager method and a patch to the ajax script) and I will add it (we will do it anyway, you can write a simple patch for your extension).
  • I feel a bit lost with your comment...

    what do you mean by "ajax request can load extension"?
  • edited September 2008
    Sorry, I am wrong; appg/init_ajax.php need the same switch than appg/init_people.php:if ($Configuration['AJAX_USE_EXTENSIONS']) { include($Configuration['APPLICATION_PATH'].'conf/extensions.php'); ob_end_clean(); ob_start();
This discussion has been closed.