• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP MMCApp类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: display_links

    function display_links($module, $submod, $pages)
    {
        $MMCApp =& MMCApp::getInstance();
        $moduleObj = $MMCApp->getModule($module);
        if ($moduleObj) {
            $submodObj = $moduleObj->getSubmod($submod);
            if ($submodObj) {
                $submodPages = $submodObj->getPages();
                $hasPages = false;
                $links = "<ul>";
                foreach ($pages as $page) {
                    if (isset($submodPages[$page])) {
                        $pageObj = $submodPages[$page];
                        if ($pageObj->hasAccess($moduleObj, $submodObj)) {
                            $links .= '<li><a href="' . urlStrRedirect("{$module}/{$submod}/{$page}") . '">' . $pageObj->getDescription() . '</a></li>';
                            $hasPages = true;
                        }
                    }
                }
                $links .= "</ul>";
                if ($hasPages) {
                    echo <<<SUBPANEL
                    <div class="subpanel">
                        <h4>{$submodObj->getDescription()}</h4>
                        {$links}
                    </div>
SUBPANEL;
                }
            }
        }
    }
开发者ID:neoclust,项目名称:mmc,代码行数:31,代码来源:shortcuts.inc.php


示例2: showFav

function showFav($sort_a) {

$MMCApp =& MMCApp::getInstance();


foreach(getSorted($MMCApp->getModules()) as $mkey => $mod) {
    if (!$sort_a[$mod->getName()]) {
        continue;
    }
    if ($mod->getName()==$_GET['lmodule']) {
        $style="_select";
    } else {
        $style="";
    }
    print "<div class=\"modulefav$style\"><h3>".$mod->getDescription()."</h3>";
    foreach($sort_a[$mod->getName()] as $key => $al) {
        $submod = $mod->getSubmod($key);
        if ($mod->getName()==$_GET['lmodule']) {
            if ($submod->getName()==$_GET['lsubmod']) {
                $style="_sselect";
            } else {
                $style="_select";
            }
        } else {
            $style="";
        }


        print "<div class=\"submodfav$style\"><h4>".$submod->getDescription()."</h4>";
        foreach($al as $akey => $value) {
            $uri = $mod->getName().'/'.$key.'/'.$akey;

            $getrecop = $_GET;
            $getrecop['fav_action']='del';

            $getrecop['uri']=$uri;
            ?> <span class="redbutton"><a href="#" onClick="new Ajax.Updater('__popup_container','<?php echo  urlStr('base/main/favorites',$getrecop); ?>'); return false">X</a></span> <?



            $page = getPage($uri);
            if ($page) {
                print '<a href="'.urlStr($uri).'">'.$page->getDescription().'</a>';
            } else {
                print $uri;
            }
            ?>
            <br/>

        <?
        }
    print '</div>';
    }
    print '</div>';
}
}
开发者ID:neoclust,项目名称:mmc,代码行数:56,代码来源:favorites.php


示例3: display_content

 function display_content()
 {
     $MMCApp =& MMCApp::getInstance();
     $errors = '';
     foreach ($this->data as $module => $services_infos) {
         $moduleObj = $MMCApp->getModule($module);
         if ($errors) {
             $errors .= "<br/>";
         }
         $errors .= '<strong>' . $moduleObj->getDescription() . ' : <a class="error" href="' . urlStrRedirect('services/control/index') . '">' . sprintf(dngettext("services", "%d inactive service", "%d inactive services", count($services_infos)), count($services_infos)) . '</a></strong>';
     }
     if ($errors) {
         echo '<p class="alert alert-error">' . $errors . '</p>';
     } else {
         echo '<p class="alert alert-success"><img src="img/common/icn_yes.gif" style="vertical-align: bottom" /> ' . _T("All services are up", "services") . '</p>';
     }
 }
开发者ID:sebastiendu,项目名称:mmc,代码行数:17,代码来源:services.inc.php


示例4: __construct

 function __construct($moduleName, $pageName)
 {
     /* Add the configuration page in the sidebar */
     self::$instances[] = $this;
     global $sidemenu;
     $sidemenu->addSideMenuItem(new SideMenuItem(_($moduleName . " configuration"), "admin", "configure", $pageName, "modules/admin/graph/img/config/icn_global.gif", "modules/admin/graph/img/config/icn_global_active.gif"));
     /* Set the pages attributes, create an empty form, etc */
     $this->name = $pageName;
     $this->setSideMenu($sidemenu);
     $this->PageGenerator($moduleName);
     $this->form = new ValidatingForm();
     /*  */
     $MMCApp =& MMCApp::getInstance();
     $adminModule = $MMCApp->getModule('admin');
     $subModule = $adminModule->getSubmod('configure');
     $subModule->addPage(new Page($pageName, _($moduleName . ' configuration page')));
 }
开发者ID:sebastiendu,项目名称:mmc,代码行数:17,代码来源:configure.inc.php


示例5: Module

/**
 * module declaration
 */
$mod = new Module("proxy");
$mod->setVersion("2.5.1");
$mod->setRevision('$Rev$');
$mod->setDescription(_T("Web proxy"), "proxy");
$mod->setAPIVersion('1:1:0');
/**
 * user submod definition
 */
$submod = new SubModule("blacklist");
$submod->setDescription(_T("Proxy", "proxy"));
$submod->setImg('modules/proxy/graph/navbar/proxy');
$submod->setDefaultPage("proxy/blacklist/statut");
$submod->setPriority(300);
$page = new Page("index", _T("Blacklist", "proxy"));
$submod->addPage($page);
$page = new Page("delete", _T("Remove a domain in the blacklist", "proxy"));
$page->setOptions(array("noHeader" => True, "visible" => False));
$submod->addPage($page);
$page = new Page("add", _T("Add a domain in the blacklist", "proxy"));
$submod->addPage($page);
$page = new Page("restart", _T("Restart proxy web service", "proxy"));
$page->setOptions(array("visible" => False));
$submod->addPage($page);
$page = new Page("statut", _T("Proxy status page", "proxy"));
$submod->addPage($page);
$mod->addSubmod($submod);
$MMCApp =& MMCApp::getInstance();
$MMCApp->addModule($mod);
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:infoPackage.inc.php


示例6: createRedirectAclTemplate

function createRedirectAclTemplate($module_name, $acl, $acltab, $form)
{
    global $descArray;
    global $redirArray;
    global $tabDescArray;
    global $tabAclArray;
    $key = $module_name;
    $value = $redirArray[$module_name];
    $MMCApp =& MMCApp::getInstance();
    $base =& $MMCApp->getModule($module_name);
    $form->add(new TitleElement(_($base->getDescription()) . " " . sprintf(_(" (%s module)"), $module_name)));
    foreach ($value as $subkey => $subvalue) {
        $rowNum = 1;
        $submod =& $base->getSubmod($subkey);
        $form->add(new TitleElement(_($submod->getDescription()), 3));
        if (sizeof($subvalue) > 1) {
            $form->add(new SelectElement("acl[" . $module_name . "][" . $subkey . "]", "acltab[" . $module_name . "][" . $subkey . "]"));
        }
        $form->push(new Table());
        $form->add(new TrTitleElement(array(0 => _("Web page description"), 1 => _("Authorization"))));
        foreach ($subvalue as $actionkey => $actionvalue) {
            if ($descArray[$key][$subkey][$actionkey]) {
                if (isset($acl[$key][$subkey][$actionkey]["right"]) && $acl[$key][$subkey][$actionkey]["right"] == 'on') {
                    $form->add(new TrAclFormElement(_($descArray[$key][$subkey][$actionkey]), new CheckboxTpl("acl[" . $key . "][" . $subkey . "][" . $actionkey . "][right]"), $rowNum, array("value" => "checked")));
                } else {
                    $form->add(new TrAclFormElement(_($descArray[$key][$subkey][$actionkey]), new CheckboxTpl("acl[" . $key . "][" . $subkey . "][" . $actionkey . "][right]"), $rowNum, array("value" => "")));
                }
            } else {
                print _("Warning no desc found in infoPackage.inc.php :") . $actionkey;
            }
            $rowNum++;
            if (isset($tabAclArray[$key][$subkey][$actionkey])) {
                foreach ($tabAclArray[$key][$subkey][$actionkey] as $tabkey => $tabvalue) {
                    if ($acltab[$key][$subkey][$actionkey][$tabkey]["right"] == 'on') {
                        $t = new TrAclFormElement(_($tabDescArray[$key][$subkey][$actionkey][$tabkey]), new CheckboxTpl("acltab[" . $key . "][" . $subkey . "][" . $actionkey . "][" . $tabkey . "][right]"), $rowNum);
                        $t->setTab();
                        $form->add($t, array("value" => "checked"));
                    } else {
                        $t = new TrAclFormElement(_($tabDescArray[$key][$subkey][$actionkey][$tabkey]), new CheckboxTpl("acltab[" . $key . "][" . $subkey . "][" . $actionkey . "][" . $tabkey . "][right]"), $rowNum);
                        $t->setTab();
                        $form->add($t, array("value" => ""));
                    }
                    $rowNum++;
                }
            }
        }
        $form->pop();
    }
}
开发者ID:sebastiendu,项目名称:mmc,代码行数:49,代码来源:editacl.php


示例7: process

 /**
  * this function provide compatibility with old ACL,
  * infoPackage.inc.php system
  * generate css for all subproc
  */
 function process($module)
 {
     foreach ($this->_pages as $page) {
         $page->process($module, $this->getName());
     }
     $MMC =& MMCApp::getInstance();
     if (empty($_GET['submod'])) {
         $selected = False;
     } else {
         $selected = $_GET['submod'] == $this->getName();
     }
     if ($this->_visibility != True && $selected) {
         if ($this->_alias != Null) {
             $tmp = $_GET["submod"];
             $_GET["submod"] = $this->_alias;
             //fake url
             $parent =& $MMC->getModule($this->_parentname);
             $submod =& $parent->getSubmod($this->_alias);
             $submod->process($module);
             $_GET["submod"] = $tmp;
             return;
         }
     }
     if ($this->_img != Null) {
         if (!$selected) {
             $css = '#navbar ul li#navbar' . $this->getName() . ' {
                 width: ' . $this->_imgsize . 'px;
             }
             #navbar ul li#navbar' . $this->getName() . ' a {
                 background: url("' . $this->_img . '.png") no-repeat transparent;
                 background-position: 50% 10px;
             }
             #navbar ul li#navbar' . $this->getName() . ' a:hover {
                 background: url("' . $this->_img . '_hl.png") no-repeat transparent;
                 background-position: 50% 10px;
             }';
         } else {
             $css = '#navbar ul li#navbar' . $this->getName() . ' {
                 width: ' . $this->_imgsize . 'px;
             }
             #navbar ul li#navbar' . $this->getName() . ' a {
                 background: url("' . $this->_img . '_select.png") no-repeat white;
                 border-left: 1px solid #B2B2B2;
                 border-right: 1px solid #B2B2B2;
                 color: #EE5010;
                 background-position: 50% 8px;
             }';
         }
         $style =& $MMC->getStyle();
         $style->addCSS($css);
     }
 }
开发者ID:neoclust,项目名称:mmc,代码行数:57,代码来源:ModulesGenerator.php


示例8: isNoHeader

/**
 * @param $modules modules like base or samba
 * @param $submod sub modules like "users"
 * @param $action action like index or add
 * @return if action require noheader send
 */
function isNoHeader($pModules, $pSubmod, $pAction)
{
    $MMCApp =& MMCApp::getInstance();
    $mod = $MMCApp->getModule($pModules);
    $submodo = $mod->_submod[$pSubmod];
    $actiono = $submodo->_pages[$pAction];
    return $actiono->_options["noHeader"] || $actiono->_options["AJAX"];
}
开发者ID:sebastiendu,项目名称:mmc,代码行数:14,代码来源:modules.inc.php


示例9: getDefaultPage

function getDefaultPage()
{
    if ($_SESSION["login"] == "root") {
        $url = urlStrRedirect("base/main/default");
    } elseif (hasCorrectAcl('dashboard', 'main', 'default')) {
        $url = urlStrRedirect("dashboard/main/default");
    } else {
        $MMCApp =& MMCApp::getInstance();
        # get first page in acl list which is not a popup
        if (isset($_SESSION["acl"])) {
            foreach ($_SESSION["acl"] as $module => $modinfo) {
                foreach ($modinfo as $submod => $submodinfo) {
                    foreach ($submodinfo as $page => $pageinfo) {
                        # check page is not a popup
                        if (isset($MMCApp->_modules[$module]->_submod[$submod]->_pages[$page]) && $MMCApp->_modules[$module]->_submod[$submod]->_pages[$page]->_options['noHeader'] != 1 && $MMCApp->_modules[$module]->_submod[$submod]->_pages[$page]->_options['AJAX'] != true) {
                            # get url
                            $url = urlStrRedirect("{$module}/{$submod}/{$page}");
                            # stop foreach loops
                            break 3;
                        }
                    }
                }
            }
        }
    }
    if (!isset($url)) {
        return "index.php?error=" . urlencode(_("You do not have required rights"));
    }
    return $url;
}
开发者ID:sebastiendu,项目名称:mmc,代码行数:30,代码来源:acl.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP MO类代码示例发布时间:2022-05-23
下一篇:
PHP MIME_Type类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap