当前位置: 首页>>代码示例>>PHP>>正文


PHP mosAdminMenus::groupAccess方法代码示例

本文整理汇总了PHP中mosAdminMenus::groupAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP mosAdminMenus::groupAccess方法的具体用法?PHP mosAdminMenus::groupAccess怎么用?PHP mosAdminMenus::groupAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mosAdminMenus的用法示例。


在下文中一共展示了mosAdminMenus::groupAccess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: editModule

/**
* Compiles information to add or edit a module
* @param string The current GET/POST option
* @param integer The unique id of the record to edit
*/
function editModule($option, $uid, $client)
{
    global $database, $my, $mainframe;
    global $mosConfig_absolute_path;
    $lists = array();
    $row = new mosModule($database);
    // load the row from the db table
    $row->load($uid);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        echo "<script>alert('" . sprintf(T_('The module %s is currently being edited by another administrator'), $row->title) . "'); document.location.href='index2.php?option={$option}'</script>\n";
        exit(0);
    }
    $row->title = htmlspecialchars(str_replace('&amp;', '&', $row->title));
    $row->content = htmlspecialchars(str_replace('&amp;', '&', $row->content));
    if ($uid) {
        $row->checkout($my->id);
    }
    // if a new record we must still prime the mosModule object with a default
    // position and the order; also add an extra item to the order list to
    // place the 'new' record in last position if desired
    if ($uid == 0) {
        $row->position = 'left';
        $row->showtitle = true;
        //$row->ordering = $l;
        $row->published = 1;
    }
    if ($client == 'admin') {
        $where = "client_id='1'";
        $lists['client_id'] = 1;
        $path = 'mod1_xml';
    } else {
        $where = "client_id='0'";
        $lists['client_id'] = 0;
        $path = 'mod0_xml';
    }
    $query = "SELECT position, ordering, showtitle, title" . "\n FROM #__modules" . "\n WHERE " . $where . "\n ORDER BY ordering";
    $database->setQuery($query);
    if (!($orders = $database->loadObjectList())) {
        echo $database->stderr();
        return false;
    }
    $query = "SELECT position, description" . "\n FROM #__template_positions" . "\n WHERE position <> ''";
    $database->setQuery($query);
    // hard code options for now
    $positions = $database->loadObjectList();
    $orders2 = array();
    $pos = array();
    foreach ($positions as $position) {
        $orders2[$position->position] = array();
        $pos[] = mosHTML::makeOption($position->position, $position->description);
    }
    $l = 0;
    $r = 0;
    for ($i = 0, $n = count($orders); $i < $n; $i++) {
        $ord = 0;
        if (array_key_exists($orders[$i]->position, $orders2)) {
            $ord = count(array_keys($orders2[$orders[$i]->position])) + 1;
        }
        $orders2[$orders[$i]->position][] = mosHTML::makeOption($ord, $ord . '::' . addslashes($orders[$i]->title));
    }
    // build the html select list
    $pos_select = 'onchange="changeDynaList(\'ordering\',orders,document.adminForm.position.options[document.adminForm.position.selectedIndex].value, originalPos, originalOrder)"';
    $active = $row->position ? $row->position : 'left';
    $lists['position'] = mosHTML::selectList($pos, 'position', 'class="inputbox" size="1" ' . $pos_select, 'value', 'text', $active);
    // get selected pages for $lists['selections']
    if ($uid) {
        $query = 'SELECT menuid AS value FROM #__modules_menu WHERE moduleid=' . $row->id;
        $database->setQuery($query);
        $lookup = $database->loadObjectList();
    } else {
        $lookup = array(mosHTML::makeOption(0, 'All'));
    }
    if ($row->access == 99 || $row->client_id == 1 || $lists['client_id']) {
        $lists['access'] = T_('Administrator') . '<input type="hidden" name="access" value="99" />';
        $lists['showtitle'] = T_('N/A') . ' <input type="hidden" name="showtitle" value="1" />';
        $lists['selections'] = T_('N/A');
    } else {
        if ($client == 'admin') {
            $lists['access'] = T_('N/A');
            $lists['selections'] = T_('N/A');
        } else {
            $lists['access'] = mosAdminMenus::Access($row);
            $lists['groups'] = mosAdminMenus::groupAccess($row);
            $lists['selections'] = mosAdminMenus::MenuLinks($lookup, 1, 1);
        }
        $lists['showtitle'] = mosHTML::yesnoRadioList('showtitle', 'class="inputbox"', $row->showtitle);
    }
    // build the html select list for published
    $lists['published'] = mosAdminMenus::Published($row);
    // xml file for module
    $xmlfile = $mainframe->getPath($path, $row->module);
    if ($xmlfile) {
        $xmlparser =& new mosXMLDescription($xmlfile);
        $row->description = $xmlparser->getDescription('module');
//.........这里部分代码省略.........
开发者ID:jwest00724,项目名称:mambo,代码行数:101,代码来源:admin.modules.php


注:本文中的mosAdminMenus::groupAccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。