function list_groups() { global $xoopsModule; $global_perms_array = array(GNAV_GPERM_INSERTABLE => _GNAV_GPERM_G_INSERTABLE, GNAV_GPERM_SUPERINSERT | GNAV_GPERM_INSERTABLE => _GNAV_GPERM_G_SUPERINSERT, GNAV_GPERM_SUPEREDIT | GNAV_GPERM_EDITABLE => _GNAV_GPERM_G_SUPEREDIT, GNAV_GPERM_SUPERDELETE | GNAV_GPERM_DELETABLE => _GNAV_GPERM_G_SUPERDELETE, GNAV_GPERM_RATEVIEW => _GNAV_GPERM_G_RATEVIEW, GNAV_GPERM_RATEVOTE | GNAV_GPERM_RATEVIEW => _GNAV_GPERM_G_RATEVOTE, GNAV_GPERM_WYSIWYG => _GNAV_GPERM_G_WYSIWYG); $form = new MyXoopsGroupPermForm('', $xoopsModule->mid(), 'gnavi_global', _MD_A_GNAVI_GROUPPERM_GLOBALDESC); foreach ($global_perms_array as $perm_id => $perm_name) { $form->addItem($perm_id, $perm_name); } echo $form->render(); }
function list_groups() { global $xoopsModule; $global_perms_array = array(GPERM_INSERTABLE => _ALBM_GPERM_G_INSERTABLE, GPERM_SUPERINSERT | GPERM_INSERTABLE => _ALBM_GPERM_G_SUPERINSERT, GPERM_SUPEREDIT | GPERM_EDITABLE => _ALBM_GPERM_G_SUPEREDIT, GPERM_SUPERDELETE | GPERM_DELETABLE => _ALBM_GPERM_G_SUPERDELETE, GPERM_RATEVIEW => _ALBM_GPERM_G_RATEVIEW, GPERM_RATEVOTE | GPERM_RATEVIEW => _ALBM_GPERM_G_RATEVOTE, GPERM_TELLAFRIEND => _ALBM_GPERM_G_TELLAFRIEND); $form = new MyXoopsGroupPermForm('', $xoopsModule->mid(), 'myalbum_global', _AM_ALBM_GROUPPERM_GLOBALDESC); foreach ($global_perms_array as $perm_id => $perm_name) { $form->addItem($perm_id, $perm_name); } echo $form->render(); }
function list_groups() { global $xoopsUser, $xoopsConfig, $xoopsDB; global $xoopsModule, $block_arr, $xoops_system_url; foreach (array_keys($block_arr) as $i) { $item_list[$block_arr[$i]->getVar("bid")] = $block_arr[$i]->getVar("title"); } $form = new MyXoopsGroupPermForm('', 1, 'block_read', _MD_AM_ADGS); $form->addAppendix('module_admin', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACTIVERIGHTS); $form->addAppendix('module_read', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACCESSRIGHTS); foreach ($item_list as $item_id => $item_name) { $form->addItem($item_id, $item_name); } echo $form->render(); }
function list_groups() { global $target_mid, $target_mname, $block_arr; $item_list = array(); foreach (array_keys($block_arr) as $i) { $item_list[$block_arr[$i]->getVar("bid")] = $block_arr[$i]->getVar("title"); } $form = new MyXoopsGroupPermForm(_AM_MYLINKS_AGDS, 1, 'block_read', ''); if ($target_mid > 1) { $form->addAppendix('module_admin', $target_mid, $target_mname . ' ' . _AM_MYLINKS_ACTIVERIGHTS); $form->addAppendix('module_read', $target_mid, $target_mname . ' ' . _AM_MYLINKS_ACCESSRIGHTS); } foreach ($item_list as $item_id => $item_name) { $form->addItem($item_id, $item_name); } echo $form->render(); }
function list_groups() { global $xoopsModule; $global_perms_array = array(WEBLOG_PERMIT_EDIT => _AM_WEBLOG_PRIV_EDIT, WEBLOG_PERMIT_READINDEX => _AM_WEBLOG_PRIV_READINDEX, WEBLOG_PERMIT_READDETAIL => _AM_WEBLOG_PRIV_READDETAIL); /* $global_perms_array = array( GPERM_INSERTABLE => _ALBM_GPERM_G_INSERTABLE , GPERM_SUPERINSERT | GPERM_INSERTABLE => _ALBM_GPERM_G_SUPERINSERT , // GPERM_EDITABLE => _ALBM_GPERM_G_EDITABLE , GPERM_SUPEREDIT | GPERM_EDITABLE => _ALBM_GPERM_G_SUPEREDIT , // GPERM_DELETABLE => _ALBM_GPERM_G_DELETABLE , GPERM_SUPERDELETE | GPERM_DELETABLE => _ALBM_GPERM_G_SUPERDELETE , GPERM_RATEVIEW => _ALBM_GPERM_G_RATEVIEW , GPERM_RATEVOTE | GPERM_RATEVIEW => _ALBM_GPERM_G_RATEVOTE ) ; */ $form = new MyXoopsGroupPermForm('', $xoopsModule->mid(), 'weblog_global', _AM_WEBLOG_GROUPPERM_GLOBALDESC); foreach ($global_perms_array as $perm_id => $perm_name) { $form->addItem($perm_id, $perm_name); } echo $form->render(); }
function list_groups() { global $xoopsModule, $block_arr; $myts =& MyTextSanitizer::getInstance(); //smartclient_collapsableBar('bottomtable', 'bottomtableicon'); foreach (array_keys($block_arr) as $i) { $item_list[$block_arr[$i]->getVar("bid")] = $block_arr[$i]->getVar("title"); } $form = new MyXoopsGroupPermForm('', 1, 'block_read', "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a> " . _AM_SCLIENT_GROUPS . "</h3><div id='bottomtable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _AM_SCLIENT_GROUPSINFO . "</span>"); $form->addAppendix('module_admin', $xoopsModule->mid(), $myts->displayTarea($xoopsModule->name()) . ' ' . _AM_ACTIVERIGHTS); $form->addAppendix('module_read', $xoopsModule->mid(), $myts->displayTarea($xoopsModule->name()) . ' ' . _AM_ACCESSRIGHTS); foreach ($item_list as $item_id => $item_name) { $form->addItem($item_id, $myts->displayTarea($item_name)); } echo $form->render(); echo "</div>"; }
function list_groups() { global $target_mid, $target_mname, $block_arr; smartsection_collapsableBar('groupstable', 'groupsicon', _AM_SSECTION_GROUPS, _AM_SSECTION_GROUPSINFO); $item_list = array(); foreach (array_keys($block_arr) as $i) { $item_list[$block_arr[$i]->getVar("bid")] = $block_arr[$i]->getVar("title"); } $form = new MyXoopsGroupPermForm(_MD_AM_ADGS, 1, 'block_read', ''); if ($target_mid > 1) { $form->addAppendix('module_admin', $target_mid, $target_mname . ' ' . _AM_ACTIVERIGHTS); $form->addAppendix('module_read', $target_mid, $target_mname . ' ' . _AM_ACCESSRIGHTS); } foreach ($item_list as $item_id => $item_name) { $form->addItem($item_id, $item_name); } echo $form->render(); smartsection_close_collapsable('groupstable', 'groupsicon'); }
<?php require_once '../../../include/cp_header.php'; require_once 'mygrouppermform.php'; // for "Duplicatable" $mydirname = basename(dirname(dirname(__FILE__))); if (!preg_match('/^(\\D+)(\\d*)$/', $mydirname, $regs)) { echo "invalid dirname: " . htmlspecialchars($mydirname); } $mydirnumber = $regs[2] === '' ? '' : intval($regs[2]); require_once XOOPS_ROOT_PATH . "/modules/{$mydirname}/include/gtickets.php"; if (!empty($_POST['submit'])) { // Ticket Check if (!$xoopsGTicket->check(true, 'myblocksadmin')) { redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); } include "mygroupperm.php"; redirect_header(XOOPS_URL . "/modules/{$mydirname}/admin/groupperm.php", 1, _AM_PICAL_DBUPDATED); exit; } $item_list = array('1' => _AM_GPERM_G_INSERTABLE, '2' => _AM_GPERM_G_SUPERINSERT, '4' => _AM_GPERM_G_EDITABLE, '8' => _AM_GPERM_G_SUPEREDIT, '32' => _AM_GPERM_G_SUPERDELETE); $form = new MyXoopsGroupPermForm(_AM_GROUPPERM, $xoopsModule->mid(), 'pical_global', _AM_GROUPPERMDESC); foreach ($item_list as $item_id => $item_name) { $form->addItem($item_id, $item_name); } xoops_cp_header(); include './mymenu.php'; echo $form->render(); xoops_cp_footer();
function list_groups() { // query for getting blocks $sql = "SELECT * FROM " . $this->db->prefix("newblocks") . " WHERE mid='{$this->target_mid}' ORDER BY visible DESC,side,weight"; $result = $this->db->query($sql); $block_arr = array(); while ($myrow = $this->db->fetchArray($result)) { $block_arr[] = new XoopsBlock($myrow); } $item_list = array(); foreach (array_keys($block_arr) as $i) { $item_list[$block_arr[$i]->getVar("bid")] = $block_arr[$i]->getVar("title"); } $form = new MyXoopsGroupPermForm(_MD_A_MYBLOCKSADMIN_PERMFORM, 1, 'block_read', ''); // skip system (TODO) if ($this->target_mid > 1) { $form->addAppendix('module_admin', $this->target_mid, $this->target_mname . ' ' . _MD_A_MYBLOCKSADMIN_PERM_MADMIN); $form->addAppendix('module_read', $this->target_mid, $this->target_mname . ' ' . _MD_A_MYBLOCKSADMIN_PERM_MREAD); } foreach ($item_list as $item_id => $item_name) { $form->addItem($item_id, $item_name); } echo $form->render(); }
require_once XOOPS_ROOT_PATH . "/class/xoopstree.php"; // for "Duplicatable" $mydirname = basename(dirname(dirname(__FILE__))); if (!preg_match('/^(\\D+)(\\d*)$/', $mydirname, $regs)) { echo "invalid dirname: " . htmlspecialchars($mydirname); } $mydirnumber = $regs[2] === '' ? '' : intval($regs[2]); require_once XOOPS_ROOT_PATH . "/modules/{$mydirname}/include/gtickets.php"; // the names of tables $cat_table = $xoopsDB->prefix("pical{$mydirnumber}_cat"); if (!empty($_POST['submit'])) { // Ticket Check if (!$xoopsGTicket->check(true, 'myblocksadmin')) { redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); } include "mygroupperm.php"; redirect_header(XOOPS_URL . "/modules/{$mydirname}/admin/cat2groupperm.php", 1, _AM_PICAL_DBUPDATED); exit; } // creating Objects of XOOPS $myts =& MyTextSanitizer::getInstance(); $cattree = new XoopsTree($cat_table, "cid", "pid"); $form = new MyXoopsGroupPermForm(_AM_MENU_CAT2GROUP, $xoopsModule->mid(), 'pical_cat', _AM_CAT2GROUPDESC); $cat_tree_array = $cattree->getChildTreeArray(0, 'weight ASC,cat_title'); foreach ($cat_tree_array as $cat) { $form->addItem(intval($cat['cid']), $myts->makeTBoxData4Show($cat['cat_title']), intval($cat['pid'])); } xoops_cp_header(); include './mymenu.php'; echo $form->render(); xoops_cp_footer();
function list_groups2() { global $target_mid, $target_mname, $xoopsDB; $result = $xoopsDB->query("SELECT i.instanceid,i.title FROM " . $xoopsDB->prefix("block_instance") . " i LEFT JOIN " . $xoopsDB->prefix("newblocks") . " b ON i.bid=b.bid WHERE b.mid='{$target_mid}'"); $item_list = array(); while (list($iid, $title) = $xoopsDB->fetchRow($result)) { $item_list[$iid] = $title; } $form = new MyXoopsGroupPermForm(_MD_AM_ADGS, 1, 'block_read', ''); if ($target_mid > 1) { $form->addAppendix('module_admin', $target_mid, $target_mname . ' ' . _AM_ACTIVERIGHTS); $form->addAppendix('module_read', $target_mid, $target_mname . ' ' . _AM_ACCESSRIGHTS); } foreach ($item_list as $item_id => $item_name) { $form->addItem($item_id, $item_name); } echo $form->render(); }
function list_groups() { global $xoopsModule, $block_arr; ss_collapsableBar('groupstable', 'groupsicon', _AM_SS_GROUPS, _AM_SS_GROUPSINFO); foreach (array_keys($block_arr) as $i) { $item_list[$block_arr[$i]->getVar("bid")] = $block_arr[$i]->getVar("title"); } $form = new MyXoopsGroupPermForm('', 1, 'block_read', ""); $form->addAppendix('module_admin', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACTIVERIGHTS); $form->addAppendix('module_read', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACCESSRIGHTS); foreach ($item_list as $item_id => $item_name) { $form->addItem($item_id, $item_name); } echo $form->render(); ss_close_collapsable('groupstable', 'groupsicon'); }
function catManager() { global $mytree, $xoopsModule, $xoopsModuleConfig; include_once sprintf('%s/modules/%s/class/class.weblogcategories.php', XOOPS_ROOT_PATH, $xoopsModule->dirname()); include_once sprintf('%s/modules/%s/admin/mygrouppermform.php', XOOPS_ROOT_PATH, $xoopsModule->dirname()); include_once sprintf('%s/modules/%s/include/gtickets.php', XOOPS_ROOT_PATH, $xoopsModule->dirname()); xoops_cp_header(); echo sprintf('<h4>%s »» %s</h4>', indexLink(), _AM_WEBLOG_CATMANAGER); $gperm_handler =& xoops_gethandler('groupperm'); $weblogcats =& WeblogCategories::getInstance(); // $mytree->makeMySelBox('cat_title', 'cat_title'); include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; $form_add = new XoopsThemeForm(_AM_WEBLOG_ADDCAT, 'weblog_cat_form', 'catmanager.php'); $form_add->addElement(new XoopsFormText(_AM_WEBLOG_TITLE, 'cat_title', 50, 255, ''), true); $form_add->addElement(new XoopsFormLabel(_AM_WEBLOG_PCAT, $weblogcats->getMySelectBox(0, 1, 'cat_pid'))); if (isset($xoopsModuleConfig['category_post_permission']) && $xoopsModuleConfig['category_post_permission']) { $form_add->addElement(new XoopsFormSelectGroup(_AM_WEBLOG_CAT_GPERM, 'postgroup', true, '', 5, true)); } $form_add->addElement(new XoopsFormHidden('action', 'addCat')); $form_add->addElement(new XoopsFormButton('', 'catadd_button', _SUBMIT, 'submit')); $form_add->display(); $form_mod = new XoopsThemeForm(_AM_WEBLOG_MODCAT, 'weblog_cat_form', 'catmanager.php'); $form_mod->addElement(new XoopsFormLabel(_AM_WEBLOG_CAT, $weblogcats->getMySelectBox(0, 0, 'cat_id'))); $form_mod->addElement(new XoopsFormButton('', 'catmod_button', _AM_WEBLOG_GO, 'submit')); $form_mod->addElement(new XoopsFormHidden('action', 'modCat')); $form_mod->display(); // All category permit list if (isset($xoopsModuleConfig['category_post_permission']) && $xoopsModuleConfig['category_post_permission']) { $wb_cat_array = $weblogcats->getChildTreeArray(); $global_perms_array = array(); foreach ($wb_cat_array as $category_data) { $global_perms_array[$category_data['cat_id']] = $category_data['cat_title']; } $form_catgperm = new MyXoopsGroupPermForm('', $xoopsModule->mid(), 'weblog_cat_post', "<br /><hr /><br /><h4>" . _AM_WEBLOG_CAT_SETALL . "</h4>"); foreach ($global_perms_array as $perm_id => $perm_name) { $form_catgperm->addItem($perm_id, $perm_name); } $form_catgperm->addElement(new XoopsFormHidden('action', 'modCatall')); echo $form_catgperm->render(); } /* echo "<table width='100%' class='outer' cellspacing='1'>\r\n"; echo sprintf("<tr><th colspan='2'>%s</th></tr>", _AM_WEBLOG_CATMANAGER); echo sprintf('<tr valign=\'top\' align=\'left\'><form method=\'post\', action=\'catmanager.php\'><td class=\'head\'>%s<br /><br />', _AM_WEBLOG_ADDCAT); echo "<div style='font-weight:normal;'>"; echo sprintf('%s: <input type=\'text\' name=\'title\' size=\'30\' maxlength=\'50\'><br />', _AM_WEBLOG_TITLE); if ($count > 0) { echo sprintf('%s: ', _AM_WEBLOG_PCAT); $mytree->makeMySelBox('cat_title', 'cat_title', 0, 1, 'cat_pid'); } else { echo "<input type=hidden name=cat_pid value='0'>\r\n"; } echo "<input type=hidden name=desc value=''>\r\n"; echo "<input type=hidden name=imgurl value=''>\r\n"; echo "<input type=hidden name=action value=addCat>\r\n"; echo "</dev>"; echo "</td>"; echo "<td class='even'>\r\n"; echo sprintf('<input type=submit value=\'%s\'><br />', _AM_WEBLOG_GO); echo "</td></form></tr>\r\n"; if ($count > 0) { // Modify Category echo sprintf('<tr valign=\'top\' align=\'left\'><form method=\'post\', action=\'catmanager.php\'><td class=\'head\'>%s<br /><br />', _AM_WEBLOG_MODCAT); echo "<div style='font-weight:normal;'>"; echo sprintf('%s: ', _AM_WEBLOG_CAT); $mytree->makeMySelBox('cat_title', 'cat_title'); echo "<input type=hidden name=action value=modCat>\r\n"; echo "</dev>"; echo "</td>"; echo "<td class='even'>\r\n"; echo sprintf('<input type=submit value=\'%s\'><br />', _AM_WEBLOG_GO); echo "</td></form></tr>\r\n"; } echo "</table>\r\n"; */ xoops_cp_footer(); }
$perm_desc = _MP_GLOBAL_DESC; break; case 2: $perm_name = "mp_groupe"; $perm_desc = _MP_GROUPE_DESC; break; case 3: $perm_name = "module_read"; $perm_desc = _MP_ACCES_DESC; break; } if ($selected[0]) { $global_perms_array = array(GPERM_MESS => _MP_CONF_MESS, GPERM_OEIL => _MP_CONF_OEIL, GPERM_EXP => _MP_CONF_EXP, GPERM_UP => _MP_CONF_UP); } if ($selected[1]) { $gperm_handler =& xoops_gethandler('groupperm'); $member_handler =& xoops_gethandler('member'); $global_perms_array = $member_handler->getGroupList(new Criteria('groupid', XOOPS_GROUP_ANONYMOUS, '!=')); } if ($selected[2]) { $module_id = 1; $global_perms_array = array($xoopsModule->getVar('mid') => _MP_CONF_ACCES); } $permform = new MyXoopsGroupPermForm('', $module_id, $perm_name, $perm_desc); //MyXoopsGroupPermForm($title, $modid, $permname, $permdesc) foreach ($global_perms_array as $perm_id => $perm_name) { $permform->addItem($perm_id, $perm_name); } echo $permform->render(); echo "</div>\n"; xoops_cp_footer();