public static function OnMenuCreation()
 {
     if (UserRights::IsAdministrator()) {
         $oAdminMenu = new MenuGroup('AdminTools', 80);
         new WebPageMenuNode('ConfigEditor', utils::GetAbsoluteUrlModulesRoot() . 'itop-config/config.php', $oAdminMenu->GetIndex(), 18);
     }
 }
 public static function OnMenuCreation()
 {
     // Add the admin menus
     if (UserRights::IsAdministrator()) {
         $oAdminMenu = new MenuGroup('AdminTools', 80);
         new OQLMenuNode('UserAccountsMenu', 'SELECT User', $oAdminMenu->GetIndex(), 1, true);
         new OQLMenuNode('ProfilesMenu', 'SELECT URP_Profiles', $oAdminMenu->GetIndex(), 2);
         new WebPageMenuNode('NotificationsMenu', utils::GetAbsoluteUrlAppRoot() . 'pages/notifications.php', $oAdminMenu->GetIndex(), 3);
         new OQLMenuNode('AuditCategories', 'SELECT AuditCategory', $oAdminMenu->GetIndex(), 4);
         new WebPageMenuNode('RunQueriesMenu', utils::GetAbsoluteUrlAppRoot() . 'pages/run_query.php', $oAdminMenu->GetIndex(), 8);
         new OQLMenuNode('QueryMenu', 'SELECT Query', $oAdminMenu->GetIndex(), 8.5, true);
         new WebPageMenuNode('ExportMenu', utils::GetAbsoluteUrlAppRoot() . 'webservices/export-v2.php?interactive=1', $oAdminMenu->GetIndex(), 9);
         new WebPageMenuNode('DataModelMenu', utils::GetAbsoluteUrlAppRoot() . 'pages/schema.php', $oAdminMenu->GetIndex(), 10);
         new WebPageMenuNode('UniversalSearchMenu', utils::GetAbsoluteUrlAppRoot() . 'pages/UniversalSearch.php', $oAdminMenu->GetIndex(), 11);
     }
 }
 public static function OnMenuCreation()
 {
     $oToolsMenu = new MenuGroup('DataAdministration', 70, 'Organization', UR_ACTION_MODIFY, UR_ALLOWED_YES | UR_ALLOWED_DEPENDS);
     new WebPageMenuNode('CSVImportMenu', utils::GetAbsoluteUrlAppRoot() . 'pages/csvimport.php', $oToolsMenu->GetIndex(), 1);
     // Add the admin menus
     if (UserRights::IsAdministrator()) {
         $oAdminMenu = new MenuGroup('AdminTools', 80);
         new OQLMenuNode('UserAccountsMenu', 'SELECT User', $oAdminMenu->GetIndex(), 1);
         new OQLMenuNode('ProfilesMenu', 'SELECT URP_Profiles', $oAdminMenu->GetIndex(), 2);
         new WebPageMenuNode('NotificationsMenu', utils::GetAbsoluteUrlAppRoot() . 'pages/notifications.php', $oAdminMenu->GetIndex(), 3);
         new OQLMenuNode('AuditCategories', 'SELECT AuditCategory', $oAdminMenu->GetIndex(), 4);
         new WebPageMenuNode('RunQueriesMenu', utils::GetAbsoluteUrlAppRoot() . 'pages/run_query.php', $oAdminMenu->GetIndex(), 8);
         new OQLMenuNode('QueryMenu', 'SELECT Query', $oAdminMenu->GetIndex(), 8.5, true);
         new WebPageMenuNode('ExportMenu', utils::GetAbsoluteUrlAppRoot() . 'webservices/export.php', $oAdminMenu->GetIndex(), 9);
         new WebPageMenuNode('DataModelMenu', utils::GetAbsoluteUrlAppRoot() . 'pages/schema.php', $oAdminMenu->GetIndex(), 10);
         new WebPageMenuNode('UniversalSearchMenu', utils::GetAbsoluteUrlAppRoot() . 'pages/UniversalSearch.php', $oAdminMenu->GetIndex(), 11);
     }
 }
 /**
  * 添加分组
  * 请求类型:POST
  */
 public function addGroup()
 {
     $record = array('shop_id' => Auth::user()->shop_id, 'name' => Input::get('classify_name'), 'icon' => '');
     $rules = array('name' => 'required | max:50');
     var_dump($record);
     $v = Validator::make($record, $rules);
     if ($v->fails()) {
         $message = $v->messages();
         $error['msg'] = $message->toArray();
         $error['status'] = '400';
         return $error;
     }
     $group = new MenuGroup($record);
     if ($group->save()) {
         return Redirect::to('category')->with('catMsg', '添加分类成功!');
         //return json_encode(array(	'status' => '200', 'msg'    => 'add finished'));
     } else {
         return json_encode(array('status' => '400', 'msg' => 'add failed'));
     }
 }
 public function getCMSFields($params = array())
 {
     $fields = new FieldList(DropdownField::create("ProductID", "Product", Product::get()->map()->toArray())->setHasEmptyDefault(true));
     $menu = $this->Menu();
     if (!$menu->exists()) {
         $menu = isset($params["MenuID"]) ? Menu::get()->byID((int) $params["MenuID"]) : null;
     }
     if ($menu && $menu->exists()) {
         $fields->push(DropdownField::create("GroupID", 'Menu Group', MenuGroup::get()->filter("ParentID", $this->MenuID)->map('ID', 'Title')->toArray())->setHasEmptyDefault(true));
     }
     if ($this->Product()->exists() && !$this->Product()->canPurchase()) {
         $fields->push(LiteralField::create("purchasenote", "<p class=\"message warning\">This product can't be purchased, so it won't show up in menus</p>"));
     }
     return $fields;
 }
        if ($iMaxReplica) {
            // Consider a given subset, starting from replica iCurrPos, limited to the count of iMaxReplica
            // The replica have to be ordered by id
            $oSetToProcess = new DBObjectSet(DBObjectSearch::FromOQL($sSelectToDelete), array('id' => true), array('source_id' => $this->m_oDataSource->GetKey(), 'last_import' => $sDeletionDate, 'curr_pos' => $iCurrPos));
            $oSetToProcess->SetLimit($iMaxReplica);
        } else {
            $oSetToProcess = $oSetScope;
        }
        $iLastReplicaProcessed = -1;
        while ($oReplica = $oSetToProcess->Fetch()) {
            $iLastReplicaProcessed = $oReplica->GetKey();
            $this->m_oStatLog->AddTrace("Destination object to be DELETED", $oReplica);
            $oReplica->DeleteDestObject($this->m_oChange, $this->m_oStatLog);
        }
        if ($iMaxReplica) {
            if ($iMaxReplica < $iCountScope) {
                // Continue with this job!
                $this->m_oStatLog->Set('status_curr_pos', $iLastReplicaProcessed);
                return true;
            }
        }
        // Job complete!
        $this->m_oStatLog->Set('status_curr_job', 0);
        $this->m_oStatLog->Set('status_curr_pos', -1);
        return false;
    }
}
$oAdminMenu = new MenuGroup('AdminTools', 80, 'SynchroDataSource', UR_ACTION_MODIFY, UR_ALLOWED_YES);
new OQLMenuNode('DataSources', 'SELECT SynchroDataSource', $oAdminMenu->GetIndex(), 12, true, 'SynchroDataSource', UR_ACTION_MODIFY, UR_ALLOWED_YES);
//	new OQLMenuNode('Replicas', 'SELECT SynchroReplica', $oAdminMenu->GetIndex(), 12 /* fRank */, true, 'SynchroReplica', UR_ACTION_MODIFY, UR_ALLOWED_YES);
//	new WebPageMenuNode('Test:RunSynchro', '../synchro/synchro_exec.php', $oAdminMenu->GetIndex(), 13 /* fRank */, 'SynchroDataSource');
Example #7
0
echo Yii::app()->request->baseUrl;
?>
/js/menu/inestedsortable.js"></script>
<script src="<?php 
echo Yii::app()->request->baseUrl;
?>
/js/menu/menu.js"></script>

</head>
<body>
	<section>
		<article>
			<section>
				<ul id="menu-group">
                <?php 
$menu_groupss = MenuGroup::model()->findAll();
?>
					<?php 
foreach ($menu_groupss as $menu_group) {
    ?>
					<li id="group-<?php 
    echo $menu_group->id;
    ?>
">
						<a href="<?php 
    echo 'site';
    ?>
">
							<?php 
    echo $menu_group->title;
    ?>
 public static function OnMenuCreation()
 {
     if (UserRights::IsAdministrator()) {
         $oAdminMenu = new MenuGroup('AdminTools', 80);
         new WebPageMenuNode('BackupStatus', utils::GetAbsoluteUrlModulePage('itop-backup', 'status.php'), $oAdminMenu->GetIndex(), 15);
     }
 }