/** * Delete all permission for a specific item * * deletePermissions() * * @param int $itemid : id of the item for which to delete the permissions * @return bool : TRUE if the no errors occured **/ function deletePermissions($itemid, $type = 'item') { global $xoopsModule; $smartModule =& smartmedia_getModuleInfo(); $result = true; $module_id = $smartModule->getVar('mid'); $gperm_handler =& xoops_gethandler('groupperm'); switch ($type) { case "item": $gperm_name = "item_read"; break; case "category": $gperm_name = "category_read"; break; } $gperm_handler->deleteByModule($module_id, $gperm_name, $itemid); return $result; }
function &smartmedia_getModuleConfig() { static $smartConfig; if (!$smartConfig) { global $xoopsModule; if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == 'smartmedia') { global $xoopsModuleConfig; $smartConfig =& $xoopsModuleConfig; } else { $smartModule =& smartmedia_getModuleInfo(); $hModConfig =& xoops_gethandler('config'); $smartConfig = $hModConfig->getConfigsByCat(0, $smartModule->getVar('mid')); } } return $smartConfig; }
*/ if (!defined("SMARTMEDIA_DIRNAME")) { define("SMARTMEDIA_DIRNAME", 'smartmedia'); } if (!defined("SMARTMEDIA_URL")) { define("SMARTMEDIA_URL", XOOPS_URL . '/modules/' . SMARTMEDIA_DIRNAME . '/'); } if (!defined("SMARTMEDIA_ROOT_PATH")) { define("SMARTMEDIA_ROOT_PATH", XOOPS_ROOT_PATH . '/modules/' . SMARTMEDIA_DIRNAME . '/'); } if (!defined("SMARTMEDIA_IMAGES_URL")) { define("SMARTMEDIA_IMAGES_URL", SMARTMEDIA_URL . "images/"); } include_once SMARTMEDIA_ROOT_PATH . "include/functions.php"; // Creating the SmartModule object $smartModule =& smartmedia_getModuleInfo(); $myts = MyTextSanitizer::getInstance(); $smartmedia_moduleName = $myts->displayTarea($smartModule->getVar('name')); $is_smartmedia_admin = smartmedia_userIsAdmin(); // Creating the SmartModule config Object $smartConfig =& smartmedia_getModuleConfig(); include_once SMARTMEDIA_ROOT_PATH . "class/permission.php"; include_once SMARTMEDIA_ROOT_PATH . "class/category.php"; include_once SMARTMEDIA_ROOT_PATH . "class/category_text.php"; include_once SMARTMEDIA_ROOT_PATH . "class/folder.php"; include_once SMARTMEDIA_ROOT_PATH . "class/folder_text.php"; include_once SMARTMEDIA_ROOT_PATH . "class/clip.php"; include_once SMARTMEDIA_ROOT_PATH . "class/clip_text.php"; include_once SMARTMEDIA_ROOT_PATH . "class/tabs.php"; include_once SMARTMEDIA_ROOT_PATH . "class/format.php"; include_once SMARTMEDIA_ROOT_PATH . "class/keyhighlighter.class.php";