=====WikkaMenusAdmin Action=====
>>==See also :==
Documentation : ""WikkaMenusAdminInfo""
Other: WikkaMenus
==Works with :==
Wikka 1.2>>
This is the development page for the WikkaMenusAdmin action for Wikka version > 1.2.
::c::
DarTar did [[WikkaMenus]], a solution to manage users customized menus stored in MySql database. WikkaMenusAdmin is a "downgraded" version which manages menulets files introduced with Wikka version 1.2.
==Usage==
Place in a page ""{{wikkamenusadmin}}"", you can also apply ACLs restriction (despite this action is made for admin user only).
==Installation==
- Save the code block below as ##/plugins/actions/wikkamenusadmin.php##
- Give it the same file permissions as the other php files in that directory
- Customized menulets directory if needed
==Code==
%%(php;1)
Menu Configuration
IsAdmin()) {
switch ($_POST['operation']) {
case 'Create Menu':
if (file_exists(MENU_PATH.$_POST['newname'])) {
echo $this->Format('<<**Sorry!** --- A menu named "'.$_POST['newname'].'" already exists. --- Please choose another name<<::c::--- --- ');
} else {
WriteMyMenu($_POST["newname"], $_POST["menu"]);
echo $this->Format("<<**Thanks!** --- Menu \"".$_POST["newname"]."\" has been created<<::c:: --- ");
}
break;
case 'Delete Menu':
echo $this->Format('<<**Confirmation required**<<::c:: --- Do you really want to delete **'.$_POST['name'].'**? --- --- ');
$formdelete = '
';
echo $this->FormOpen('','','post')."\n";
echo $formdelete."\n";
echo $this->FormClose()."\n";
break;
case 'Confirm Deletion':
DeleteMyMenu($_POST['name']);
echo $this->Format('<<**Thanks!** --- Menu "'.$_POST['name'].'" has been deleted<<::c:: --- ');
break;
case 'Rename Menu':
if (file_exists(MENU_PATH.$_POST["newname"])) {
echo $this->Format('<<**Sorry!** --- A menu named "'.$_POST["newname"].'" already exists. --- Please choose another name<<::c:: --- --- ');
} else {
echo $this->Format('<<**Confirmation required**<<::c:: --- Do you really want to rename **'.$_POST["name"].'** as **'.$_POST["newname"].'**? --- --- ');
$formrename = '