本文整理汇总了PHP中BASE_MenuItem类的典型用法代码示例。如果您正苦于以下问题:PHP BASE_MenuItem类的具体用法?PHP BASE_MenuItem怎么用?PHP BASE_MenuItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BASE_MenuItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Default action
*/
public function index()
{
$language = OW::getLanguage();
$item = new BASE_MenuItem();
$item->setLabel($language->text('video', 'admin_menu_general'));
$item->setUrl(OW::getRouter()->urlForRoute('video_admin_config'));
$item->setKey('general');
$item->setIconClass('ow_ic_gear_wheel');
$menu = new BASE_CMP_ContentMenu(array($item));
$this->addComponent('menu', $menu);
$configs = OW::getConfig()->getValues('video');
$configSaveForm = new ConfigSaveForm();
$this->addForm($configSaveForm);
if (OW::getRequest()->isPost() && $configSaveForm->isValid($_POST)) {
$configSaveForm->process();
OW::getFeedback()->info($language->text('video', 'settings_updated'));
$this->redirect(OW::getRouter()->urlForRoute('video_admin_config'));
}
if (!OW::getRequest()->isAjax()) {
$this->setPageHeading(OW::getLanguage()->text('video', 'admin_config'));
$this->setPageHeadingIconClass('ow_ic_video');
$menu->getElement('general')->setActive(true);
}
$configSaveForm->getElement('playerWidth')->setValue($configs['player_width']);
$configSaveForm->getElement('playerHeight')->setValue($configs['player_height']);
$configSaveForm->getElement('perPage')->setValue($configs['videos_per_page']);
$configSaveForm->getElement('quota')->setValue($configs['user_quota']);
}
示例2: initMenu
private function initMenu($params)
{
$language = OW::getLanguage();
$router = OW::getRouter();
$this->menu = new BASE_CMP_ContentMenu();
$item = new BASE_MenuItem();
$item->setLabel($language->text('base', 'upload'));
$item->setOrder(0);
$item->setKey('upload');
$item->setUrl($router->urlFor('BASE_CTRL_MediaPanel', 'index', $params));
$this->menu->addElement($item);
$item = new BASE_MenuItem();
$item->setLabel($language->text('base', 'tf_img_from_url'));
$item->setOrder(1);
$item->setKey('url');
$item->setUrl($router->urlFor('BASE_CTRL_MediaPanel', 'fromUrl', $params));
$this->menu->addElement($item);
$count = BOL_MediaPanelService::getInstance()->countGalleryImages($params['pluginKey'], OW::getUser()->getId());
$item = new BASE_MenuItem();
$item->setLabel($language->text('base', 'tf_img_gal') . ($count == 0 ? '' : " ({$count})"));
$item->setOrder(1);
$item->setKey('gallery');
$item->setUrl($router->urlFor('BASE_CTRL_MediaPanel', 'gallery', $params));
$this->menu->addElement($item);
}
示例3: index
/**
* Default action
*/
public function index()
{
$language = OW::getLanguage();
$item = new BASE_MenuItem();
$item->setLabel($language->text('vwls', 'admin_menu_general'));
$item->setUrl(OW::getRouter()->urlForRoute('vwls_admin_config'));
$item->setKey('general');
$item->setIconClass('ow_ic_gear_wheel');
$menu = new BASE_CMP_ContentMenu(array($item));
$this->addComponent('menu', $menu);
$configs = OW::getConfig()->getValues('vwls');
$configSaveForm = new ConfigSaveForm();
$this->addForm($configSaveForm);
if (OW::getRequest()->isPost() && $configSaveForm->isValid($_POST)) {
$res = $configSaveForm->process();
OW::getFeedback()->info($language->text('vwls', 'settings_updated'));
$this->redirect(OW::getRouter()->urlForRoute('vwls_admin_config'));
}
if (!OW::getRequest()->isAjax()) {
$this->setPageHeading(OW::getLanguage()->text('vwls', 'admin_config'));
$this->setPageHeadingIconClass('ow_ic_vwls');
$menu->getElement('general')->setActive(true);
}
$configSaveForm->getElement('server')->setValue($configs['server']);
$configSaveForm->getElement('serverAMF')->setValue($configs['serverAMF']);
$configSaveForm->getElement('serverRTMFP')->setValue($configs['serverRTMFP']);
$configSaveForm->getElement('enableRTMP')->setValue($configs['enableRTMP']);
$configSaveForm->getElement('enableP2P')->setValue($configs['enableP2P']);
$configSaveForm->getElement('supportRTMP')->setValue($configs['supportRTMP']);
$configSaveForm->getElement('supportP2P')->setValue($configs['supportP2P']);
$configSaveForm->getElement('alwaysRTMP')->setValue($configs['alwaysRTMP']);
$configSaveForm->getElement('alwaysP2P')->setValue($configs['alwaysP2P']);
$configSaveForm->getElement('videoCodec')->setValue($configs['videoCodec']);
$configSaveForm->getElement('codecProfile')->setValue($configs['codecProfile']);
$configSaveForm->getElement('codecLevel')->setValue($configs['codecLevel']);
$configSaveForm->getElement('soundCodec')->setValue($configs['soundCodec']);
$configSaveForm->getElement('p2pGroup')->setValue($configs['p2pGroup']);
$configSaveForm->getElement('tokenKey')->setValue($configs['tokenKey']);
$configSaveForm->getElement('snapshotsTime')->setValue($configs['snapshotsTime']);
$configSaveForm->getElement('camMaxBandwidth')->setValue($configs['camMaxBandwidth']);
$configSaveForm->getElement('bufferLive')->setValue($configs['bufferLive']);
$configSaveForm->getElement('bufferFull')->setValue($configs['bufferFull']);
$configSaveForm->getElement('bufferLive2')->setValue($configs['bufferLive2']);
$configSaveForm->getElement('bufferFull2')->setValue($configs['bufferFull2']);
$configSaveForm->getElement('disableBandwidthDetection')->setValue($configs['disableBandwidthDetection']);
$configSaveForm->getElement('limitByBandwidth')->setValue($configs['limitByBandwidth']);
$configSaveForm->getElement('generateSnapshots')->setValue($configs['generateSnapshots']);
$configSaveForm->getElement('externalInterval')->setValue($configs['externalInterval']);
$configSaveForm->getElement('externalInterval2')->setValue($configs['externalInterval2']);
$configSaveForm->getElement('ws_ads')->setValue($configs['ws_ads']);
$configSaveForm->getElement('adsTimeout')->setValue($configs['adsTimeout']);
$configSaveForm->getElement('adsInterval')->setValue($configs['adsInterval']);
$configSaveForm->getElement('statusInterval')->setValue($configs['statusInterval']);
$configSaveForm->getElement('availability')->setValue($configs['availability']);
$configSaveForm->getElement('status')->setValue($configs['status']);
$configSaveForm->getElement('member')->setValue($configs['member']);
$configSaveForm->getElement('member_list')->setValue($configs['member_list']);
$configSaveForm->getElement('baseSwf_url')->setValue($configs['baseSwf_url']);
}
示例4: __construct
public function __construct()
{
parent::__construct();
$item = new BASE_MenuItem();
$item->setLabel(OW::getLanguage()->text('bookmarks', 'general_menu_item_label'));
$item->setUrl(OW::getRouter()->urlForRoute('bookmarks.admin'));
$item->setIconClass('ow_ic_gear_wheel');
$this->addComponent('menu', new BASE_CMP_ContentMenu(array($item)));
}
示例5: index
/**
* Default action
*/
public function index()
{
$language = OW::getLanguage();
$item = new BASE_MenuItem();
$item->setLabel($language->text('vwvr', 'admin_menu_general'));
$item->setUrl(OW::getRouter()->urlForRoute('vwvr_admin_config'));
$item->setKey('general');
$item->setIconClass('ow_ic_gear_wheel');
$menu = new BASE_CMP_ContentMenu(array($item));
$this->addComponent('menu', $menu);
$configs = OW::getConfig()->getValues('vwvr');
$configSaveForm = new ConfigSaveForm();
$this->addForm($configSaveForm);
if (OW::getRequest()->isPost() && $configSaveForm->isValid($_POST)) {
$res = $configSaveForm->process();
OW::getFeedback()->info($language->text('vwvr', 'settings_updated'));
$this->redirect(OW::getRouter()->urlForRoute('vwvr_admin_config'));
}
if (!OW::getRequest()->isAjax()) {
$this->setPageHeading(OW::getLanguage()->text('vwvr', 'admin_config'));
$this->setPageHeadingIconClass('ow_ic_vwvr');
$menu->getElement('general')->setActive(true);
}
$configSaveForm->getElement('server')->setValue($configs['server']);
$configSaveForm->getElement('serverAMF')->setValue($configs['serverAMF']);
$configSaveForm->getElement('videoCodec')->setValue($configs['videoCodec']);
$configSaveForm->getElement('codecProfile')->setValue($configs['codecProfile']);
$configSaveForm->getElement('codecLevel')->setValue($configs['codecLevel']);
$configSaveForm->getElement('soundCodec')->setValue($configs['soundCodec']);
$configSaveForm->getElement('soundQuality')->setValue($configs['soundQuality']);
// $configSaveForm->getElement('microphone_rate')->setValue($configs['micRate']);
$configSaveForm->getElement('bufferLive')->setValue($configs['bufferLive']);
$configSaveForm->getElement('camMaxBandwidth')->setValue($configs['camMaxBandwidth']);
$configSaveForm->getElement('bufferLive')->setValue($configs['bufferLive']);
$configSaveForm->getElement('bufferFull')->setValue($configs['bufferFull']);
$configSaveForm->getElement('bufferLivePlayback')->setValue($configs['bufferLivePlayback']);
$configSaveForm->getElement('bufferFullPlayback')->setValue($configs['bufferFullPlayback']);
$configSaveForm->getElement('availability')->setValue($configs['availability']);
$configSaveForm->getElement('status')->setValue($configs['status']);
$configSaveForm->getElement('member')->setValue($configs['member']);
$configSaveForm->getElement('member_list')->setValue($configs['member_list']);
$configSaveForm->getElement('baseSwf_url')->setValue($configs['baseSwf_url']);
$configSaveForm->getElement('record_path')->setValue($configs['recordPath']);
$configSaveForm->getElement('record_limit')->setValue($configs['recordLimit']);
$configSaveForm->getElement('resolution')->setValue($configs['camWidth'] . "x" . $configs['camHeight']);
$configSaveForm->getElement('camera_fps')->setValue($configs['camFPS']);
$configSaveForm->getElement('microphone_rate')->setValue($configs['micRate']);
$configSaveForm->getElement('bandwidth')->setValue($configs['camBandwidth']);
$configSaveForm->getElement('layout_code')->setValue($configs['layoutCode']);
$configSaveForm->getElement('show_camera_settings')->setValue($configs['showCamSettings']);
$configSaveForm->getElement('advanced_camera_settings')->setValue($configs['advancedCamSettings']);
$configSaveForm->getElement('fill_window')->setValue($configs['fillWindow']);
}
示例6: init
public function init()
{
$router = OW_Router::getInstance();
$pageActions = array('choose_theme', 'add_theme');
$menuItems = array();
foreach ($pageActions as $key => $item) {
$menuItem = new BASE_MenuItem();
$menuItem->setKey($item)->setLabel(OW::getLanguage()->text('admin', 'themes_menu_item_' . $item))->setOrder($key)->setUrl($router->urlFor(__CLASS__, $item));
$menuItems[] = $menuItem;
}
$this->menu = new BASE_CMP_ContentMenu($menuItems);
$this->addComponent('contentMenu', $this->menu);
$this->setPageHeading(OW::getLanguage()->text('admin', 'themes_choose_page_title'));
}
示例7: init
public function init()
{
$language = OW::getLanguage();
$pageActions = array("choose_theme", "add_theme");
$menuItems = array();
foreach ($pageActions as $key => $item) {
$menuItem = new BASE_MenuItem();
$menuItem->setKey($item)->setLabel($language->text("admin", "themes_menu_item_" . $item))->setOrder($key)->setUrl(OW::getRouter()->urlFor(__CLASS__, $item));
$menuItems[] = $menuItem;
}
$this->menu = new BASE_CMP_ContentMenu($menuItems);
$this->addComponent("contentMenu", $this->menu);
$this->setPageHeading($language->text("admin", "themes_choose_page_title"));
}
示例8: getMenu
public function getMenu()
{
$language = OW::getLanguage();
$menu = new BASE_CMP_ContentMenu();
$menuItem = new BASE_MenuItem();
$menuItem->setKey('all');
$menuItem->setPrefix('questions');
$menuItem->setLabel($language->text('questions', 'list_all_tab'));
$menuItem->setOrder(1);
$menuItem->setUrl(OW::getRouter()->urlForRoute('questions-all'));
$menuItem->setIconClass('ow_ic_lens');
$menu->addElement($menuItem);
if (OW::getUser()->isAuthenticated()) {
if (OW::getPluginManager()->isPluginActive('friends')) {
$menuItem = new BASE_MenuItem();
$menuItem->setKey('friends');
$menuItem->setPrefix('questions');
$menuItem->setLabel($language->text('questions', 'list_friends_tab'));
$menuItem->setOrder(2);
$menuItem->setUrl(OW::getRouter()->urlForRoute('questions-friends'));
$menuItem->setIconClass('ow_ic_user');
$menu->addElement($menuItem);
}
$menuItem = new BASE_MenuItem();
$menuItem->setKey('my');
$menuItem->setPrefix('questions');
$menuItem->setLabel($language->text('questions', 'list_my_tab'));
$menuItem->setOrder(3);
$menuItem->setUrl(OW::getRouter()->urlForRoute('questions-my'));
$menuItem->setIconClass('ow_ic_user');
$menu->addElement($menuItem);
}
return $menu;
}
示例9: init
public function init()
{
$router = OW_Router::getInstance();
$pageActions = array(array('name' => 'settings', 'iconClass' => 'ow_ic_gear_wheel'), array('name' => 'css', 'iconClass' => 'ow_ic_files'), array('name' => 'graphics', 'iconClass' => 'ow_ic_picture'));
$menuItems = array();
foreach ($pageActions as $key => $item) {
$menuItem = new BASE_MenuItem();
$menuItem->setKey($item['name'])->setLabel(OW::getLanguage()->text('admin', 'sidebar_menu_item_' . $item['name']))->setOrder($key)->setUrl($router->urlForRoute('admin_theme_' . $item['name']));
$menuItem->setIconClass($item['iconClass']);
$menuItems[] = $menuItem;
}
$this->menu = new BASE_CMP_ContentMenu($menuItems);
$this->addComponent('contentMenu', $this->menu);
OW::getNavigation()->activateMenuItem(OW_Navigation::ADMIN_APPEARANCE, 'admin', 'sidebar_menu_item_theme_edit');
$this->setPageHeading(OW::getLanguage()->text('admin', 'themes_settings_page_title'));
}
示例10: addContentMenu
private function addContentMenu()
{
$language = OW::getLanguage();
$router = OW_Router::getInstance();
$menuItems = array();
$menuItem = new BASE_MenuItem();
$menuItem->setKey('general_settings')->setLabel($language->text('usearch', 'general_settings'))->setUrl($router->urlForRoute('usearch.admin_general_setting'))->setOrder('1');
$menuItem->setIconClass('ow_ic_gear_wheel');
$menuItems[] = $menuItem;
$menuItem = new BASE_MenuItem();
$menuItem->setKey('quick_search_settings')->setLabel($language->text('usearch', 'quick_search_settings'))->setUrl($router->urlForRoute('usearch.admin_quick_search_setting'))->setOrder('4');
$menuItem->setIconClass('ow_ic_lens');
$menuItems[] = $menuItem;
$this->contentMenu = new BASE_CMP_ContentMenu($menuItems);
$this->addComponent('contentMenu', $this->contentMenu);
}
示例11: getMenu
public function getMenu()
{
$items = array();
$item = new BASE_MenuItem();
$item->setLabel(OW::getLanguage()->text('admin', 'edit_language'));
$item->setIconClass('ow_ic_edit');
$item->setKey('edit_lang');
if ($this->isDevMode()) {
$item->setUrl(OW::getRouter()->urlForRoute('admin_developer_tools_language'));
} else {
$item->setUrl(OW::getRouter()->urlForRoute('admin_languages_index'));
}
$item->setOrder(1);
$items[] = $item;
$item = new BASE_MenuItem();
$item->setLabel(OW::getLanguage()->text('admin', 'available_languages'));
$item->setIconClass('ow_ic_files');
$item->setKey('avail_lang');
if ($this->isDevMode()) {
$item->setUrl(OW::getRouter()->urlForRoute('admin_developer_tools_language_mod'));
} else {
$item->setUrl(OW::getRouter()->urlFor('ADMIN_CTRL_Languages', 'mod'));
}
$item->setOrder(2);
$items[] = $item;
return new BASE_CMP_ContentMenu($items);
}
示例12: index
public function index()
{
$language = OW::getLanguage();
$this->setPageHeading($language->text('ynsocialpublisher', 'admin_config'));
$this->setPageHeadingIconClass('ow_ic_picture');
$item = new BASE_MenuItem();
$item->setLabel($language->text('ynsocialpublisher', 'admin_menu_general'));
$item->setUrl(OW::getRouter()->urlForRoute('ynsocialpublisher.admin'));
$item->setKey('general');
$item->setIconClass('ow_ic_gear_wheel');
$item->setOrder(0);
$item->setActive(true);
$menu = new BASE_CMP_ContentMenu(array($item));
$this->addComponent('menu', $menu);
$service = YNSOCIALPUBLISHER_BOL_Service::getInstance();
$plugins = $service->getEnabledPlugins();
$this->assign('plugins', $plugins);
$form_url = OW::getRouter()->urlForRoute('ynsocialpublisher.admin');
$this->assign('form_url', $form_url);
if (OW::getRequest()->isPost()) {
// get plugins data from post
$params = $_POST['params'];
foreach ($params as $key => $settings) {
if (!isset($settings['providers'])) {
$settings['providers'] = array();
}
OW::getConfig()->saveConfig('ynsocialpublisher', $key, json_encode($settings));
}
OW::getFeedback()->info($language->text('ynsocialpublisher', 'settings_updated'));
$this->redirect($form_url);
}
}
示例13: getMenu
private function getMenu()
{
$lang = OW::getLanguage();
$router = OW::getRouter();
$items = array();
$item = new BASE_MenuItem();
$item->setLabel($lang->text('usearch', 'user_list'));
$item->setOrder(0);
$item->setKey('photo_gallery');
$item->setIconClass('ow_ic_picture');
$item->setUrl($router->urlForRoute('users-search-result'));
array_push($items, $item);
// $item = new BASE_MenuItem();
// $item->setLabel($lang->text('usearch', 'profile_details'));
// $item->setOrder(1);
// $item->setKey('profile_details');
// $item->setIconClass('ow_ic_comment');
// $item->setUrl($router->urlForRoute('usearch.details'));
// array_push($items, $item);
if (OW::getPluginManager()->isPluginActive('googlelocation')) {
$item = new BASE_MenuItem();
$item->setLabel($lang->text('usearch', 'map'));
$item->setOrder(2);
$item->setKey('map');
$item->setIconClass('ow_ic_places');
$item->setUrl($router->urlForRoute('usearch.map'));
array_push($items, $item);
}
return new BASE_CMP_ContentMenu($items);
}
示例14: __construct
public function __construct()
{
parent::__construct();
if (OW::getRequest()->isAjax()) {
return;
}
$language = OW::getLanguage();
$menu = new BASE_CMP_ContentMenu();
$menuItem = new BASE_MenuItem();
$menuItem->setKey('admin-index');
$menuItem->setLabel($language->text('sponsors', 'admin_tab_general_title'));
$menuItem->setUrl(OW::getRouter()->urlForRoute('sponsors_admin'));
$menuItem->setIconClass('ow_ic_gear_wheel');
$menuItem->setOrder(1);
$menu->addElement($menuItem);
$menuItem = new BASE_MenuItem();
$menuItem->setKey('admin-list');
$menuItem->setLabel($language->text('sponsors', 'admin_sponsors_list'));
$menuItem->setUrl(OW::getRouter()->urlForRoute('sponsors_admin_list'));
$menuItem->setIconClass('ow_ic_gear_wheel');
$menuItem->setOrder(2);
$menu->addElement($menuItem);
$menuItem = new BASE_MenuItem();
$menuItem->setKey('admin-add');
$menuItem->setLabel($language->text('sponsors', 'admin_add_sponsor'));
$menuItem->setUrl(OW::getRouter()->urlForRoute('sponsors_admin_add'));
$menuItem->setIconClass('ow_ic_gear_wheel');
$menuItem->setOrder(3);
$menu->addElement($menuItem);
$this->addComponent('menu', $menu);
$this->menu = $menu;
}
示例15: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
$language = OW::getLanguage();
$menu = new BASE_CMP_ContentMenu();
$menuItem = new BASE_MenuItem();
$menuItem->setKey('index');
$menuItem->setLabel($language->text('ads', 'advertisement_menu_banner_list'));
$menuItem->setUrl(OW::getRouter()->urlForRoute('ads.admin_index'));
$menuItem->setIconClass('ow_ic_files');
$menuItem->setOrder(1);
$menu->addElement($menuItem);
$menuItem = new BASE_MenuItem();
$menuItem->setKey('manage');
$menuItem->setLabel($language->text('ads', 'advertisement_menu_manage_banners'));
$menuItem->setUrl(OW::getRouter()->urlForRoute('ads.admin_manage'));
$menuItem->setIconClass('ow_ic_gear_wheel');
$menuItem->setOrder(2);
$menu->addElement($menuItem);
$this->addComponent('menu', $menu);
$this->menu = $menu;
$this->adsService = ADS_BOL_Service::getInstance();
$this->setPageTitle($language->text('ads', 'page_title_ads'));
$this->setPageHeading($language->text('ads', 'page_heading_ads'));
$this->setPageHeadingIconClass('ow_ic_star');
OW::getNavigation()->activateMenuItem('admin_plugins', 'admin', 'sidebar_menu_plugins_installed');
}