本文整理汇总了PHP中Menu::addMenuItem方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::addMenuItem方法的具体用法?PHP Menu::addMenuItem怎么用?PHP Menu::addMenuItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::addMenuItem方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMenu
public static function addMenu($menuItemArray)
{
echo "<div id=\"menu\">\n<table>\n";
// always have a logout
Menu::addMenuItem(MENU_LOGOUT);
for ($k = 0; $k < count($menuItemArray); $k++) {
Menu::addMenuItem($menuItemArray[$k]);
}
// $k
// always able to see self's schedule
$author = getWorkerAuthenticated();
$worker = getWorkerCurrent();
$expo = getExpoCurrent($author->workerid);
$station = getStationCurrent($author->workerid);
if (is_null($worker)) {
$worker = $author;
}
if ($author->isOrganizer() || $author->isSupervisor()) {
# Menu::addMenuItem(MENU_WORKER_MESSAGE);
if (!is_null($expo)) {
if (strpos($_SERVER['SCRIPT_URL'], "ShiftCheckInPage.php")) {
Menu::addMenuItem(MENU_EXPO_CHECKIN_CLIENT);
} else {
if (!strpos($_SERVER['SCRIPT_URL'], "ExpoCheckInPage.php")) {
if (!is_null($station)) {
Menu::addMenuItem(MENU_CHECKIN_CLIENT);
} else {
Menu::addMenuItem(MENU_EXPO_CHECKIN_CLIENT);
}
}
}
}
}
if (!is_null($expo)) {
if (!strpos($_SERVER['SCRIPT_URL'], Menu::$MENU_ACTION_ARRAY[MENU_VIEW_EXPOCURRENT])) {
Menu::addMenuItem(MENU_VIEW_EXPOCURRENT);
}
Menu::addMenuItem(MENU_VIEW_SCHEDULE, !$expo->scheduleVisible);
}
Menu::addMenuItem(MENU_VIEW_WORKER);
echo "</table>\n</div><!-- menu -->\n";
return;
}
示例2: setMenu
/**
* Declares an association between this object and a Menu object.
*
* @param Menu $v
* @return MenuItem The current object (for fluent API support)
* @throws PropelException
*/
public function setMenu(Menu $v = null)
{
if ($v === null) {
$this->setMenuId(NULL);
} else {
$this->setMenuId($v->getId());
}
$this->aMenu = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Menu object, it will not be re-added.
if ($v !== null) {
$v->addMenuItem($this);
}
return $this;
}
示例3: Menu
<?php
PHPWS_Core::initModClass('othermenu', 'Menu.php');
$menu = new Menu('Main', 'main');
$menu->addSubMenu('Search', 'search');
$menu->addMenuItem('Settings2', 'settings2', 'search');
Layout::add($menu->show());
示例4: addMenuItem
public function addMenuItem($name = '', $url = '', $parent = 'main', $enable = 1)
{
$this->menu->addMenuItem($name, $url, $parent, $enable, 0, static::$module);
}
示例5: Menu
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/model/menu.php';
$menu = new Menu($_POST['restaurant_id']);
print_r($menu->addMenuItem($_POST));
示例6: getDashboardMenu
public function getDashboardMenu($instance)
{
$fb_data_tpl = Utils::getPluginViewDirectory('facebook') . 'facebook.inline.view.tpl';
$menus = array();
$posts_menu = new Menu('Posts');
//All tab
$alltab = new MenuItem("all_facebook_posts", "All", '', $fb_data_tpl);
$alltabds = new Dataset("all_facebook_posts", 'PostDAO', "getAllPosts", array($instance->network_user_id, $instance->network, 15, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, $instance->network, GridController::MAX_ROWS), false);
$alltab->addDataset($alltabds);
$posts_menu->addMenuItem($alltab);
// Most replied-to tab
$mrttab = new MenuItem("mostreplies", "Most replied-to", "Posts with most replies", $fb_data_tpl);
$mrttabds = new Dataset("most_replied_to_posts", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, $instance->network, 15, '#page_number#'));
$mrttab->addDataset($mrttabds);
$posts_menu->addMenuItem($mrttab);
//Questions tab
$qtab = new MenuItem("questions", "Inquiries", "Inquiries, or posts with a question mark in them", $fb_data_tpl);
$qtabds = new Dataset("all_facebook_posts", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, $instance->network, 15, "#page_number#"));
$qtab->addDataset($qtabds);
$posts_menu->addMenuItem($qtab);
array_push($menus, $posts_menu);
return $menus;
}
示例7: getMenu
$this->_menu[] = $newLink;
}
public function getMenu()
{
$menuHTML = '<ul>';
foreach ($this->_menu as $menuItem) {
$menuHTML .= '<li>' . $menuItem . '</li>';
}
$menuHTML .= '</ul>';
return $menuHTML;
}
}
$link2 = Link::newLink('NJIT', 'http://njit.edu', '_BLANK');
$link3 = Link::newLink('CNN', 'http://cnn.com', '_BLANK');
$menu = new Menu();
$menu->addMenuItem($link);
$menu->addMenuItem($link2);
$menu->addMenuItem($link3);
$html = $menu->getMenu();
echo $html;
// Input field class
class Input
{
public static function newInput($type, $name, $value)
{
$input = '<input type="' . $type . '" name="' . $name . '" value="' . $value . '">';
return $input;
}
}
$inputField = Input::newInput('text', 'fname', 'First Name');
echo $inputField;
示例8:
?>
</td>
</tr>
<tr>
<td class="fieldTitle">Repeat Password:</td>
<td><?php
echo '<input type="password" name="repeat" value="" size="30"
onkeyup="repeatCheck(document.forms[\'workerloginpage_change_form\'][\'repeat\'])"
onchange="repeatCheck(document.forms[\'workerloginpage_change_form\'][\'repeat\'])" />';
?>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" id="submit" value="Change Password"/></td>
</tr>
</table></form>
</div><!-- workerloginchangepage_change -->
</div><!-- main -->
<?php
// Change PW page handles menus differently!
echo '<div id="menu"><table>';
Menu::addMenuItem(MENU_LOGOUT);
echo '</table></div><!-- menu -->';
include 'section/footer.php';
?>
</div><!-- container -->
</body></html>
示例9: getDashboardMenu
public function getDashboardMenu($instance)
{
$twitter_data_tpl = Utils::getPluginViewDirectory('twitter') . 'twitter.inline.view.tpl';
$menus = array();
$tweets_menu = new Menu('Tweets');
//All tab
$all_mi = new MenuItem("tweets-all", "All Tweets", "All tweets", $twitter_data_tpl);
$all_mi_ds = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 15, "#page_number#"), 'getAllPostsIterator', array($instance->network_user_id, 'twitter', GridController::MAX_ROWS));
$all_mi->addDataset($all_mi_ds);
$tweets_menu->addMenuItem($all_mi);
//Questions
$q_mi = new MenuItem("tweets-questions", "Inquiries", "Inquiries, or tweets with a question mark in them", $twitter_data_tpl);
$q_mi_ds = new Dataset("all_tweets", 'PostDAO', "getAllQuestionPosts", array($instance->network_user_id, 'twitter', 15, "#page_number#"));
$q_mi->addDataset($q_mi_ds);
$tweets_menu->addMenuItem($q_mi);
// Most replied-to
$mrt_mi = new MenuItem("tweets-mostreplies", "Most replied-to", "Tweets with most replies", $twitter_data_tpl);
$mrt_mi_ds = new Dataset("most_replied_to_tweets", 'PostDAO', "getMostRepliedToPosts", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$mrt_mi->addDataset($mrt_mi_ds);
$tweets_menu->addMenuItem($mrt_mi);
// Most shared
$mstab = new MenuItem("tweets-mostretweeted", "Most retweeted", "Most retweeted tweets", $twitter_data_tpl);
$mstabds = new Dataset("most_retweeted", 'PostDAO', "getMostRetweetedPosts", array($instance->network_user_id, 'twitter', 15, '#page_number#'));
$mstab->addDataset($mstabds);
$tweets_menu->addMenuItem($mstab);
array_push($menus, $tweets_menu);
$replies_menu = new Menu('Replies');
if (Session::isLoggedIn()) {
//show protected tweets
//All Mentions
$amtab = new MenuItem("mentions-all", "All Mentions", "Any post that mentions you", $twitter_data_tpl);
$amtabds1 = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 15), "getAllMentionsIterator", array($instance->network_username, GridController::MAX_ROWS, 'twitter'));
$amtabds2 = new Dataset("all_mentions", 'PostDAO', "getAllMentions", array($instance->network_username, 15, $instance->network, '#page_number#'));
$amtab->addDataset($amtabds1);
$amtab->addDataset($amtabds2);
$replies_menu->addMenuItem($amtab);
//All Replies
$artab = new MenuItem("mentions-allreplies", "Replies", "Posts that directly reply to you (i.e., start with your name)", $twitter_data_tpl);
$artabds = new Dataset("all_replies", 'PostDAO', "getAllReplies", array($instance->network_user_id, 'twitter', 15));
$artab->addDataset($artabds);
$replies_menu->addMenuItem($artab);
//All Orphan Mentions
$omtab = new MenuItem("mentions-orphan", "Not Replies or Forwards", "Mentions that are not associated with a specific post", $twitter_data_tpl);
$omtabds1 = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 15));
$omtabds2 = new Dataset("orphan_replies", 'PostDAO', "getOrphanReplies", array($instance->network_username, 5, $instance->network));
$omtab->addDataset($omtabds1);
$omtab->addDataset($omtabds2);
$replies_menu->addMenuItem($omtab);
//All Mentions Standalone
$sttab = new MenuItem("mentions-standalone", "Standalone Mentions", "Mentions you have marked as standalone", $twitter_data_tpl);
$sttabds1 = new Dataset("standalone_replies", 'PostDAO', "getStandaloneReplies", array($instance->network_username, 'twitter', 15));
$sttabds2 = new Dataset("all_tweets", 'PostDAO', "getAllPosts", array($instance->network_user_id, 'twitter', 15));
$sttab->addDataset($sttabds1);
$sttab->addDataset($sttabds2);
$replies_menu->addMenuItem($sttab);
} else {
//All public mentions
$amtab = new MenuItem("mentions-all", "All Mentions", "Any post that mentions you", $twitter_data_tpl);
$amtabds2 = new Dataset("all_mentions", 'PostDAO', "getAllMentions", array($instance->network_username, 15, $instance->network, '#page_number#', true));
$amtab->addDataset($amtabds2);
$replies_menu->addMenuItem($amtab);
}
// Conversations
$convotab = new MenuItem("tweets-convo", "Conversations", "Exchanges between you and other users", $twitter_data_tpl);
$convotabds = new Dataset("author_replies", 'PostDAO', "getPostsAuthorHasRepliedTo", array($instance->network_user_id, 15, 'twitter', '#page_number#'));
$convotab->addDataset($convotabds);
$replies_menu->addMenuItem($convotab);
array_push($menus, $replies_menu);
$friends_menu = new Menu('Who You Follow');
//Most Active Friends
$motab = new MenuItem("friends-mostactive", 'Chatterboxes', '', $twitter_data_tpl);
$motabds = new Dataset('people', 'FollowDAO', "getMostActiveFollowees", array($instance->network_user_id, 'twitter', 15));
$motab->addDataset($motabds);
$friends_menu->addMenuItem($motab);
//Least Active Friends
$latab = new MenuItem("friends-leastactive", 'Deadbeats', '', $twitter_data_tpl);
$latabds = new Dataset("people", 'FollowDAO', "getLeastActiveFollowees", array($instance->network_user_id, 'twitter', 15));
$latab->addDataset($latabds);
$friends_menu->addMenuItem($latab);
//Popular friends
$poptab = new MenuItem("friends-mostfollowed", 'Popular', '', $twitter_data_tpl);
$poptabds = new Dataset("people", 'FollowDAO', "getMostFollowedFollowees", array($instance->network_user_id, 'twitter', 15));
$poptab->addDataset($poptabds);
$friends_menu->addMenuItem($poptab);
if (Session::isLoggedIn()) {
//Former Friends
$fftab = new MenuItem("friends-former", "Former", '', $twitter_data_tpl);
$fftabds = new Dataset("people", 'FollowDAO', "getFormerFollowees", array($instance->network_user_id, 'twitter', 15));
$fftab->addDataset($fftabds);
$friends_menu->addMenuItem($fftab);
//Not Mutual Friends
$nmtab = new MenuItem("friends-notmutual", "Not Mutual", '', $twitter_data_tpl);
$nmtabds = new Dataset("people", 'FollowDAO', "getFriendsNotFollowingBack", array('twitter', $instance->network_user_id));
$nmtab->addDataset($nmtabds);
$friends_menu->addMenuItem($nmtab);
}
array_push($menus, $friends_menu);
$followers_menu = new Menu('Followers');
//Follower count history
$follower_history_tpl = Utils::getPluginViewDirectory('twitter') . 'twitter.followercount.tpl';
//.........这里部分代码省略.........
示例10: generateMenu
public function generateMenu()
{
$menu = new Menu();
/******************************************
* Horux menu
*/
$horux = new MenuItem('null', 'Horux', '#');
$horux->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-controlPanel.png\" />'", Prado::localize('Control Panel', array(), "messages"), $this->Service->constructUrl('controlPanel.ControlPanel'), 1));
$horux->addSplit();
$horux->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-superUser.png\" />'", Prado::localize('Super User', array(), "messages"), $this->Service->constructUrl('superuser.userList'), $this->isAccess('superuser.userList')));
$horux->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-superGroupUser.png\" />'", Prado::localize('Super User Group', array(), "messages"), $this->Service->constructUrl('superuser.userGroupList'), $this->isAccess('superuser.userGroupList')));
$horux->addSplit();
$horux->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-configure.png\" />'", Prado::localize('Configuration', array(), "messages"), $this->Service->constructUrl('configuration.config'), $this->isAccess('configuration.config')));
/******************************************
* System menu
*/
$system = new MenuItem('null', Prado::localize('System', array(), "messages"), '#');
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-site.png\" />'", Prado::localize('Site', array(), "messages"), $this->Service->constructUrl('site.Site'), $this->isAccess('site.Site')));
if ($this->isAccess('site.Site')) {
$this->systemMenuCount++;
}
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-department.png\" />'", Prado::localize('Department', array(), "messages"), $this->Service->constructUrl('site.department'), $this->isAccess('site.department')));
if ($this->isAccess('site.department')) {
$this->systemMenuCount++;
}
$system->addSplit();
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-horuxcontroller.png\" />'", Prado::localize('Horux Controller', array(), "messages"), $this->Service->constructUrl('horuxController.horuxController'), $this->isAccess('horuxController.horuxController')));
if ($this->isAccess('horuxController.horuxController')) {
$this->systemMenuCount++;
}
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-hardware.png\" />'", Prado::localize('Hardware', array(), "messages"), $this->Service->constructUrl('hardware.HardwareList'), $this->isAccess('hardware.HardwareList')));
if ($this->isAccess('hardware.HardwareList')) {
$this->systemMenuCount++;
}
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-openLevel.png\" />'", Prado::localize('Open time', array(), "messages"), $this->Service->constructUrl('openTime.openTimeList'), $this->isAccess('openTime.openTimeList')));
if ($this->isAccess('openTime.openTimeList')) {
$this->systemMenuCount++;
}
$system->addSplit();
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-notification.png\" />'", Prado::localize('Notification', array(), "messages"), $this->Service->constructUrl('system.Notification'), $this->isAccess('system.Notification')));
if ($this->isAccess('system.Notification')) {
$this->systemMenuCount++;
}
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-alarm.png\" />'", Prado::localize('Alarms', array(), "messages"), $this->Service->constructUrl('system.Alarms'), $this->isAccess('system.Alarms')));
if ($this->isAccess('system.Alarms')) {
$this->systemMenuCount++;
}
$system->addSplit();
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-service.png\" />'", Prado::localize('Horux Service', array(), "messages"), $this->Service->constructUrl('system.Service'), $this->isAccess('system.Service')));
if ($this->isAccess('system.Service')) {
$this->systemMenuCount++;
}
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-standalone.png\" />'", Prado::localize('Standalone', array(), "messages"), $this->Service->constructUrl('system.Standalone'), $this->isAccess('system.Standalone')));
if ($this->isAccess('system.Standalone')) {
$this->systemMenuCount++;
}
$system->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-systemStatus.png\" />'", Prado::localize('System Status', array(), "messages"), $this->Service->constructUrl('system.Status'), $this->isAccess('system.Status')));
if ($this->isAccess('system.Status')) {
$this->systemMenuCount++;
}
/******************************************
* access menu
*/
$access = new MenuItem('null', Prado::localize('Access', array(), "messages"), '#');
$access->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-user2.png\" />'", Prado::localize('User', array(), "messages"), $this->Service->constructUrl('user.UserList'), $this->isAccess('user.UserList')));
if ($this->isAccess('user.UserList')) {
$this->accessMenuCount++;
}
$access->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-userGroup.png\" />'", Prado::localize('User group', array(), "messages"), $this->Service->constructUrl('userGroup.UserGroupList'), $this->isAccess('userGroup.UserGroupList')));
if ($this->isAccess('userGroup.UserGroupList')) {
$this->accessMenuCount++;
}
$access->addSplit();
$access->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-key.png\" />'", Prado::localize('Key', array(), "messages"), $this->Service->constructUrl('key.KeyList'), $this->isAccess('key.KeyList')));
if ($this->isAccess('key.KeyList')) {
$this->accessMenuCount++;
}
$access->addSplit();
$access->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-accessLevel.png\" />'", Prado::localize('Access Level', array(), "messages"), $this->Service->constructUrl('accessLevel.accessLevelList'), $this->isAccess('accessLevel.accessLevelList')));
if ($this->isAccess('accessLevel.accessLevelList')) {
$this->accessMenuCount++;
}
$access->addMenuItem(new MenuItem("'<img src=\"./themes/letux/images/menu/icon-16-nonWorkingDay.png\" />'", Prado::localize('Non Working Days', array(), "messages"), $this->Service->constructUrl('nonWorkingDay.nonWorkingDay'), $this->isAccess('nonWorkingDay.nonWorkingDay')));
if ($this->isAccess('nonWorkingDay.nonWorkingDay')) {
$this->accessMenuCount++;
}
/******************************************
* Component menu
*/
$componnents = new MenuItem('null', Prado::localize('Components', array(), "messages"), '#');
$db = $this->Application->getModule('horuxDb')->DbConnection;
if (!$db) {
return $menu->render();
}
$db->Active = true;
$cmd = $db->createCommand("SELECT * FROM hr_install WHERE type='component'");
$data = $cmd->query();
$data = $data->readAll();
foreach ($data as $d) {
$cmd = $db->createCommand("SELECT * FROM hr_install AS i LEFT JOIN hr_component as c ON c.id_install=i.id WHERE i.type='component' AND c.parentmenu=0 AND i.id=" . $d['id']);
//.........这里部分代码省略.........