本文整理汇总了PHP中OW::getNavigation方法的典型用法代码示例。如果您正苦于以下问题:PHP OW::getNavigation方法的具体用法?PHP OW::getNavigation怎么用?PHP OW::getNavigation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OW
的用法示例。
在下文中一共展示了OW::getNavigation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rated
public function rated()
{
if (!OW::getUser()->isAuthenticated()) {
throw new AuthenticateException();
}
$lang = OW::getLanguage();
$page = !empty($_GET['page']) && intval($_GET['page']) > 0 ? $_GET['page'] : 1;
$perPage = (int) OW::getConfig()->getValue('base', 'users_count_on_page');
$service = OCSTOPUSERS_BOL_Service::getInstance();
$userId = OW::getUser()->getId();
$users = $service->findRateUserList($userId, $page, $perPage);
if ($users) {
$count = $service->countRateUsers($userId);
$list = array();
$fields = array();
foreach ($users as $user) {
$list[] = $user['dto'];
$fields[$user['dto']->id] = array('score' => $user['score'], 'timeStamp' => $user['timeStamp']);
}
$cmp = new OCSTOPUSERS_CMP_RatedList($list, $count, $perPage, false, $fields);
$this->addComponent('users', $cmp);
} else {
$this->assign($users, null);
}
OW::getDocument()->setHeading($lang->text('ocstopusers', 'rated_me'));
OW::getDocument()->setHeadingIconClass('ow_ic_star');
OW::getNavigation()->activateMenuItem(BOL_NavigationService::MENU_TYPE_MAIN, 'base', 'users_main_menu_item');
$this->setTemplate(OW::getPluginManager()->getPlugin('ocstopusers')->getCtrlViewDir() . 'list_index.html');
}
示例2: index
public function index(array $params)
{
if (!($userId = OW::getUser()->getId())) {
throw new AuthenticateException();
}
$page = !empty($_GET['page']) && intval($_GET['page']) > 0 ? $_GET['page'] : 1;
$lang = OW::getLanguage();
$perPage = (int) OW::getConfig()->getValue('base', OW::getPluginManager()->isPluginActive('skadate') ? 'users_on_page' : 'users_count_on_page');
$guests = OCSGUESTS_BOL_Service::getInstance()->findGuestsForUser($userId, $page, $perPage);
$guestList = array();
if ($guests) {
foreach ($guests as $guest) {
$guestList[$guest->guestId] = array('last_visit' => $lang->text('ocsguests', 'visited') . ' ' . '<span class="ow_remark">' . $guest->visitTimestamp . '</span>');
}
$itemCount = OCSGUESTS_BOL_Service::getInstance()->countGuestsForUser($userId);
if (OW::getPluginManager()->isPluginActive('skadate')) {
$cmp = OW::getClassInstance('BASE_CMP_Users', $guestList, array(), $itemCount);
} else {
$guestsUsers = OCSGUESTS_BOL_Service::getInstance()->findGuestUsers($userId, $page, $perPage);
$cmp = new OCSGUESTS_CMP_Users($guestsUsers, $itemCount, $perPage, true, $guestList);
}
$this->addComponent('guests', $cmp);
} else {
$this->assign('guests', null);
}
$this->setPageHeading($lang->text('ocsguests', 'viewed_profile'));
$this->setPageTitle($lang->text('ocsguests', 'viewed_profile'));
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'base', 'dashboard');
}
示例3: index
/**
* Default action
*/
public function index()
{
$language = OW::getLanguage();
$clipService = VIDEO_BOL_ClipService::getInstance();
$userId = OW::getUser()->getId();
if (!OW::getUser()->isAuthorized('video', 'add')) {
$status = BOL_AuthorizationService::getInstance()->getActionStatus('video', 'add');
throw new AuthorizationException($status['msg']);
}
if (!($clipService->findUserClipsCount($userId) <= $clipService->getUserQuotaConfig())) {
$this->assign('auth_msg', $language->text('video', 'quota_exceeded', array('limit' => $clipService->getUserQuotaConfig())));
} else {
$this->assign('auth_msg', null);
$videoAddForm = new videoAddForm();
$this->addForm($videoAddForm);
if (OW::getRequest()->isPost() && $videoAddForm->isValid($_POST)) {
$values = $videoAddForm->getValues();
$code = $clipService->validateClipCode($values['code']);
if (!mb_strlen($code)) {
OW::getFeedback()->warning($language->text('video', 'resource_not_allowed'));
$this->redirect();
}
$res = $videoAddForm->process();
OW::getFeedback()->info($language->text('video', 'clip_added'));
$this->redirect(OW::getRouter()->urlForRoute('view_clip', array('id' => $res['id'])));
}
}
if (!OW::getRequest()->isAjax()) {
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'video', 'video');
}
OW::getDocument()->setHeading($language->text('video', 'page_title_add_video'));
OW::getDocument()->setHeadingIconClass('ow_ic_video');
OW::getDocument()->setTitle($language->text('video', 'meta_title_video_add'));
OW::getDocument()->setDescription($language->text('video', 'meta_description_video_add'));
}
示例4: __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');
}
示例5: __construct
/**
* Class constructor
*/
public function __construct()
{
parent::__construct();
$this->forumService = FORUM_BOL_ForumService::getInstance();
if (!OW::getRequest()->isAjax()) {
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'forum', 'forum');
}
}
示例6: __construct
public function __construct()
{
parent::__construct();
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'base', 'users_main_menu_item');
$this->setPageHeading(OW::getLanguage()->text('base', 'user_search_page_heading'));
$this->setPageTitle(OW::getLanguage()->text('base', 'user_search_page_heading'));
$this->setPageHeadingIconClass('ow_ic_user');
}
示例7: __construct
public function __construct()
{
parent::__construct();
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'base', 'users_main_menu_item');
$this->setPageHeading(OW::getLanguage()->text('base', 'users_browse_page_heading'));
$this->setPageTitle(OW::getLanguage()->text('base', 'users_browse_page_heading'));
$this->setPageHeadingIconClass('ow_ic_user');
$this->usersPerPage = (int) OW::getConfig()->getValue('base', 'users_count_on_page');
}
示例8: index
public function index($params = array())
{
if (OW::getRequest()->isAjax()) {
exit;
}
if (!OW::getUser()->isAuthenticated()) {
throw new AuthenticateException();
}
$plugin = OW::getPluginManager()->getPlugin('blogs');
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'blogs', 'main_menu_item');
$this->setPageHeading(OW::getLanguage()->text('blogs', 'save_page_heading'));
$this->setPageHeadingIconClass('ow_ic_write');
if (!OW::getUser()->isAuthorized('blogs', 'add')) {
$this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html');
return;
}
$eventParams = array('pluginKey' => 'blogs', 'action' => 'add_blog');
$credits = OW::getEventManager()->call('usercredits.check_balance', $eventParams);
if ($credits === false) {
$this->assign('authMsg', OW::getEventManager()->call('usercredits.error_message', $eventParams));
return;
}
$this->assign('authMsg', null);
$id = empty($params['id']) ? 0 : $params['id'];
$service = PostService::getInstance();
/* @var $service PostService */
$tagService = BOL_TagService::getInstance();
if (intval($id) > 0) {
$post = $service->findById($id);
if ($post->authorId != OW::getUser()->getId() && !OW::getUser()->isAuthorized('blogs')) {
throw new Redirect404Exception();
}
$eventParams = array('action' => PostService::PRIVACY_ACTION_VIEW_BLOG_POSTS, 'ownerId' => $post->authorId);
$privacy = OW::getEventManager()->getInstance()->call('plugin.privacy.get_privacy', $eventParams);
if (!empty($privacy)) {
$post->setPrivacy($privacy);
}
} else {
$post = new Post();
$eventParams = array('action' => PostService::PRIVACY_ACTION_VIEW_BLOG_POSTS, 'ownerId' => OW::getUser()->getId());
$privacy = OW::getEventManager()->getInstance()->call('plugin.privacy.get_privacy', $eventParams);
if (!empty($privacy)) {
$post->setPrivacy($privacy);
}
$post->setAuthorId(OW::getUser()->getId());
}
$form = new SaveForm($post);
if (OW::getRequest()->isPost() && (!empty($_POST['command']) && in_array($_POST['command'], array('draft', 'publish'))) && $form->isValid($_POST)) {
$form->process($this);
OW::getApplication()->redirect(OW::getRouter()->urlForRoute('post-save-edit', array('id' => $post->getId())));
}
$this->addForm($form);
$this->assign('info', array('dto' => $post));
OW::getDocument()->setTitle(OW::getLanguage()->text('blogs', 'meta_title_new_blog_post'));
OW::getDocument()->setDescription(OW::getLanguage()->text('blogs', 'meta_description_new_blog_post'));
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->questionService = BOL_QuestionService::getInstance();
$this->ajaxResponderUrl = OW::getRouter()->urlFor("ADMIN_CTRL_Questions", "ajaxResponder");
$language = OW::getLanguage();
$this->setPageHeading($language->text('admin', 'heading_questions'));
$this->setPageHeadingIconClass('ow_ic_files');
OW::getNavigation()->activateMenuItem('admin_users', 'admin', 'sidebar_menu_item_questions');
}
示例10: __construct
public function __construct()
{
parent::__construct();
$this->setPageTitle($this->text('toplink', 'index_page_title'));
$this->setPageHeading($this->text('toplink', 'index_page_title'));
$this->setPageHeadingIconClass('ow_ic_star');
$this->iconDir = BOL_AvatarService::getInstance()->getAvatarsDir();
OW::getNavigation()->activateMenuItem('admin_plugins', 'admin', 'sidebar_menu_plugins_installed');
$this->myService = TOPLINK_BOL_Service::getInstance();
}
示例11: __construct
public function __construct()
{
$this->photoPlugin = OW::getPluginManager()->getPlugin('photo');
$this->photoPluginJsUrl = $this->photoPlugin->getStaticJsUrl();
$this->photoAlbumService = PHOTO_BOL_PhotoAlbumService::getInstance();
$this->photoService = PHOTO_BOL_PhotoService::getInstance();
$this->menu = $this->getMenu();
if (!OW::getRequest()->isAjax()) {
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'photo', 'photo');
}
}
示例12: index
public function index($params)
{
if (!OW::getUser()->isAuthenticated()) {
throw new AuthenticateException();
}
$eventParams = array('pluginKey' => 'links', 'action' => 'add_link');
$credits = OW::getEventManager()->call('usercredits.check_balance', $eventParams);
if (!OW::getUser()->isAuthorized('links', 'add')) {
$this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html');
return;
} else {
if ($credits === false) {
$this->assign('authMsg', OW::getEventManager()->call('usercredits.error_message', $eventParams));
} else {
$this->assign('authMsg', null);
}
}
$plugin = OW::getPluginManager()->getPlugin('links');
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, $plugin->getKey(), 'main_menu_item');
$id = empty($params['id']) ? null : $params['id'];
$service = LinkService::getInstance();
if ($id !== null && intval($id) > 0) {
$this->setPageHeading(OW::getLanguage()->text('links', 'edit_page_heading'));
OW::getDocument()->setTitle(OW::getLanguage()->text('links', 'edit_page_heading'));
$link = $service->findById($id);
$eventParams = array('action' => LinkService::PRIVACY_ACTION_VIEW_LINKS, 'ownerId' => $link->userId);
$privacy = OW::getEventManager()->getInstance()->call('plugin.privacy.get_privacy', $eventParams);
if (!empty($privacy)) {
$link->setPrivacy($privacy);
}
} else {
$this->setPageHeading(OW::getLanguage()->text('links', 'save_page_heading'));
OW::getDocument()->setTitle(OW::getLanguage()->text('links', 'save_page_heading'));
/*
@var $link Link
*/
$link = new Link();
$eventParams = array('action' => LinkService::PRIVACY_ACTION_VIEW_LINKS, 'ownerId' => OW::getUser()->getId());
$privacy = OW::getEventManager()->getInstance()->call('plugin.privacy.get_privacy', $eventParams);
if (!empty($privacy)) {
$link->setPrivacy($privacy);
}
$link->setUserId(OW::getUser()->getId());
}
$this->setPageHeadingIconClass('ow_ic_link');
$form = new LinkSaveForm($link);
$this->addForm($form);
if (OW::getRequest()->isPost() && $form->isValid($_POST)) {
$form->process();
$this->redirect(OW::getRouter()->urlForRoute('link', array('id' => $link->getId())));
}
OW::getDocument()->setDescription(OW::getLanguage()->text('links', 'meta_description_new_link'));
}
示例13: __construct
/**
* Class constructor
*/
public function __construct()
{
parent::__construct();
$this->plugin = OW::getPluginManager()->getPlugin('vwls');
$this->pluginJsUrl = $this->plugin->getStaticJsUrl();
$this->ajaxResponder = OW::getRouter()->urlFor('VWLS_CTRL_Vwls', 'ajaxResponder');
$this->clipService = VWLS_BOL_ClipService::getInstance();
$this->menu = $this->getMenu();
if (!OW::getRequest()->isAjax()) {
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'vwls', 'vwls');
}
}
示例14: __construct
public function __construct()
{
$this->setPageHeading(OW::getLanguage()->text('yncontactimporter', 'page_heading'));
$this->setPageHeadingIconClass('');
$this->menu = $this->_initMenu();
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'yncontactimporter', 'contact_importer');
//load css
$cssUrl = OW::getPluginManager()->getPlugin('yncontactimporter')->getStaticCssUrl() . 'yncontactimporter.css';
OW::getDocument()->addStyleSheet($cssUrl);
//put languages to database when development
//OW::getLanguage() -> importPluginLangs(OW::getPluginManager() -> getPlugin('yncontactimporter') -> getRootDir() . 'langs.zip', 'yncontactimporter');
}
示例15: __construct
/**
* Class constructor
*/
public function __construct()
{
parent::__construct();
$this->plugin = OW::getPluginManager()->getPlugin('photo');
$this->pluginJsUrl = $this->plugin->getStaticJsUrl();
$this->ajaxResponder = OW::getRouter()->urlFor('PHOTO_CTRL_Photo', 'ajaxResponder');
$this->photoService = PHOTO_BOL_PhotoService::getInstance();
$this->photoAlbumService = PHOTO_BOL_PhotoAlbumService::getInstance();
$this->menu = $this->getMenu();
if (!OW::getRequest()->isAjax()) {
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'photo', 'photo');
}
}