Exemplo n.º 1
0
 /**
  * Class constructor
  *
  */
 public function __construct($configs)
 {
     parent::__construct('configSaveForm');
     $language = OW::getLanguage();
     $field = new RadioField('itunes_mode');
     $field->setOptions(array("test" => $language->text("skadateios", "itunes_mode_test"), "live" => $language->text("skadateios", "itunes_mode_live")));
     $field->setValue($configs["itunes_mode"]);
     $this->addElement($field);
     $field = new CheckboxField('billing_enabled');
     $field->setValue($configs["billing_enabled"]);
     $this->addElement($field);
     $field = new TextField('itunes_secret');
     $field->addValidator(new ConfigRequireValidator());
     $field->setValue($configs["itunes_secret"]);
     $this->addElement($field);
     $promoUrl = new TextField('app_url');
     $promoUrl->setRequired();
     $promoUrl->addValidator(new UrlValidator());
     $promoUrl->setLabel($language->text('skadateios', 'app_url_label'));
     $promoUrl->setDescription($language->text('skadateios', 'app_url_desc'));
     $promoUrl->setValue($configs['app_url']);
     $this->addElement($promoUrl);
     $smartBanner = new CheckboxField('smart_banner');
     $smartBanner->setLabel($language->text('skadateios', 'smart_banner_label'));
     $smartBanner->setDescription($language->text('skadateios', 'smart_banner_desc'));
     $smartBanner->setValue($configs['smart_banner']);
     $this->addElement($smartBanner);
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('admin', 'save_btn_label'));
     $this->addElement($submit);
 }
Exemplo n.º 2
0
 public function source($datas)
 {
     foreach ($datas as $key => $label) {
         $this->radios[] = $radio = new RadioField();
         $radio->push('name', $this->getName());
         $radio->setValue($key);
         foreach ($this->pushSave as $var => $val) {
             $radio->push($var, $val);
         }
         $this->labels[$key] = $label;
     }
 }
Exemplo n.º 3
0
 public function __construct($entityType, $entityId)
 {
     parent::__construct('flag');
     $this->setAjax(true);
     $this->setAction(OW::getRouter()->urlFor('BASE_CTRL_Flag', 'flag'));
     $element = new HiddenField('entityType');
     $element->setValue($entityType);
     $this->addElement($element);
     $element = new HiddenField('entityId');
     $element->setValue($entityId);
     $this->addElement($element);
     $element = new RadioField('reason');
     $element->setOptions(array('spam' => OW::getLanguage()->text('base', 'flag_spam'), 'offence' => OW::getLanguage()->text('base', 'flag_offence'), 'illegal' => OW::getLanguage()->text('base', 'flag_illegal')));
     $flagDto = BOL_FlagService::getInstance()->findFlag($entityType, $entityId, OW::getUser()->getId());
     if ($flagDto !== null) {
         $element->setValue($flagDto->reason);
     }
     $this->addElement($element);
     OW::getDocument()->addOnloadScript("owForms['{$this->getName()}'].bind('success', function(json){\n\t\t\tswitch( json['result'] ){\n\t\t\t\tcase 'success':\n\t\t\t\t\tOW.registry['flag-panel-fb'].close();\n\t\t\t\t\tOW.addScript(json.js);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t})");
 }
Exemplo n.º 4
0
 public static function getSettingList()
 {
     $language = OW::getLanguage();
     $pluginManager = OW::getPluginManager();
     return array('banners' => array('presentation' => self::PRESENTATION_CUSTOM, 'label' => $language->text('skadate', 'banners_label'), 'render' => function ($uniqName, $name, $value) {
         OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('skadate')->getStaticJsUrl() . 'mobile_experience.js');
         OW::getDocument()->addOnloadScript(UTIL_JsGenerator::composeJsString(';window.SKADATE_ME_SETTINGS({$params});', array('params' => array('iosActive' => OW::getPluginManager()->isPluginActive(SKADATE_CMP_MobileExperience::IOS), 'androidActive' => OW::getPluginManager()->isPluginActive(SKADATE_CMP_MobileExperience::ANDROID)))));
         $input = new CheckboxGroup('banners');
         $input->setOptions(array(SKADATE_CMP_MobileExperience::IOS => OW::getLanguage()->text('skadate', 'ios_label'), SKADATE_CMP_MobileExperience::ANDROID => OW::getLanguage()->text('skadate', 'android_label')));
         $input->setColumnCount(2);
         $input->setValue(!empty($value) ? array_keys($value) : null);
         return $input->renderInput();
     }, 'value' => array(self::IOS => $pluginManager->isPluginActive(self::IOS), self::ANDROID => $pluginManager->isPluginActive(self::ANDROID))), 'show_first' => array('presentation' => self::PRESENTATION_CUSTOM, 'label' => $language->text('skadate', 'show_first_label'), 'render' => function ($uniqName, $name, $value) {
         $input = new RadioField('show_first[]');
         $input->setOptions(array(SKADATE_CMP_MobileExperience::IOS => OW::getLanguage()->text('skadate', 'ios_label'), SKADATE_CMP_MobileExperience::ANDROID => OW::getLanguage()->text('skadate', 'android_label')));
         $input->setValue($value);
         $input->setColumnCount(2);
         return $input->renderInput();
     }, 'value' => $pluginManager->isPluginActive(self::IOS) ? self::IOS : self::ANDROID));
 }
Exemplo n.º 5
0
 public function __construct($type, $id, $title, $url, $langKey, $ownerId)
 {
     parent::__construct('flag');
     $this->setAjax(true);
     $this->setAction(OW::getRouter()->urlFor('BASE_CTRL_Flag', 'flag'));
     $hiddenType = new HiddenField('type');
     $hiddenId = new HiddenField('id');
     $hiddenTitle = new HiddenField('title');
     $hiddenUrl = new HiddenField('url');
     $hiddenOwnerId = new HiddenField('ownerId');
     $hiddenLangKey = new HiddenField('langKey');
     $this->addElement($hiddenType->setValue($type))->addElement($hiddenId->setValue($id))->addElement($hiddenTitle->setValue(htmlspecialchars($title)))->addElement($hiddenUrl->setValue($url))->addElement($hiddenLangKey->setValue($langKey))->addElement($hiddenOwnerId->setValue($ownerId));
     $reasonField = new RadioField('reason');
     $reasonField->setOptions(array('spam' => OW::getLanguage()->text('base', 'flag_spam'), 'offence' => OW::getLanguage()->text('base', 'flag_offence'), 'illegal' => OW::getLanguage()->text('base', 'flag_illegal')));
     $flagDto = BOL_FlagService::getInstance()->findFlag($type, $id, OW::getUser()->getId());
     if ($flagDto !== null) {
         $reasonField->setValue($flagDto->reason);
     }
     $this->addElement($reasonField);
     OW::getDocument()->addOnloadScript("owForms['{$this->getName()}'].bind('success', function(json){\n\t\t\tswitch( json['result'] ){\n\t\t\t\tcase 'success':\n\t\t\t\t\tOW.registry['flag-panel-fb'].close();\n\t\t\t\t\teval(json.js);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t})");
 }
Exemplo n.º 6
0
 /**
  * Class constructor
  *
  */
 public function __construct($configs)
 {
     parent::__construct('YNSOCIALSTREAM_FrontSettingsForm');
     $language = OW::getLanguage();
     $user_id = OW::getUser()->getId();
     $field = new RadioField('cron_job_user');
     $field->setLabel($language->text('ynsocialstream', 'cron_job_user_label'));
     $field->setValue($configs['cron_job_user_' . $user_id]);
     $field->addOptions(array('1' => $language->text('admin', 'permissions_index_yes'), '0' => $language->text('admin', 'permissions_index_no')));
     $this->addElement($field);
     $field = new RadioField('enable_facebook');
     $field->setLabel($language->text('ynsocialstream', 'enable_facebook_label'));
     $field->setValue($configs['enable_facebook_' . $user_id]);
     $field->addOptions(array('1' => $language->text('admin', 'permissions_index_yes'), '0' => $language->text('admin', 'permissions_index_no')));
     $this->addElement($field);
     $field = new RadioField('auth_fb');
     $field->setLabel($language->text('ynsocialstream', 'auth_fb_label'));
     $field->setValue($configs['auth_fb_' . $user_id]);
     $field->addOptions(array('everybody' => $language->text('ynsocialstream', 'everybody'), 'friends_only' => $language->text('ynsocialstream', 'friends_only'), 'only_for_me' => $language->text('ynsocialstream', 'only_for_me')));
     $this->addElement($field);
     $field = new RadioField('enable_twitter');
     $field->setLabel($language->text('ynsocialstream', 'enable_twitter_label'));
     $field->setValue($configs['enable_twitter_' . $user_id]);
     $field->addOptions(array('1' => $language->text('admin', 'permissions_index_yes'), '0' => $language->text('admin', 'permissions_index_no')));
     $this->addElement($field);
     $field = new RadioField('auth_tw');
     $field->setLabel($language->text('ynsocialstream', 'auth_tw_label'));
     $field->setValue($configs['auth_tw_' . $user_id]);
     $field->addOptions(array('everybody' => $language->text('ynsocialstream', 'everybody'), 'friends_only' => $language->text('ynsocialstream', 'friends_only'), 'only_for_me' => $language->text('ynsocialstream', 'only_for_me')));
     $this->addElement($field);
     $field = new RadioField('enable_linkedin');
     $field->setLabel($language->text('ynsocialstream', 'enable_linkedin_label'));
     $field->setValue($configs['enable_linkedin_' . $user_id]);
     $field->addOptions(array('1' => $language->text('admin', 'permissions_index_yes'), '0' => $language->text('admin', 'permissions_index_no')));
     $this->addElement($field);
     $field = new RadioField('auth_li');
     $field->setLabel($language->text('ynsocialstream', 'auth_li_label'));
     $field->setValue($configs['auth_li_' . $user_id]);
     $field->addOptions(array('everybody' => $language->text('ynsocialstream', 'everybody'), 'friends_only' => $language->text('ynsocialstream', 'friends_only'), 'only_for_me' => $language->text('ynsocialstream', 'only_for_me')));
     $this->addElement($field);
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('ynsocialstream', 'admin_save_btn'));
     $this->addElement($submit);
 }
Exemplo n.º 7
0
 /**
  * Class constructor
  *
  */
 public function __construct()
 {
     parent::__construct('configSaveForm');
     $language = OW::getLanguage();
     $configs = OW::getConfig()->getValues('mailbox');
     //        $element = new CheckboxField('enableAttachments');
     //        $element->setValue($configs['enable_attachments']);
     //        $this->addElement($element);
     $activeModeList = new RadioField('active_mode_list');
     $activeModeList->setLabel($language->text('mailbox', 'settings_label_active_mode_list'));
     $availableModeCollector = new BASE_CLASS_EventCollector('plugin.mailbox.on_available_mode_collect');
     OW::getEventManager()->trigger($availableModeCollector);
     $data = $availableModeCollector->getData();
     if (!empty($data)) {
         foreach ($data as $modeName) {
             $availableModeList[$modeName] = $language->text('mailbox', 'label_btn_' . $modeName);
         }
     } else {
         $availableModeList = array('mail' => $language->text('mailbox', 'label_btn_mail'), 'chat' => $language->text('mailbox', 'label_btn_chat'), 'mailchat' => $language->text('mailbox', 'label_btn_mailchat'));
     }
     $activeModeList->setOptions($availableModeList);
     $activeModes = MAILBOX_BOL_ConversationService::getInstance()->getActiveModeList();
     if (in_array('mail', $activeModes) && in_array('chat', $activeModes)) {
         $activeModeList->setValue('mailchat');
     } else {
         $activeModeList->setValue($activeModes[0]);
     }
     $activeModeList->setRequired();
     $this->addElement($activeModeList);
     if (in_array('mail', $activeModes)) {
         $sendMessageInterval = new TextField('send_message_interval');
         $sendMessageInterval->setValue($configs['send_message_interval']);
         $sendMessageInterval->setLabel($language->text('mailbox', 'settings_label_send_message_interval'));
         $this->addElement($sendMessageInterval);
     }
     $showAllMembers = new CheckboxField('show_all_members');
     $showAllMembers->setLabel($language->text('mailbox', 'settings_label_show_all_members'));
     $showAllMembers->setDescription($language->text('mailbox', 'settings_desc_show_all_members'));
     $showAllMembers->setValue(OW::getConfig()->getValue('mailbox', 'show_all_members'));
     $this->addElement($showAllMembers);
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('base', 'edit_button'));
     $this->addElement($submit);
     //        $js = <<<EOT
     //$("input[name='active_mode_list']").click(function(){
     //    if ($(this).val()=='mail')
     //    {
     //        $("input[name='show_all_members']").attr('disabled', 'disabled');
     //        $("#showAllMembersContainer").hide();
     //    }
     //    else
     //    {
     //        $("input[name='show_all_members']").removeAttr('disabled');
     //        $("#showAllMembersContainer").show();
     //    }
     //});
     //EOT;
     //
     //        OW::getDocument()->addOnloadScript($js);
 }
Exemplo n.º 8
0
 public function __construct()
 {
     parent::__construct('notificationSettingForm');
     $language = OW::getLanguage();
     $field = new RadioField('schedule');
     $field->addOption(NOTIFICATIONS_BOL_Service::SCHEDULE_IMMEDIATELY, $language->text('notifications', 'schedule_immediately'));
     $field->addOption(NOTIFICATIONS_BOL_Service::SCHEDULE_AUTO, $language->text('notifications', 'schedule_automatic'));
     $field->addOption(NOTIFICATIONS_BOL_Service::SCHEDULE_NEVER, $language->text('notifications', 'schedule_never'));
     $schedule = NOTIFICATIONS_BOL_Service::getInstance()->getSchedule(OW::getUser()->getId());
     $field->setValue($schedule);
     $this->addElement($field);
     $btn = new Submit('save');
     $btn->setValue($language->text('notifications', 'save_setting_btn_label'));
     $this->addElement($btn);
 }
Exemplo n.º 9
0
 public function __construct($configs)
 {
     parent::__construct('YNSOCIALSTREAM_LevelSettingsForm');
     $language = OW::getLanguage();
     $field = new CheckboxGroup('level_id');
     $field->setLabel($language->text('ynsocialstream', 'admin_level_id_label'));
     $field->setValue($configs['get_feed']);
     $field->addOptions(array('1' => $language->text('admin', 'permissions_index_yes'), '0' => $language->text('admin', 'permissions_index_no')));
     $this->addElement($field);
     $field = new RadioField('get_feed');
     $field->setLabel($language->text('ynsocialstream', 'admin_get_feed_label'));
     $field->setValue($configs['get_feed']);
     $field->addOptions(array('1' => $language->text('admin', 'permissions_index_yes'), '0' => $language->text('admin', 'permissions_index_no')));
     $this->addElement($field);
     $btn = new Submit('save');
     $btn->setValue($language->text('ynsocialstream', 'save_customization_btn_label'));
     $this->addElement($btn);
 }
Exemplo n.º 10
0
 public function __construct($pluginKey, $entityType, $entityId)
 {
     // remove newfeeds cookie if has
     setcookie('ynsocialpublisher_feed_data_' . $entityId, '', -1, '/');
     parent::__construct();
     $userId = OW::getUser()->getId();
     $language = OW::getLanguage();
     $service = YNSOCIALPUBLISHER_BOL_Service::getInstance();
     $core = YNSOCIALPUBLISHER_CLASS_Core::getInstance();
     // user setting
     $userSetting = $service->getUsersetting($userId, $pluginKey);
     $this->assign('userSetting', $userSetting);
     // avatar
     $avatar = BOL_AvatarService::getInstance()->getAvatarUrl($userId);
     if (empty($avatar)) {
         $avatar = BOL_AvatarService::getInstance()->getDefaultAvatarUrl();
     }
     $this->assign('avatar', $avatar);
     // default status
     $defaultStatus = $core->getDefaultStatus($pluginKey, $entityType, $entityId);
     $this->assign('defaultStatus', $defaultStatus);
     // entity url
     $url = $core->getUrl($pluginKey, $entityType, $entityId);
     $this->assign('url', $url);
     // title
     $title = $core->getTitle($pluginKey, $entityType, $entityId);
     $this->assign('title', $title);
     // -- connect each provider to get data
     // callbackUrl
     $callbackUrl = OW::getRouter()->urlForRoute('ynsocialbridge-connects');
     $coreBridge = new YNSOCIALBRIDGE_CLASS_Core();
     $arrObjServices = array();
     foreach (array('facebook', 'twitter', 'linkedin') as $serviceName) {
         $profile = null;
         $connect_url = "";
         $access_token = "";
         $scope = '';
         $objService = array();
         //check enable API
         $clientConfig = YNSOCIALBRIDGE_BOL_ApisettingService::getInstance()->getConfig($serviceName);
         if ($clientConfig) {
             $obj = $coreBridge->getInstance($serviceName);
             $values = array('service' => $serviceName, 'userId' => OW::getUser()->getId());
             //$tokenDto = $obj -> getToken($values);
             //print_r($_SESSION['socialbridge_session'][$serviceName]);die;
             $disconnect_url = OW::getRouter()->urlForRoute('ynsocialbridge-disconnect') . "?service=" . $serviceName;
             if (!empty($_SESSION['socialbridge_session'][$serviceName]['access_token'])) {
                 if ($serviceName == 'facebook') {
                     $access_token = $_SESSION['socialbridge_session'][$serviceName]['access_token'];
                     //check permission
                     $me = $obj->getOwnerInfo(array('access_token' => $access_token));
                     $uid = $me['id'];
                     $permissions = $obj->hasPermission(array('uid' => $uid, 'access_token' => $access_token));
                     if ($permissions) {
                         if (empty($permissions[0]['publish_stream']) || empty($permissions[0]['status_update'])) {
                             $scope = 'publish_stream,status_update';
                             //$scope = "email,user_about_me,user_birthday,user_hometown,user_interests,user_location,user_photos,user_website,publish_stream,status_update";
                         } else {
                             try {
                                 $profile = $obj->getOwnerInfo($_SESSION['socialbridge_session'][$serviceName]);
                             } catch (Exception $e) {
                                 $profile = null;
                             }
                         }
                     }
                 } else {
                     $profile = $obj->getOwnerInfo($_SESSION['socialbridge_session'][$serviceName]);
                 }
             } else {
                 $scope = "";
                 switch ($serviceName) {
                     case 'facebook':
                         //$scope = "email,user_about_me,user_birthday,user_hometown,user_interests,user_location,user_photos,user_website";
                         $scope = 'publish_stream,status_update';
                         break;
                     case 'twitter':
                         $scope = "";
                         break;
                     case 'linkedin':
                         $scope = "r_basicprofile,rw_nus,r_network,w_messages";
                         break;
                 }
             }
             $connect_url = $obj->getConnectUrl() . "?scope=" . $scope . "&" . http_build_query(array('callbackUrl' => $callbackUrl, 'isFromSocialPublisher' => 1, 'pluginKey' => $pluginKey, 'entityType' => $entityType, 'entityId' => $entityId));
             $objService['has_config'] = 1;
         } else {
             $objService['has_config'] = 0;
         }
         $objService['serviceName'] = $serviceName;
         $objService['connectUrl'] = $connect_url;
         $objService['disconnectUrl'] = $disconnect_url;
         $objService['profile'] = $profile;
         $objService['logo'] = OW::getPluginManager()->getPlugin('ynsocialpublisher')->getStaticUrl() . "img/" . $serviceName . ".png";
         $arrObjServices[$serviceName] = $objService;
     }
     //print_r($userSetting);
     //print_r($arrObjServices);
     $this->assign('arrObjServices', $arrObjServices);
     // create form
     $formUrl = OW::getRouter()->urlFor('YNSOCIALPUBLISHER_CTRL_Ynsocialpublisher', 'ajaxPublish');
     $form = new Form('ynsocialpubisher_share');
     $form->setAction($formUrl);
     $form->setAjax();
     // -- hidden fields
     // for plugin key
     $pluginKeyHiddenField = new HiddenField('ynsocialpublisher_pluginKey');
     $pluginKeyHiddenField->setValue($pluginKey);
     $form->addElement($pluginKeyHiddenField);
     // for entity id
     $entityIdHiddenField = new HiddenField('ynsocialpublisher_entityId');
     $entityIdHiddenField->setValue($entityId);
     $form->addElement($entityIdHiddenField);
     // for entity type
     $entityTypeHiddenField = new HiddenField('ynsocialpublisher_entityType');
     $entityTypeHiddenField->setValue($entityType);
     $form->addElement($entityTypeHiddenField);
     // Status - textarea
     $status = new Textarea('ynsocialpublisher_status');
     $status->setValue($defaultStatus);
     $form->addElement($status);
     // Options - radio buttons
     $options = new RadioField('ynsocialpublisher_options');
     $options->setRequired();
     $options->addOptions(array('0' => $language->text('ynsocialpublisher', 'ask'), '1' => $language->text('ynsocialpublisher', 'auto'), '2' => $language->text('ynsocialpublisher', 'not_ask')));
     $options->setValue($userSetting['option']);
     $form->addElement($options);
     // Providers - checkboxes
     foreach (array('facebook', 'twitter', 'linkedin') as $provider) {
         if (in_array($provider, $userSetting['adminProviders']) && $arrObjServices[$provider]['has_config']) {
             $providerField = new CheckboxField('ynsocialpublisher_' . $provider);
             $form->addElement($providerField);
         }
     }
     // add js action to form
     $form->bindJsFunction(Form::BIND_SUCCESS, 'function(data){if( data.result ){OW.info(data.message);OWActiveFloatBox.close();}else{OW.error(data.message);}}');
     // submit button
     $submit = new Submit('submit');
     $submit->setValue(OW::getLanguage()->text('ynsocialpublisher', 'submit_label'));
     $form->addElement($submit);
     $this->addForm($form);
     // assign to view
     $this->assign('formUrl', $formUrl);
 }
Exemplo n.º 11
0
 public function __construct()
 {
     parent::__construct('buy-credits-form');
     $accountTypeId = USERCREDITS_BOL_CreditsService::getInstance()->getUserAccountTypeId(OW::getUser()->getId());
     $packs = USERCREDITS_BOL_CreditsService::getInstance()->getPackList($accountTypeId);
     $packField = new RadioField('pack');
     $packField->setRequired();
     $value = 0;
     foreach ($packs as $p) {
         $packField->addOption($p['id'], $p['title']);
         if ($value == 0) {
             $value = $p['id'];
         }
     }
     $packField->setValue($value);
     $this->addElement($packField);
     $gatewaysField = new BillingGatewaySelectionField('gateway');
     $gatewaysField->setRequired(true);
     $this->addElement($gatewaysField);
     $submit = new Submit('buy');
     $submit->setValue(OW::getLanguage()->text('base', 'checkout'));
     $this->addElement($submit);
 }
 public function __construct(BOL_MenuItem $menuItem, $custom = false, $addUrlValidator = true)
 {
     parent::__construct("settingForm");
     $this->menuItem = $menuItem;
     $language = OW::getLanguage();
     $this->setAjax();
     $this->setAction(OW::getRouter()->urlFor("ADMIN_CTRL_MobileNavigation", "saveItemSettings"));
     $item = new HiddenField("key");
     $item->setValue($menuItem->prefix . ':' . $menuItem->key);
     $this->addElement($item);
     $settings = BOL_MobileNavigationService::getInstance()->getItemSettings($this->menuItem);
     // Mail Settings
     $item = new TextField(BOL_MobileNavigationService::SETTING_LABEL);
     $item->setLabel($language->text("mobile", "admin_nav_item_label_field"));
     $item->setValue($settings[BOL_MobileNavigationService::SETTING_LABEL]);
     $item->setRequired();
     $this->addElement($item);
     if ($custom) {
         $typeField = new RadioField(BOL_MobileNavigationService::SETTING_TYPE);
         $typeField->setLabel($language->text("mobile", "admin_nav_item_type_field"));
         $typeField->setValue($settings[BOL_MobileNavigationService::SETTING_TYPE]);
         $typeField->addOption("local", $language->text("mobile", "admin_nav_item_type_local"));
         $typeField->addOption("external", $language->text("mobile", "admin_nav_item_type_external"));
         $this->addElement($typeField);
         $item = new TextField(BOL_MobileNavigationService::SETTING_TITLE);
         $item->setLabel($language->text("mobile", "admin_nav_item_title_field"));
         $item->setValue($settings[BOL_MobileNavigationService::SETTING_TITLE]);
         $item->setRequired();
         $this->addElement($item);
         $item = new Textarea(BOL_MobileNavigationService::SETTING_CONTENT);
         $item->setLabel($language->text("mobile", "admin_nav_item_content_field"));
         $item->setValue($settings[BOL_MobileNavigationService::SETTING_CONTENT]);
         $this->addElement($item);
         $item = new TextField(BOL_MobileNavigationService::SETTING_URL);
         if ($addUrlValidator) {
             $item->addValidator(new UrlValidator());
             $item->setRequired();
         }
         $item->setLabel($language->text("mobile", "admin_nav_item_url_field"));
         $item->setValue($settings[BOL_MobileNavigationService::SETTING_URL]);
         $this->addElement($item);
         $item = new CheckboxGroup(BOL_MobileNavigationService::SETTING_VISIBLE_FOR);
         $visibleFor = empty($settings[BOL_MobileNavigationService::SETTING_VISIBLE_FOR]) ? 0 : $settings[BOL_MobileNavigationService::SETTING_VISIBLE_FOR];
         $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($item->setOptions($options)->setValue($values)->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_visible_for')));
         $js = UTIL_JsGenerator::newInstance();
         $js->addScript('var url = owForms[{$name}].elements["url"]; var validators = url.validators; url.validators = []; $("input[name=type]", "#" + {$id}).change(function() { ' . 'if ($(this).val() == "local") { ' . '$("#mp-content").show(); $("#mp-url").hide(); url.validators = []; ' . '} else { ' . '$("#mp-content").hide(); $("#mp-url").show(); url.validators = validators; } ' . '});', array("id" => $this->getId(), "name" => $this->getName()));
         OW::getDocument()->addOnloadScript($js);
     }
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('admin', 'save_btn_label'));
     $this->addElement($submit);
 }