/** * Returns an instance of class (singleton pattern implementation). * * @return OW_Language */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
public static function getSettingList() { $settingList = array(); $settingList['coverHeight'] = array('presentation' => self::PRESENTATION_NUMBER, 'label' => OW_Language::getInstance()->text('gheader', 'widget_setting_cover_height'), 'value' => 250); if (GHEADER_CLASS_PhotoBridge::getInstance()->isActive()) { $settingList['saveToPhoto'] = array('presentation' => self::PRESENTATION_CHECKBOX, 'label' => OW_Language::getInstance()->text('gheader', 'widget_setting_save_to_photo'), 'value' => true); $settingList['albumName'] = array('presentation' => self::PRESENTATION_TEXT, 'label' => OW_Language::getInstance()->text('gheader', 'widget_setting_photo_album'), 'value' => GHEADER_CLASS_PhotoBridge::getInstance()->getAlbumName()); } return $settingList; }
public function __construct($name, BOL_MenuItem $menu) { parent::__construct($name); $navigationService = BOL_NavigationService::getInstance(); $document = $navigationService->findDocumentByKey($menu->getDocumentKey()); $language = OW_Language::getInstance(); $adminPlugin = OW::getPluginManager()->getPlugin('admin'); $nameTextField = new TextField('name'); $this->addElement($nameTextField->setValue($language->text($menu->getPrefix(), $menu->getKey()))->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_menu_name'))->setRequired()); $visibleForCheckboxGroup = new CheckboxGroup('visible-for'); $visibleFor = $menu->getVisibleFor(); $options = array('1' => OW::getLanguage()->text('admin', 'pages_edit_visible_for_guests'), '2' => OW::getLanguage()->text('admin', 'pages_edit_visible_for_members')); $values = array(); foreach ($options as $value => $option) { if (!($value & $visibleFor)) { continue; } $values[] = $value; } $this->addElement($visibleForCheckboxGroup->setOptions($options)->setValue($values)->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_visible_for'))); $submit = new Submit('save'); $this->addElement($submit->setValue(OW::getLanguage()->text('admin', 'save_btn_label'))); }
$BOL_SearchService = BOL_SearchService::getInstance(); $getPluginManager = OW::getPluginManager(); $CONTACTUS_BOL_Service = CONTACTUS_BOL_Service::getInstance(); $PHOTO_BOL_PhotoService = PHOTO_BOL_PhotoService::getInstance(); $PHOTO_BOL_PhotoAlbumCoverDao = PHOTO_BOL_PhotoAlbumCoverDao::getInstance(); $PHOTO_BOL_PhotoDao = PHOTO_BOL_PhotoDao::getInstance(); $getRouter = OW::getRouter(); $language = OW::getLanguage(); $getMailer = OW::getMailer(); $getConfig = OW::getConfig(); $getFeedback = OW::getFeedback(); $getEventManager = OW::getEventManager(); $getMailer = OW::getMailer(); $ow = OW_DB_PREFIX; $LanguageService = BOL_LanguageService::getInstance(); $OW_Language = OW_Language::getInstance(); $QUESTION_PRESENTATION_DATE = BOL_QuestionService::QUESTION_PRESENTATION_DATE; $QUESTION_PRESENTATION_RANGE = BOL_QuestionService::QUESTION_PRESENTATION_RANGE; $QUESTION_PRESENTATION_BIRTHDATE = BOL_QuestionService::QUESTION_PRESENTATION_BIRTHDATE; $QUESTION_PRESENTATION_AGE = BOL_QuestionService::QUESTION_PRESENTATION_AGE; $QUESTION_PRESENTATION_DATE = BOL_QuestionService::QUESTION_PRESENTATION_DATE; $QUESTION_VALUE_TYPE_DATETIME = BOL_QuestionService::QUESTION_VALUE_TYPE_DATETIME; $QUESTION_VALUE_TYPE_SELECT = BOL_QuestionService::QUESTION_VALUE_TYPE_SELECT; $QUESTION_PRESENTATION_SELECT = BOL_QuestionService::QUESTION_PRESENTATION_SELECT; $QUESTION_PRESENTATION_RADIO = BOL_QuestionService::QUESTION_PRESENTATION_RADIO; $QUESTION_PRESENTATION_MULTICHECKBOX = BOL_QuestionService::QUESTION_PRESENTATION_MULTICHECKBOX; $QUESTION_PRESENTATION_URL = BOL_QuestionService::QUESTION_PRESENTATION_URL; $QUESTION_PRESENTATION_TEXT = BOL_QuestionService::QUESTION_PRESENTATION_TEXT; $QUESTION_PRESENTATION_TEXTAREA = BOL_QuestionService::QUESTION_PRESENTATION_TEXTAREA; $MYSQL_DATETIME_DATE_FORMAT = UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT; $USER_LIST_SIZE = BOL_SearchService::USER_LIST_SIZE;
public function edit(array $params) { if (!isset($params['id']) || !($id = (int) $params['id'])) { throw new Redirect404Exception(); return; } $clip = $this->clipService->findClipById($id); if (!$clip) { throw new Redirect404Exception(); } $language = OW_Language::getInstance(); // is moderator $modPermissions = OW::getUser()->isAuthorized('vwls'); $this->assign('moderatorMode', $modPermissions); $contentOwner = (int) $this->clipService->findClipOwner($id); $userId = OW::getUser()->getId(); $ownerMode = $contentOwner == $userId; $this->assign('ownerMode', $ownerMode); if (!$ownerMode && !$modPermissions) { $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html'); return; } $videoEditForm = new vwlsEditForm($clip->id); $this->addForm($videoEditForm); $videoEditForm->getElement('id')->setValue($clip->id); $videoEditForm->getElement('room_name')->setValue($clip->title); $videoEditForm->getElement('description')->setValue($clip->description); $videoEditForm->getElement('room_limit')->setValue($clip->roomLimit); $videoEditForm->getElement('user_list')->setValue($clip->user_list); $videoEditForm->getElement('moderator_list')->setValue($clip->moderator_list); $videoEditForm->getElement('welcome')->setValue($clip->welcome); $resolution = $clip->camWidth . "x" . $clip->camHeight; $videoEditForm->getElement('resolution')->setValue($resolution); $videoEditForm->getElement('camera_fps')->setValue($clip->camFPS); $videoEditForm->getElement('microphone_rate')->setValue($clip->micRate); $videoEditForm->getElement('soundQuality')->setValue($clip->soundQuality); $videoEditForm->getElement('bandwidth')->setValue($clip->camBandwidth); $videoEditForm->getElement('flood_protection')->setValue($clip->floodProtection); $videoEditForm->getElement('label_color')->setValue($clip->labelColor); $videoEditForm->getElement('welcome2')->setValue($clip->welcome2); $videoEditForm->getElement('offline_message')->setValue($clip->offlineMessage); $videoEditForm->getElement('flood_protection2')->setValue($clip->floodProtection2); $videoEditForm->getElement('filter_regex')->setValue($clip->filterRegex); $videoEditForm->getElement('filter_replace')->setValue($clip->filterReplace); $videoEditForm->getElement('layout_code')->setValue($clip->layoutCode); $permissions = $clip->permission; $permission = explode("|", $permissions); $videoEditForm->getElement('show_camera_settings')->setValue($permission[0]); $videoEditForm->getElement('advanced_camera_settings')->setValue($permission[1]); $videoEditForm->getElement('configure_source')->setValue($permission[2]); $videoEditForm->getElement('only_video')->setValue($permission[3]); $videoEditForm->getElement('no_video')->setValue($permission[4]); $videoEditForm->getElement('no_embeds')->setValue($permission[5]); $videoEditForm->getElement('show_timer')->setValue($permission[6]); $videoEditForm->getElement('write_text')->setValue($permission[7]); $videoEditForm->getElement('private_textchat')->setValue($permission[8]); $videoEditForm->getElement('fill_window')->setValue($permission[9]); $videoEditForm->getElement('write_text2')->setValue($permission[10]); $videoEditForm->getElement('enable_video')->setValue($permission[11]); $videoEditForm->getElement('enable_chat')->setValue($permission[12]); $videoEditForm->getElement('enable_users')->setValue($permission[13]); $videoEditForm->getElement('fill_window2')->setValue($permission[14]); $videoEditForm->getElement('verbose_level')->setValue($permission[15]); if (OW::getRequest()->isPost() && $videoEditForm->isValid($_POST)) { $res = $videoEditForm->process(); OW::getFeedback()->info($language->text('vwls', 'clip_updated')); $this->redirect(OW::getRouter()->urlForRoute('vwview_clip_ls', array('id' => $res['id']))); } OW::getDocument()->setHeading($language->text('vwls', 'tb_vwedit_clip_ls')); OW::getDocument()->setHeadingIconClass('ow_ic_vwls'); OW::getDocument()->setTitle($language->text('vwls', 'tb_vwedit_clip_ls')); }
/** * Returns language object. * * @return OW_Language */ public static function getLanguage() { return OW_Language::getInstance(); }
public function edit(array $params) { if (!isset($params['id']) || !($id = (int) $params['id'])) { throw new Redirect404Exception(); } $clip = $this->clipService->findClipById($id); if (!$clip) { throw new Redirect404Exception(); } $language = OW_Language::getInstance(); // is moderator $modPermissions = OW::getUser()->isAuthorized('video'); $this->assign('moderatorMode', $modPermissions); $contentOwner = (int) $this->clipService->findClipOwner($id); $userId = OW::getUser()->getId(); $ownerMode = $contentOwner == $userId; $this->assign('ownerMode', $ownerMode); if (!$ownerMode && !$modPermissions) { $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html'); return; } $videoEditForm = new videoEditForm($clip->id); $this->addForm($videoEditForm); $videoEditForm->getElement('id')->setValue($clip->id); $videoEditForm->getElement('title')->setValue($clip->title); $videoEditForm->getElement('description')->setValue($clip->description); $videoEditForm->getElement('code')->setValue($clip->code); if (OW::getRequest()->isPost() && $videoEditForm->isValid($_POST)) { $res = $videoEditForm->process(); OW::getFeedback()->info($language->text('video', 'clip_updated')); $this->redirect(OW::getRouter()->urlForRoute('view_clip', array('id' => $res['id']))); } OW::getDocument()->setHeading($language->text('video', 'tb_edit_clip')); OW::getDocument()->setHeadingIconClass('ow_ic_video'); OW::getDocument()->setTitle($language->text('video', 'tb_edit_clip')); }
public static function getStandardSettingValueList() { return array(self::SETTING_SHOW_TITLE => false, self::SETTING_TITLE => OW_Language::getInstance()->text('groups', 'widget_join_button_title'), self::SETTING_ICON => self::ICON_ADD); }
public function __construct($name, BOL_MenuItem $menu) { parent::__construct($name); $language = OW_Language::getInstance(); $plugin = OW::getPluginManager()->getPlugin('base'); $adminPlugin = OW::getPluginManager()->getPlugin('admin'); $nameTextField = new TextField('name'); $this->addElement($nameTextField->setValue($language->text($plugin->getKey(), $menu->getKey()))->setLabel(OW::getLanguage()->text('admin', 'pages_edit_external_menu_name_label'))->setRequired(true)); $urlTextField = new TextField('url'); $urlTextField->addValidator(new ADMIN_CLASS_ExternalPageUrlValidator()); $this->addElement($urlTextField->setValue($menu->getExternalUrl())->setLabel(OW::getLanguage()->text('admin', 'pages_edit_external_url_label'))->setRequired(true)); $extOpenInNewWindow = new CheckboxField('ext-open-in-new-window'); $this->addElement($extOpenInNewWindow->setLabel(OW::getLanguage()->text('admin', 'pages_edit_external_url_open_in_new_window'))->setValue($menu->getNewWindow())); $visibleForCheckboxGroup = new CheckboxGroup('visible-for'); $visibleFor = $menu->getVisibleFor(); $options = array('1' => OW::getLanguage()->text('admin', 'pages_edit_visible_for_guests'), '2' => OW::getLanguage()->text('admin', 'pages_edit_visible_for_members')); $values = array(); foreach ($options as $value => $option) { if (!($value & $visibleFor)) { continue; } $values[] = $value; } $this->addElement($visibleForCheckboxGroup->setOptions($options)->setValue($values)->setLabel(OW::getLanguage()->text('admin', 'pages_edit_external_visible_for'))); $saveSubmit = new Submit('save'); $this->addElement($saveSubmit->setValue($language->text($adminPlugin->getKey(), 'save_btn_label'))); }
public function __construct(array $params) { parent::__construct(); $id = $params['videoId']; $this->clipService = VIDEO_BOL_ClipService::getInstance(); $clip = $this->clipService->findClipById($id); if (!$clip) { throw new Redirect404Exception(); } $contentOwner = (int) $this->clipService->findClipOwner($id); $language = OW_Language::getInstance(); $description = $clip->description; $clip->description = UTIL_HtmlTag::autoLink($clip->description); $this->assign('clip', $clip); $is_featured = VIDEO_BOL_ClipFeaturedService::getInstance()->isFeatured($clip->id); $this->assign('featured', $is_featured); // is moderator $modPermissions = OW::getUser()->isAuthorized('video'); $this->assign('moderatorMode', $modPermissions); $userId = OW::getUser()->getId(); $ownerMode = $contentOwner == $userId; $this->assign('ownerMode', $ownerMode); if (!$ownerMode && !OW::getUser()->isAuthorized('video', 'view') && !$modPermissions) { $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html'); return; } $this->assign('auth_msg', null); // permissions check if (!$ownerMode && !$modPermissions) { $privacyParams = array('action' => 'video_view_video', 'ownerId' => $contentOwner, 'viewerId' => $userId); $event = new OW_Event('privacy_check_permission', $privacyParams); OW::getEventManager()->trigger($event); } $cmtParams = new BASE_CommentsParams('video', 'video_comments'); $cmtParams->setEntityId($id); $cmtParams->setOwnerId($contentOwner); $cmtParams->setDisplayType(BASE_CommentsParams::DISPLAY_TYPE_BOTTOM_FORM_WITH_FULL_LIST); $videoCmts = new BASE_CMP_Comments($cmtParams); $this->addComponent('comments', $videoCmts); $videoRates = new BASE_CMP_Rate('video', 'video_rates', $id, $contentOwner); $this->addComponent('rate', $videoRates); $videoTags = new BASE_CMP_EntityTagCloud('video'); $videoTags->setEntityId($id); $videoTags->setRouteName('view_tagged_list'); $this->addComponent('tags', $videoTags); $this->assign('canEdit', false); $this->assign('canReport', false); $this->assign('canMakeFeature', false); OW::getLanguage()->addKeyForJs('video', 'tb_edit_clip'); OW::getLanguage()->addKeyForJs('video', 'confirm_delete'); OW::getLanguage()->addKeyForJs('video', 'mark_featured'); OW::getLanguage()->addKeyForJs('video', 'remove_from_featured'); OW::getLanguage()->addKeyForJs('base', 'approve'); OW::getLanguage()->addKeyForJs('base', 'disapprove'); $toolbar = array(); $toolbarEvent = new BASE_CLASS_EventCollector('video.collect_video_toolbar_items', array('clipId' => $clip->id, 'clipDto' => $clip)); OW::getEventManager()->trigger($toolbarEvent); foreach ($toolbarEvent->getData() as $toolbarItem) { array_push($toolbar, $toolbarItem); } if (OW::getUser()->isAuthenticated() && !$ownerMode) { array_push($toolbar, array('href' => 'javascript://', 'id' => 'btn-video-flag', 'label' => $language->text('base', 'flag'))); $this->assign('canReport', true); } if ($ownerMode || $modPermissions) { array_push($toolbar, array('href' => OW::getRouter()->urlForRoute('edit_clip', array('id' => $clip->id)), 'label' => $language->text('base', 'edit'))); array_push($toolbar, array('href' => 'javascript://', 'id' => 'clip-delete', 'label' => $language->text('base', 'delete'))); $this->assign('canEdit', true); } if ($modPermissions) { if ($is_featured) { array_push($toolbar, array('href' => 'javascript://', 'id' => 'clip-mark-featured', 'rel' => 'remove_from_featured', 'label' => $language->text('video', 'remove_from_featured'))); $this->assign('isFeature', true); } else { array_push($toolbar, array('href' => 'javascript://', 'id' => 'clip-mark-featured', 'rel' => 'mark_featured', 'label' => $language->text('video', 'mark_featured'))); $this->assign('isFeature', false); } $this->assign('canMakeFeature', true); /* if ( $clip->status == 'approved' ) { array_push($toolbar, array( 'href' => 'javascript://', 'id' => 'clip-set-approval-staus', 'rel' => 'disapprove', 'label' => $language->text('base', 'disapprove') )); } else { array_push($toolbar, array( 'href' => 'javascript://', 'id' => 'clip-set-approval-staus', 'rel' => 'approve', 'label' => $language->text('base', 'approve') )); } */ } $this->assign('toolbar', $toolbar); /* $js = UTIL_JsGenerator::newInstance() ->jQueryEvent('#btn-video-flag', 'click', 'OW.flagContent(e.data.entity, e.data.id, e.data.title, e.data.href, "video+flags");', array('e'), array('entity' => 'video_clip', 'id' => $clip->id, 'title' => $clip->title, 'href' => OW::getRouter()->urlForRoute('view_clip', array('id' => $clip->id)) )); OW::getDocument()->addOnloadScript($js, 1001); */ //avatar $avatar = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($contentOwner), true, true, true, false); $this->assign('avatar', $avatar[$contentOwner]); /* $config = OW::getConfig(); $lang = OW::getLanguage(); $this->videoService = VIDEO_BOL_VideoService::getInstance(); $this->videoAlbumService = VIDEO_BOL_VideoAlbumService::getInstance(); $video = $this->videoService->findVideoById($videoId); $album = $this->videoAlbumService->findAlbumById($video->albumId); $this->assign('album', $album); $this->assign('video', $video); // is owner $contentOwner = $this->videoService->findVideoOwner($video->id); $userId = OW::getUser()->getId(); $ownerMode = $contentOwner == $userId; $this->assign('ownerMode', $ownerMode); // is moderator $modPermissions = OW::getUser()->isAuthorized('video'); $this->assign('moderatorMode', $modPermissions); $canView = true; if ( !$ownerMode && !$modPermissions && !OW::getUser()->isAuthorized('video', 'view') ) { $canView = false; } $this->assign('canView', $canView); $this->assign('canDownload', $config->getValue('gvideoviewer', 'can_users_to_download_videos')); $cmtParams = new BASE_CommentsParams('video', 'video_comments'); $cmtParams->setEntityId($video->id); $cmtParams->setOwnerId($contentOwner); $cmtParams->setDisplayType(BASE_CommentsParams::DISPLAY_TYPE_BOTTOM_FORM_WITH_FULL_LIST); $videoCmts = new BASE_CMP_Comments($cmtParams); $this->addComponent('comments', $videoCmts); $videoRates = new BASE_CMP_Rate('video', 'video_rates', $video->id, $contentOwner); $this->addComponent('rate', $videoRates); $videoTags = new BASE_CMP_EntityTagCloud('video'); $videoTags->setEntityId($video->id); $videoTags->setRouteName('view_tagged_video_list'); $this->addComponent('tags', $videoTags); $description = $video->description; $video->description = UTIL_HtmlTag::autoLink($video->description); $this->assign('video', $video); $this->assign('url', $this->videoService->getVideoUrl($video->id)); $this->assign('ownerName', BOL_UserService::getInstance()->getUserName($album->userId)); $is_featured = VIDEO_BOL_VideoFeaturedService::getInstance()->isFeatured($video->id); if ( (int) $config->getValue('video', 'store_fullsize') && $video->hasFullsize ) { $this->assign('fullsizeUrl', $this->videoService->getVideoFullsizeUrl($video->id)); } else { $this->assign('fullsizeUrl', null); } $action = new BASE_ContextAction(); $action->setKey('video-moderate'); $context = new BASE_CMP_ContextAction(); $context->addAction($action); $contextEvent = new BASE_CLASS_EventCollector('video.collect_video_context_actions', array( 'videoId' => $videoId, 'videoDto' => $video )); OW::getEventManager()->trigger($contextEvent); $this->assign('canEdit', false); $this->assign('canReport', false); $this->assign('canMakeFeature', false); foreach ( $contextEvent->getData() as $contextAction ) { $action = new BASE_ContextAction(); $action->setKey(empty($contextAction['key']) ? uniqid() : $contextAction['key']); $action->setParentKey('video-moderate'); $action->setLabel($contextAction['label']); if ( !empty($contextAction['id']) ) { $action->setId($contextAction['id']); } if ( !empty($contextAction['order']) ) { $action->setOrder($contextAction['order']); } if ( !empty($contextAction['class']) ) { $action->setClass($contextAction['class']); } if ( !empty($contextAction['url']) ) { $action->setUrl($contextAction['url']); } $attributes = empty($contextAction['attributes']) ? array() : $contextAction['attributes']; foreach ( $attributes as $key => $value ) { $action->addAttribute($key, $value); } $context->addAction($action); } if ( $userId && !$ownerMode ) { $action = new BASE_ContextAction(); $action->setKey('flag'); $action->setParentKey('video-moderate'); $action->setLabel($lang->text('base', 'flag')); $action->setId('btn-video-flag'); $action->addAttribute('rel', $videoId); $action->addAttribute('url', OW::getRouter()->urlForRoute('view_video', array('id' => $video->id))); $context->addAction($action); $this->assign('canReport', true); } if ( $ownerMode || $modPermissions ) { $action = new BASE_ContextAction(); $action->setKey('edit'); $action->setParentKey('video-moderate'); $action->setLabel($lang->text('base', 'edit')); $action->setId('btn-video-edit'); $action->addAttribute('rel', $videoId); $context->addAction($action); $action = new BASE_ContextAction(); $action->setKey('delete'); $action->setParentKey('video-moderate'); $action->setLabel($lang->text('base', 'delete')); $action->setId('video-delete'); $action->addAttribute('rel', $videoId); $context->addAction($action); $this->assign('canEdit', true); } if ( $modPermissions ) { if ( $is_featured ) { $action = new BASE_ContextAction(); $action->setKey('unmark-featured'); $action->setParentKey('video-moderate'); $action->setLabel($lang->text('video', 'remove_from_featured')); $action->setId('video-mark-featured'); $action->addAttribute('rel', 'remove_from_featured'); $action->addAttribute('video-id', $videoId); $context->addAction($action); $this->assign('isFeature', true); } else { $action = new BASE_ContextAction(); $action->setKey('mark-featured'); $action->setParentKey('video-moderate'); $action->setLabel($lang->text('video', 'mark_featured')); $action->setId('video-mark-featured'); $action->addAttribute('rel', 'mark_featured'); $action->addAttribute('video-id', $videoId); $context->addAction($action); $this->assign('isFeature', false); } $this->assign('canMakeFeature', true); } $this->addComponent('contextAction', $context); $avatar = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($contentOwner), true, true, true, false); $this->assign('avatar', $avatar[$contentOwner]); */ }
public static function getStandardSettingValueList() { return array(self::SETTING_SHOW_TITLE => true, self::SETTING_WRAP_IN_BOX => true, self::SETTING_TITLE => OW_Language::getInstance()->text('googlelocation', 'widget_map_title'), self::SETTING_ICON => self::ICON_BOOKMARK); }
public static function getStandardSettingValueList() { return array(self::SETTING_TITLE => OW_Language::getInstance()->text('groups', 'widget_user_groups_title'), self::SETTING_ICON => self::ICON_COMMENT, self::SETTING_SHOW_TITLE => true, self::SETTING_WRAP_IN_BOX => true); }
public function __construct($name, BOL_MenuItem $menu) { parent::__construct($name); $navigationService = BOL_NavigationService::getInstance(); $document = $navigationService->findDocumentByKey($menu->getDocumentKey()); if ($document === null) { $document = new BOL_Document(); $document->setKey($menu->getDocumentKey()); } $language = OW_Language::getInstance(); $languageService = BOL_LanguageService::getInstance(); $currentLanguageId = $languageService->getCurrent()->getId(); $plugin = OW::getPluginManager()->getPlugin('base'); $adminPlugin = OW::getPluginManager()->getPlugin('admin'); $nameTextField = new TextField('name'); $langValueDto = $languageService->getValue($currentLanguageId, $plugin->getKey(), $menu->getKey()); $langValue = $langValueDto === null ? '' : $language->text($plugin->getKey(), $menu->getKey()); $this->addElement($nameTextField->setValue($langValue)->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_menu_name'))->setRequired()); $titleTextField = new TextField('title'); $langValueDto = $languageService->getValue($currentLanguageId, $plugin->getKey(), 'local_page_title_' . $menu->getKey()); $langValue = $langValueDto === null ? '' : $language->text($plugin->getKey(), 'local_page_title_' . $menu->getKey()); $this->addElement($titleTextField->setValue($langValue)->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_page_title'))->setRequired(true)); $urlTextField = new TextField('url'); $urlTextField->addValidator(new LocalPageUniqueValidator($document->getUri())); $this->addElement($urlTextField->setValue($document->getUri())->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_page_url'))->setRequired(true)); $visibleForCheckboxGroup = new CheckboxGroup('visible-for'); $visibleFor = $menu->getVisibleFor(); $options = array('1' => OW::getLanguage()->text('admin', 'pages_edit_visible_for_guests'), '2' => OW::getLanguage()->text('admin', 'pages_edit_visible_for_members')); $values = array(); foreach ($options as $value => $option) { if (!($value & $visibleFor)) { continue; } $values[] = $value; } $this->addElement($visibleForCheckboxGroup->setOptions($options)->setValue($values)->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_visible_for'))); $metaTagsTextarea = new Textarea('meta-tags'); $langValueDto = $languageService->getValue($currentLanguageId, $plugin->getKey(), 'local_page_meta_tags_' . $menu->getKey()); $langValue = $langValueDto === null ? '' : $language->text($plugin->getKey(), 'local_page_meta_tags_' . $menu->getKey()); $this->addElement($metaTagsTextarea->setLabel('Page meta tags')->setValue($langValue)->setDescription(OW::getLanguage()->text('admin', 'pages_page_field_meta_desc'))->setId('meta-tags')); $contentTextArea = new Textarea('content'); $contentTextArea->setDescription(OW::getLanguage()->text('admin', 'pages_page_field_content_desc', array('src' => OW::getThemeManager()->getCurrentTheme()->getStaticImagesUrl() . 'question.png', 'url' => '#'))); $langValueDto = $languageService->getValue($currentLanguageId, $plugin->getKey(), 'local_page_content_' . $menu->getKey()); $langValue = $langValueDto === null ? '' : $language->text($plugin->getKey(), 'local_page_content_' . $menu->getKey()); $this->addElement($contentTextArea->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_page_content'))->setValue($langValue)->setId('content')); $saveSubmit = new Submit('save'); $this->addElement($saveSubmit->setValue($language->text($adminPlugin->getKey(), 'save_btn_label'))); }