本文整理汇总了PHP中Admin::getMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::getMenu方法的具体用法?PHP Admin::getMenu怎么用?PHP Admin::getMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin
的用法示例。
在下文中一共展示了Admin::getMenu方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: home
/**
* Accueil des stats
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2007/03/19
*/
public function home()
{
if (!Admin::canAdmin()) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get()));
}
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|admin.menu.stats'));
$tpl->assign('MENU', Admin::getMenu('stats'));
$tplStats = new CopixTpl();
$modules = Kernel::getAllModules();
$tab = array();
foreach ($modules as $mod_val) {
$arModulesPath = CopixConfig::instance()->arModulesPath;
foreach ($arModulesPath as $modulePath) {
$class_file = $modulePath . $mod_val . '/' . COPIX_CLASSES_DIR . 'kernel' . $mod_val . '.class.php';
if (!file_exists($class_file)) {
continue;
}
$module_class =& CopixClassesFactory::Create($mod_val . '|Kernel' . $mod_val);
//print_r($module_class);
if (!is_callable(array($module_class, 'getStatsRoot'))) {
continue;
}
//$classeModule = CopixClassesFactory::create("$label|Kernel$label");
$tab[$mod_val]['module_nom'] = Kernel::Code2Name('mod_' . $mod_val);
$tab[$mod_val]['stats'] = $module_class->getStatsRoot();
}
}
//print_r($tab);
$tplStats->assign('tab', $tab);
$tpl->assign('MAIN', $tplStats->fetch('sysutils|stats.modules.tpl'));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例2: info
/**
* Renvoie les infos sur le cache
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2007/03/19
*/
public function info()
{
if (!Admin::canAdmin()) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get()));
}
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|admin.menu.cache'));
$tpl->assign('MENU', Admin::getMenu('cache'));
$tplCache = new CopixTpl();
$tplCache->assign('info', CopixZone::process('sysutils|cacheStatus'));
$tpl->assign('MAIN', $tplCache->fetch('sysutils|cache.info.tpl'));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例3: processPhpinfo
public function processPhpinfo()
{
$ppo = new CopixPPO();
$ppo->TITLE_PAGE = 'PHPInfo';
$ppo->MENU = Admin::getMenu('phpinfo');
$ppo->CopixVersion = COPIX_VERSION;
ob_start();
phpinfo();
$info = ob_get_contents();
ob_end_clean();
$ppo->phpinfo = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $info);
return _arPpo($ppo, 'phpinfo.tpl');
}
示例4: processAdd_Admin
public function processAdd_Admin()
{
if (!Kernel::isAdmin()) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get()));
}
$groupe_id = _request("groupe");
$tplHome = new CopixTpl();
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|admin.moduleDescription'));
$tpl->assign('MENU', Admin::getMenu('groupes'));
$tplHome->assign('groupe_id', $groupe_id);
$new_admin_check = array();
if (_request('save', 0)) {
$new_admins = _request('new_admins');
$new_admins = preg_split("/[\\s,]+/", $new_admins);
foreach ($new_admins as $new_admin) {
if (trim($new_admin) == '') {
continue;
}
$sql = "\n SELECT\n dbuser.id_dbuser, dbuser.login_dbuser,\n kernel_link_bu2user.bu_type, kernel_link_bu2user.bu_id,\n kernel_link_user2node.droit, kernel_link_user2node.debut, kernel_link_user2node.fin\n FROM dbuser\n JOIN kernel_link_bu2user ON kernel_link_bu2user.user_id=dbuser.id_dbuser\n LEFT JOIN kernel_link_user2node ON kernel_link_user2node.user_type=kernel_link_bu2user.bu_type AND kernel_link_user2node.user_id=kernel_link_bu2user.bu_id AND kernel_link_user2node.node_type='CLUB' AND kernel_link_user2node.node_id=:node_id\n WHERE dbuser.login_dbuser=:login_dbuser\n ";
$new_admin_check[$new_admin] = _doQuery($sql, array(':login_dbuser' => $new_admin, ':node_id' => $groupe_id));
if (!count($new_admin_check[$new_admin])) {
// login inconnu
// NE RIEN FAIRE !!!
} elseif (!$new_admin_check[$new_admin][0]->bu_type) {
// login non rattaché
// NE RIEN FAIRE !!!
} elseif ($new_admin_check[$new_admin][0]->droit) {
// déjà inscrit
// Modifier le droit actuel -> admin
$sql = "DELETE FROM kernel_link_user2node WHERE user_type=:user_type AND user_id=:user_id AND node_type=:node_type AND node_id=:node_id";
_doQuery($sql, array(':user_type' => $new_admin_check[$new_admin][0]->bu_type, ':user_id' => $new_admin_check[$new_admin][0]->bu_id, ':node_type' => 'CLUB', ':node_id' => $groupe_id));
$sql = "\n INSERT INTO kernel_link_user2node ( user_type, user_id, node_type, node_id, droit)\n VALUES (:user_type, :user_id, :node_type, :node_id, :droit)";
_doQuery($sql, array(':user_type' => $new_admin_check[$new_admin][0]->bu_type, ':user_id' => $new_admin_check[$new_admin][0]->bu_id, ':node_type' => 'CLUB', ':node_id' => $groupe_id, ':droit' => 70));
} else {
// Ajouter le droit -> admin
$sql = "\n INSERT INTO kernel_link_user2node ( user_type, user_id, node_type, node_id, droit)\n VALUES (:user_type, :user_id, :node_type, :node_id, :droit)";
_doQuery($sql, array(':user_type' => $new_admin_check[$new_admin][0]->bu_type, ':user_id' => $new_admin_check[$new_admin][0]->bu_id, ':node_type' => 'CLUB', ':node_id' => $groupe_id, ':droit' => 70));
}
}
$this->flash->new_admin_check = $new_admin_check;
$tplHome->assign('new_admin_check', $new_admin_check);
// echo "<pre>"; print_r($new_admin_check); echo "</pre>";
return _arRedirect(_url('sysutils|groupes|'));
$tpl->assign('MAIN', $tplHome->fetch('sysutils|groupes-addadmin-do.tpl'));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
$sql = "SELECT * FROM module_groupe_groupe WHERE id=:id";
$groupe_infos = _doQuery($sql, array(':id' => $groupe_id));
if (!$groupe_infos) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get()));
}
$tplHome->assign('groupe_id', $groupe_id);
$tplHome->assign('groupe_infos', $groupe_infos);
$tpl->assign('MAIN', $tplHome->fetch('sysutils|groupes-addadmin.tpl'));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例5: getGrvilles
public function getGrvilles()
{
if (Kernel::getLevel('ROOT', 0) < PROFILE_CCV_ADMIN) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('||'));
}
$tpl = new CopixTpl();
$tplGrVilles = new CopixTpl();
CopixHTMLHeader::addCSSLink(_resource("styles/module_admin.css"));
CopixHTMLHeader::addCSSLink(_resource("styles/module_grvilles.css"));
$tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|grvilles.module.titre'));
$dao_grvilles_gr2ville = CopixDAOFactory::create("kernel|grvilles_gr2ville");
$dao_grvilles = CopixDAOFactory::create("kernel|grvilles");
$dao_villes = CopixDAOFactory::create("kernel|kernel_tree_vil");
$villes = $dao_villes->findAll();
$tplGrVilles->assign('villes', $villes);
if (_request("delete")) {
$dao_grvilles->delete(_request("delete"));
$dao_grvilles_gr2ville->deleteByGroupe(_request("delete"));
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('sysutils|grvilles|'));
}
if (_request("save") && _request("save") == 1) {
$date = date("Y-m-d H:i:s");
$user = Kernel::getUserInfo();
if (_request("form_id") > 0) {
$grvilles_infos = $dao_grvilles->get(_request("form_id"));
$grvilles_infos->nom = _request("form_nom");
$grvilles_infos->updated_at = $date;
$grvilles_infos->updated_by = $user['login'];
$dao_grvilles->update($grvilles_infos);
$dao_grvilles_gr2ville->deleteByGroupe(_request("form_id"));
} else {
$grvilles_infos = CopixDAOFactory::createRecord("grvilles|grvilles");
$grvilles_infos->nom = _request("form_nom");
if ($grvilles_infos->nom == '') {
$grvilles_infos->nom = 'Sans nom';
}
$grvilles_infos->updated_at = date("Y-m-d H:i:s");
$grvilles_infos->updated_by = $user['login'];
$dao_grvilles->insert($grvilles_infos);
}
$grvilles_gr2ville = _record("grvilles|grvilles_gr2ville2");
$grvilles_gr2ville->id_groupe = $grvilles_infos->id;
$grvilles_gr2ville->updated_at = $date;
$grvilles_gr2ville->updated_by = $user['login'];
foreach ($villes as $ville) {
if (_request("ville_" . $ville->vil_id_vi) == 1) {
$grvilles_gr2ville->id_ville = $ville->vil_id_vi;
_dao("grvilles|grvilles_gr2ville2")->insert($grvilles_gr2ville);
}
}
if (_request("form_id") == 0) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('sysutils|grvilles|', array('groupe' => $grvilles_infos->id)));
}
}
if (_request("groupe")) {
$tplGrVilles->assign('grvilles_id', _request("groupe"));
$tplGrVilles->assign('grvilles_form', true);
if (_request("groupe") > 0) {
// Edition d'un groupe
$grvilles_infos = $dao_grvilles->get(_request("groupe"));
$grvilles_villes_raw = $dao_grvilles_gr2ville->findByGroupe(_request("groupe"));
// Tableau indexé par id de ville
$grvilles_villes = array();
foreach ($grvilles_villes_raw as $grvilles_villes_item) {
$grvilles_villes[$grvilles_villes_item->id_ville] = $grvilles_villes_item;
}
$tplGrVilles->assign('grvilles_infos', $grvilles_infos);
$tplGrVilles->assign('grvilles_villes', $grvilles_villes);
} else {
// Création d'un nouveau groupe
}
}
$grvilles_list = $dao_grvilles->findAll();
// print_r($grvilles_list);
$tplGrVilles->assign('grvilles_list', $grvilles_list);
$main = $tplGrVilles->fetch('grvilles-getgrvilles.tpl');
$tpl->assign('MAIN', $main);
$tpl->assign('MENU', Admin::getMenu());
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例6: processInstall
/**
* Installe le jeu d'essai
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2006/10/26
*/
public function processInstall()
{
global $params;
$db = new Demo_DB();
$tools = new Demo_Tools();
$db->extract_db_infos();
$db->db_connect();
$fileSQL = '../instal/demo/jeu_essai.sql';
$errors = array();
if (CopixConfig::get('kernel|jeuEssaiInstalled') == 1) {
$errors[] = CopixI18N::get('sysutils|demo.error.alreadyInstalled');
} elseif (!is_file($fileSQL)) {
$errors[] = CopixI18N::get('sysutils|demo.error.noFileSql');
}
if ($errors) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => implode('<br/>', $errors), 'back' => CopixUrl::get()));
}
$contents = file_get_contents($fileSQL);
$lines = explode(";\n", $contents);
$path = CopixUrl::getRequestedScriptPath();
foreach ($lines as $line) {
$line = trim($line);
if ($line) {
$line = str_replace('<PATH>', $path, $line);
// print_r("<br>***line=".$line);
$db->run_query($line);
}
}
$db->db_close();
// Copie des dossiers (pas de slashs à la fin!)
$tools->installFolder('www/static/malle/2_9a4ba0cdef');
$tools->installFolder('var/data/blog/logos');
$tools->installFolder('www/static/album/2_be8550b87c');
$tools->installFolder('www/static/album/3_cf057489c9');
$tools->installFolder('www/static/album/4_c996b6cf13');
$tools->installFolder('www/static/prefs/avatar');
// Fin
CopixConfig::set('kernel|jeuEssaiInstalled', 1);
// Vidage de cache
CacheServices::clearCache();
CacheServices::clearConfDB();
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|demo.titlePage'));
$tplDemo = new CopixTpl();
//$tplDemo->assign ("toto", 1);
$tplDemo->assign('demo_txt_installed', CopixI18N::get('sysutils|demo.txt.installed'));
$tplDemo->assign('demo_txt_accounts', CopixI18N::get('sysutils|demo.txt.accounts'));
$tpl->assign("MAIN", $tplDemo->fetch("demo_install.tpl"));
$tpl->assign('MENU', Admin::getMenu('demo'));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例7:
</a> <br />
</div>
<?php
}
?>
<div style="clear: both">
</div>
</div>
<div class="form-group">
<label>All Menu</label> <br/>
<label>À la carte</label> <input name="alacarte_menu[]" type="file" multiple="multiple">
<div id="links" >
<?php
$alacarte_images_arr = $adminObj->getMenu($hotel_id, "1");
foreach ($alacarte_images_arr as $alacarte_image) {
?>
<div class="gall-img">
<a href="../images/alacarte/<?php
echo $alacarte_image['image_path'];
?>
" title="" data-gallery>
<img src="../images/alacarte/<?php
echo $alacarte_image['image_path'];
?>
" alt="">
</a> <br />
<button style="margin-top: 5px;" onclick="deleteImage('<?php
echo $alacarte_image['menu_id'];
?>