本文整理汇总了PHP中mosAdminMenus::menutypes方法的典型用法代码示例。如果您正苦于以下问题:PHP mosAdminMenus::menutypes方法的具体用法?PHP mosAdminMenus::menutypes怎么用?PHP mosAdminMenus::menutypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mosAdminMenus
的用法示例。
在下文中一共展示了mosAdminMenus::menutypes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _form_mos_menu
/**
* @param string The name of the form element
* @param string The value of the element
* @param object The xml element for the parameter
* @param string The control name
* @return string The html for the element
*/
function _form_mos_menu($name, $value, &$node, $control_name)
{
global $database;
$menuTypes = mosAdminMenus::menutypes();
foreach ($menuTypes as $menutype) {
$options[] = mosHTML::makeOption($menutype, $menutype);
}
array_unshift($options, mosHTML::makeOption('', '- Select Menu -'));
return mosHTML::selectList($options, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value);
}
示例2: copyMenu
/**
* Form for copying item(s) to a specific menu
*/
function copyMenu($option, $cid, $menutype)
{
global $database;
if (!is_array($cid) || count($cid) < 1) {
echo "<script> alert('" . T_('Select an item to move') . "'); window.history.go(-1);</script>\n";
exit;
}
## query to list selected menu items
$cids = implode(',', $cid);
$query = "SELECT a.name FROM #__menu AS a WHERE a.id IN ( " . $cids . " )";
$database->setQuery($query);
$items = $database->loadObjectList();
$menuTypes = mosAdminMenus::menutypes();
foreach ($menuTypes as $menuType) {
$menu[] = mosHTML::makeOption($menuType, $menuType);
}
// build the html select list
$MenuList = mosHTML::selectList($menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null);
HTML_menusections::copyMenu($option, $cid, $MenuList, $items, $menutype);
}
示例3: show
/**
* Show the menu
* @param string The current user type
*/
function show($usertype = '')
{
global $acl, $database;
global $mosConfig_live_site, $mosConfig_enable_stats, $mosConfig_caching;
// cache some acl checks
$canConfig = $acl->acl_check('administration', 'config', 'users', $usertype);
$manageTemplates = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_templates');
$manageTrash = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_trash');
$manageMenuMan = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_menumanager');
$manageLanguages = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_languages');
$installModules = $acl->acl_check('administration', 'install', 'users', $usertype, 'modules', 'all');
$editAllModules = $acl->acl_check('administration', 'edit', 'users', $usertype, 'modules', 'all');
$installMambots = $acl->acl_check('administration', 'install', 'users', $usertype, 'mambots', 'all');
$editAllMambots = $acl->acl_check('administration', 'edit', 'users', $usertype, 'mambots', 'all');
$installComponents = $acl->acl_check('administration', 'install', 'users', $usertype, 'components', 'all');
$editAllComponents = $acl->acl_check('administration', 'edit', 'users', $usertype, 'components', 'all');
$canMassMail = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_massmail');
$canManageUsers = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_users');
$query = "SELECT a.id, a.title, a.name," . "\nCOUNT(DISTINCT c.id) AS numcat, COUNT(DISTINCT b.id) AS numarc" . "\n FROM #__sections AS a" . "\n LEFT JOIN #__categories AS c ON c.section=a.id" . "\n LEFT JOIN #__content AS b ON b.sectionid=a.id AND b.state=-1" . "\n WHERE a.scope='content'" . "\n GROUP BY a.id" . "\n ORDER BY a.ordering";
$database->setQuery($query);
$sections = $database->loadObjectList();
$nonemptySections = 0;
if ($sections) {
foreach ($sections as $section) {
if ($section->numcat > 0) {
$nonemptySections++;
}
}
}
$menuTypes = mosAdminMenus::menutypes();
?>
<div id="myMenuID"></div>
<script language="JavaScript" type="text/javascript">
var myMenu =
[
<?php
// Home Sub-Menu
?>
[null,'<?php
echo T_('Home');
?>
','index2.php',null,'<?php
echo T_('Control Panel');
?>
'],
_cmSplit,
<?php
// Site Sub-Menu
?>
[null,'<?php
echo T_('Site');
?>
',null,null,'<?php
echo T_('Site Management');
?>
',
<?php
if ($canConfig) {
?>
['<img src="../includes/js/ThemeOffice/config.png" />','<?php
echo T_('Global Configuration');
?>
','index2.php?option=com_config&hidemainmenu=1',null,'<?php
echo T_('Configuration');
?>
'],
<?php
}
if ($manageLanguages) {
?>
['<img src="../includes/js/ThemeOffice/language.png" />','<?php
echo T_('Language Manager');
?>
','index2.php?option=com_languages',null,'<?php
echo T_('Manage languages');
?>
'],
<?php
}
?>
['<img src="../includes/js/ThemeOffice/media.png" />','<?php
echo T_('Media Manager');
?>
','index2.php?option=com_media',null,'<?php
echo T_('Manage Media Files');
?>
'],
['<img src="../includes/js/ThemeOffice/preview.png" />', '<?php
echo T_('Preview');
?>
', null, null, '<?php
echo T_('Preview');
?>
',
['<img src="../includes/js/ThemeOffice/preview.png" />','<?php
echo T_('In New Window');
//.........这里部分代码省略.........
示例4: copyMenu
/**
* Form for copying item(s) to a specific menu
*/
function copyMenu($option, $cid, $menutype)
{
global $database;
if (!is_array($cid) || count($cid) < 1) {
echo "<script> alert('Selecione um item para mover'); window.history.go(-1);</script>\n";
exit;
}
## query to list selected menu items
mosArrayToInts($cid);
$cids = 'a.id=' . implode(' OR a.id=', $cid);
$query = "SELECT a.name" . "\n FROM #__menu AS a" . "\n WHERE ( {$cids} )";
$database->setQuery($query);
$items = $database->loadObjectList();
$menuTypes = mosAdminMenus::menutypes();
foreach ($menuTypes as $menuType) {
$menu[] = mosHTML::makeOption($menuType, $menuType);
}
// build the html select list
$MenuList = mosHTML::selectList($menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null);
HTML_menusections::copyMenu($option, $cid, $MenuList, $items, $menutype);
}
示例5: show
/**
* Show the menu
* @param string The current user type
*/
function show($usertype = '')
{
global $acl, $database;
global $mosConfig_live_site, $mosConfig_enable_stats, $mosConfig_caching;
// cache some acl checks
$canConfig = $acl->acl_check('administration', 'config', 'users', $usertype);
$manageTemplates = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_templates');
$manageTrash = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_trash');
$manageMenuMan = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_menumanager');
$manageLanguages = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_languages');
$installModules = $acl->acl_check('administration', 'install', 'users', $usertype, 'modules', 'all');
$editAllModules = $acl->acl_check('administration', 'edit', 'users', $usertype, 'modules', 'all');
$installMambots = $acl->acl_check('administration', 'install', 'users', $usertype, 'mambots', 'all');
$editAllMambots = $acl->acl_check('administration', 'edit', 'users', $usertype, 'mambots', 'all');
$installComponents = $acl->acl_check('administration', 'install', 'users', $usertype, 'components', 'all');
$editAllComponents = $acl->acl_check('administration', 'edit', 'users', $usertype, 'components', 'all');
$canMassMail = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_massmail');
$canManageUsers = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_users');
$query = "SELECT a.id, a.title, a.name" . "\n FROM #__sections AS a" . "\n WHERE a.scope = 'content'" . "\n GROUP BY a.id" . "\n ORDER BY a.ordering";
$database->setQuery($query);
$sections = $database->loadObjectList();
$menuTypes = mosAdminMenus::menutypes();
?>
<div id="myMenuID"></div>
<script language="JavaScript" type="text/javascript">
var myMenu =
[
<?php
// Home Sub-Menu
?>
[null,'Início','index2.php',null,'Painel de Controle'],
_cmSplit,
<?php
// Site Sub-Menu
?>
[null,'Site',null,null,'Administração do site',
<?php
if ($canConfig) {
?>
['<img src="../includes/js/ThemeOffice/config.png" />','Configuração Global','index2.php?option=com_config&hidemainmenu=1',null,'Configurações globais do Joomla'],
<?php
}
if ($manageLanguages) {
?>
['<img src="../includes/js/ThemeOffice/language.png" />','Idiomas',null,null,'Administrar idiomas',
['<img src="../includes/js/ThemeOffice/language.png" />','Idiomas do Site','index2.php?option=com_languages',null,'Administração de idiomas'],
],
<?php
}
?>
['<img src="../includes/js/ThemeOffice/media.png" />','Administrar Mídia','index2.php?option=com_media',null,'Administrar os arquivos de mídia'],
['<img src="../includes/js/ThemeOffice/preview.png" />','Pré-visualizar', null, null, 'Pré-visualizar o site',
['<img src="../includes/js/ThemeOffice/preview.png" />','Nova Janela','<?php
echo $mosConfig_live_site;
?>
/index.php','_blank','<?php
echo $mosConfig_live_site;
?>
'],
['<img src="../includes/js/ThemeOffice/preview.png" />','Mesma Janela','index2.php?option=com_admin&task=preview',null,'<?php
echo $mosConfig_live_site;
?>
'],
['<img src="../includes/js/ThemeOffice/preview.png" />','Mostrar Posições','index2.php?option=com_admin&task=preview2',null,'<?php
echo $mosConfig_live_site;
?>
'],
],
['<img src="../includes/js/ThemeOffice/globe1.png" />', 'Estatísticas', null, null, 'Estatísticas do Site',
<?php
if ($mosConfig_enable_stats == 1) {
?>
['<img src="../includes/js/ThemeOffice/globe4.png" />', 'Navegador, SO, Domínio', 'index2.php?option=com_statistics', null, 'Navegador, Sistema Operacional, Domínios'],
<?php
}
?>
['<img src="../includes/js/ThemeOffice/search_text.png" />', 'Pesquisar Texto', 'index2.php?option=com_statistics&task=searches', null, 'Pesquisas textuais']
],
<?php
if ($manageTemplates) {
?>
['<img src="../includes/js/ThemeOffice/template.png" />','Administrar Temas',null,null,'Mude o modelo do site',
['<img src="../includes/js/ThemeOffice/template.png" />','Temas do Site','index2.php?option=com_templates',null,'Alterar o tema do site'],
_cmSplit,
['<img src="../includes/js/ThemeOffice/template.png" />','Temas da Administração','index2.php?option=com_templates&client=admin',null,'Alterar o tema da área de administração'],
_cmSplit,
['<img src="../includes/js/ThemeOffice/template.png" />','Posição dos Módulos','index2.php?option=com_templates&task=positions',null,'Posições do tema para módulos']
],
<?php
}
if ($manageTrash) {
?>
['<img src="../includes/js/ThemeOffice/trash.png" />','Administrar Lixeira','index2.php?option=com_trash',null,'Administrar itens apagados'],
<?php
}
if ($canManageUsers || $canMassMail) {
//.........这里部分代码省略.........
示例6: showMenu
/**
* Compiles a list of menumanager items
*/
function showMenu($option)
{
global $database, $mainframe, $mosConfig_list_limit;
$limit = intval($mainframe->getUserStateFromRequest("viewlistlimit", 'limit', $mosConfig_list_limit));
$limitstart = intval($mainframe->getUserStateFromRequest("view{" . $option . "}limitstart", 'limitstart', 0));
$menuTypes = mosAdminMenus::menutypes();
$total = count($menuTypes);
$i = 0;
$menus = array();
foreach ($menuTypes as $a) {
$menus[$i] = new StdClass();
$menus[$i]->type = $a;
// query to get number of modules for menutype
$query = "SELECT count( id )" . "\n FROM #__modules" . "\n WHERE module = 'mod_mainmenu'" . "\n AND params LIKE '%" . $database->getEscaped($a) . "%'";
$database->setQuery($query);
$modules = $database->loadResult();
if (!$modules) {
$modules = '-';
}
$menus[$i]->modules = $modules;
$i++;
}
// Query to get published menu item counts
$query = "SELECT a.menutype, count( a.menutype ) as num" . "\n FROM #__menu AS a" . "\n WHERE a.published = 1" . "\n GROUP BY a.menutype" . "\n ORDER BY a.menutype";
$database->setQuery($query);
$published = $database->loadObjectList();
// Query to get unpublished menu item counts
$query = "SELECT a.menutype, count( a.menutype ) as num" . "\n FROM #__menu AS a" . "\n WHERE a.published = 0" . "\n GROUP BY a.menutype" . "\n ORDER BY a.menutype";
$database->setQuery($query);
$unpublished = $database->loadObjectList();
// Query to get trash menu item counts
$query = "SELECT a.menutype, count( a.menutype ) as num" . "\n FROM #__menu AS a" . "\n WHERE a.published = -2" . "\n GROUP BY a.menutype" . "\n ORDER BY a.menutype";
$database->setQuery($query);
$trash = $database->loadObjectList();
for ($i = 0; $i < $total; $i++) {
// adds published count
foreach ($published as $count) {
if ($menus[$i]->type == $count->menutype) {
$menus[$i]->published = $count->num;
}
}
if (@(!$menus[$i]->published)) {
$menus[$i]->published = '-';
}
// adds unpublished count
foreach ($unpublished as $count) {
if ($menus[$i]->type == $count->menutype) {
$menus[$i]->unpublished = $count->num;
}
}
if (@(!$menus[$i]->unpublished)) {
$menus[$i]->unpublished = '-';
}
// adds trash count
foreach ($trash as $count) {
if ($menus[$i]->type == $count->menutype) {
$menus[$i]->trash = $count->num;
}
}
if (@(!$menus[$i]->trash)) {
$menus[$i]->trash = '-';
}
}
require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/includes/pageNavigation.php';
$pageNav = new mosPageNav($total, $limitstart, $limit);
HTML_menumanager::show($option, $menus, $pageNav);
}
示例7: show
/**
* Show the menu
* @param string The current user type
*/
public static function show($usertype = '')
{
global $acl, $database;
global $mosConfig_live_site, $mosConfig_enable_stats, $mosConfig_caching;
// cache some acl checks
$canConfig = $acl->acl_check('administration', 'config', 'users', $usertype);
$manageTemplates = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_templates');
$manageTrash = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_trash');
$manageMenuMan = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_menumanager');
$manageLanguages = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_languages');
$installModules = $acl->acl_check('administration', 'install', 'users', $usertype, 'modules', 'all');
$editAllModules = $acl->acl_check('administration', 'edit', 'users', $usertype, 'modules', 'all');
$installMambots = $acl->acl_check('administration', 'install', 'users', $usertype, 'mambots', 'all');
$editAllMambots = $acl->acl_check('administration', 'edit', 'users', $usertype, 'mambots', 'all');
$installComponents = $acl->acl_check('administration', 'install', 'users', $usertype, 'components', 'all');
$editAllComponents = $acl->acl_check('administration', 'edit', 'users', $usertype, 'components', 'all');
$canMassMail = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_massmail');
$canManageUsers = $acl->acl_check('administration', 'manage', 'users', $usertype, 'components', 'com_users');
$query = "SELECT a.id, a.title, a.name" . "\n FROM #__sections AS a" . "\n WHERE a.scope = 'content'" . "\n GROUP BY a.id" . "\n ORDER BY a.ordering";
$database->setQuery($query);
$sections = $database->loadObjectList();
$menuTypes = mosAdminMenus::menutypes();
?>
<div id="myMenuID"></div>
<script language="JavaScript" type="text/javascript">
var myMenu =
[
<?php
// Home Sub-Menu
?>
[null,'Home','index2.php',null,'Control Panel'],
_cmSplit,
<?php
// Site Sub-Menu
?>
[null,'Site',null,null,'Site Management',
<?php
if ($canConfig) {
?>
['<img src="../includes/js/ThemeOffice/config.png" />','Global Configuration','index2.php?option=com_config&hidemainmenu=1',null,'Configuration'],
<?php
}
if ($manageLanguages) {
?>
['<img src="../includes/js/ThemeOffice/language.png" />','Language Manager',null,null,'Manage languages',
['<img src="../includes/js/ThemeOffice/language.png" />','Site Languages','index2.php?option=com_languages',null,'Manage Languages'],
],
<?php
}
?>
['<img src="../includes/js/ThemeOffice/media.png" />','Media Manager','index2.php?option=com_media',null,'Manage Media Files'],
['<img src="../includes/js/ThemeOffice/preview.png" />', 'Preview', null, null, 'Preview',
['<img src="../includes/js/ThemeOffice/preview.png" />','In New Window','<?php
echo $mosConfig_live_site;
?>
/index.php','_blank','<?php
echo $mosConfig_live_site;
?>
'],
['<img src="../includes/js/ThemeOffice/preview.png" />','Inline','index2.php?option=com_admin&task=preview',null,'<?php
echo $mosConfig_live_site;
?>
'],
['<img src="../includes/js/ThemeOffice/preview.png" />','Inline with Positions','index2.php?option=com_admin&task=preview2',null,'<?php
echo $mosConfig_live_site;
?>
'],
],
['<img src="../includes/js/ThemeOffice/globe1.png" />', 'Statistics', null, null, 'Site Statistics',
<?php
if ($mosConfig_enable_stats == 1) {
?>
['<img src="../includes/js/ThemeOffice/globe4.png" />', 'Browser, OS, Domain', 'index2.php?option=com_statistics', null, 'Browser, OS, Domain'],
<?php
}
?>
['<img src="../includes/js/ThemeOffice/search_text.png" />', 'Search Text', 'index2.php?option=com_statistics&task=searches', null, 'Search Text']
],
<?php
if ($manageTemplates) {
?>
['<img src="../includes/js/ThemeOffice/template.png" />','Template Manager',null,null,'Change site template',
['<img src="../includes/js/ThemeOffice/template.png" />','Site Templates','index2.php?option=com_templates',null,'Change site template'],
_cmSplit,
['<img src="../includes/js/ThemeOffice/template.png" />','Administrator Templates','index2.php?option=com_templates&client=admin',null,'Change admin template'],
_cmSplit,
['<img src="../includes/js/ThemeOffice/template.png" />','Module Positions','index2.php?option=com_templates&task=positions',null,'Template positions']
],
<?php
}
if ($manageTrash) {
?>
['<img src="../includes/js/ThemeOffice/trash.png" />','Trash Manager','index2.php?option=com_trash',null,'Manage Trash'],
<?php
}
if ($canManageUsers || $canMassMail) {
//.........这里部分代码省略.........