예제 #1
0
파일: Meta.php 프로젝트: forkcms/forkcms
 /**
  * Add all element into the form
  */
 protected function loadForm()
 {
     // is the form submitted?
     if ($this->frm->isSubmitted()) {
         /**
          * If the fields are disabled we don't have any values in the post.
          * When an error occurs in the other fields of the form the meta-fields would be cleared
          * therefore we alter the POST so it contains the initial values.
          */
         if (!isset($_POST['page_title'])) {
             $_POST['page_title'] = isset($this->data['title']) ? $this->data['title'] : null;
         }
         if (!isset($_POST['meta_description'])) {
             $_POST['meta_description'] = isset($this->data['description']) ? $this->data['description'] : null;
         }
         if (!isset($_POST['meta_keywords'])) {
             $_POST['meta_keywords'] = isset($this->data['keywords']) ? $this->data['keywords'] : null;
         }
         if (!isset($_POST['url'])) {
             $_POST['url'] = isset($this->data['url']) ? $this->data['url'] : null;
         }
         if ($this->custom && !isset($_POST['meta_custom'])) {
             $_POST['meta_custom'] = isset($this->data['custom']) ? $this->data['custom'] : null;
         }
         if (!isset($_POST['seo_index'])) {
             $_POST['seo_index'] = isset($this->data['data']['seo_index']) ? $this->data['data']['seo_index'] : 'none';
         }
         if (!isset($_POST['seo_follow'])) {
             $_POST['seo_follow'] = isset($this->data['data']['seo_follow']) ? $this->data['data']['seo_follow'] : 'none';
         }
     }
     // add page title elements into the form
     $this->frm->addCheckbox('page_title_overwrite', isset($this->data['title_overwrite']) && $this->data['title_overwrite'] == 'Y');
     $this->frm->addText('page_title', isset($this->data['title']) ? $this->data['title'] : null);
     // add meta description elements into the form
     $this->frm->addCheckbox('meta_description_overwrite', isset($this->data['description_overwrite']) && $this->data['description_overwrite'] == 'Y');
     $this->frm->addText('meta_description', isset($this->data['description']) ? $this->data['description'] : null);
     // add meta keywords elements into the form
     $this->frm->addCheckbox('meta_keywords_overwrite', isset($this->data['keywords_overwrite']) && $this->data['keywords_overwrite'] == 'Y');
     $this->frm->addText('meta_keywords', isset($this->data['keywords']) ? $this->data['keywords'] : null);
     // add URL elements into the form
     $this->frm->addCheckbox('url_overwrite', isset($this->data['url_overwrite']) && $this->data['url_overwrite'] == 'Y');
     $this->frm->addText('url', isset($this->data['url']) ? urldecode($this->data['url']) : null);
     // advanced SEO
     $indexValues = array(array('value' => 'none', 'label' => BackendLanguage::getLabel('None')), array('value' => 'index', 'label' => 'index'), array('value' => 'noindex', 'label' => 'noindex'));
     $this->frm->addRadiobutton('seo_index', $indexValues, isset($this->data['data']['seo_index']) ? $this->data['data']['seo_index'] : 'none');
     $followValues = array(array('value' => 'none', 'label' => BackendLanguage::getLabel('None')), array('value' => 'follow', 'label' => 'follow'), array('value' => 'nofollow', 'label' => 'nofollow'));
     $this->frm->addRadiobutton('seo_follow', $followValues, isset($this->data['data']['seo_follow']) ? $this->data['data']['seo_follow'] : 'none');
     // should we add the meta-custom field
     if ($this->custom) {
         // add meta custom element into the form
         $this->frm->addTextarea('meta_custom', isset($this->data['custom']) ? $this->data['custom'] : null);
     }
     $this->frm->addHidden('meta_id', $this->id);
     $this->frm->addHidden('base_field_name', $this->baseFieldName);
     $this->frm->addHidden('custom', $this->custom);
     $this->frm->addHidden('class_name', $this->callback['class']);
     $this->frm->addHidden('method_name', $this->callback['method']);
     $this->frm->addHidden('parameters', \SpoonFilter::htmlspecialchars(serialize($this->callback['parameters'])));
 }
예제 #2
0
파일: Index.php 프로젝트: bwgraves/forkcms
 /**
  * Load the settings form
  */
 protected function loadSettingsForm()
 {
     $mapTypes = array('ROADMAP' => BL::lbl('Roadmap', $this->getModule()), 'SATELLITE' => BL::lbl('Satellite', $this->getModule()), 'HYBRID' => BL::lbl('Hybrid', $this->getModule()), 'TERRAIN' => BL::lbl('Terrain', $this->getModule()));
     $zoomLevels = array_combine(array_merge(array('auto'), range(3, 18)), array_merge(array(BL::lbl('Auto', $this->getModule())), range(3, 18)));
     $this->form = new BackendForm('settings');
     // add map info (overview map)
     $this->form->addHidden('map_id', 0);
     $this->form->addDropdown('zoom_level', $zoomLevels, $this->settings['zoom_level']);
     $this->form->addText('width', $this->settings['width']);
     $this->form->addText('height', $this->settings['height']);
     $this->form->addDropdown('map_type', $mapTypes, $this->settings['map_type']);
 }
예제 #3
0
파일: Index.php 프로젝트: forkcms/forkcms
 /**
  * Load the settings form
  */
 protected function loadSettingsForm()
 {
     $mapTypes = array('ROADMAP' => BL::lbl('Roadmap', $this->getModule()), 'SATELLITE' => BL::lbl('Satellite', $this->getModule()), 'HYBRID' => BL::lbl('Hybrid', $this->getModule()), 'TERRAIN' => BL::lbl('Terrain', $this->getModule()), 'STREET_VIEW' => BL::lbl('StreetView', $this->getModule()));
     $mapStyles = array('standard' => BL::lbl('Default', $this->getModule()), 'custom' => BL::lbl('Custom', $this->getModule()), 'gray' => BL::lbl('Gray', $this->getModule()), 'blue' => BL::lbl('Blue', $this->getModule()));
     $zoomLevels = array_combine(array_merge(array('auto'), range(1, 18)), array_merge(array(BL::lbl('Auto', $this->getModule())), range(1, 18)));
     $this->form = new BackendForm('settings');
     // add map info (overview map)
     $this->form->addHidden('map_id', 0);
     $this->form->addDropdown('zoom_level', $zoomLevels, $this->settings['zoom_level']);
     $this->form->addText('width', $this->settings['width']);
     $this->form->addText('height', $this->settings['height']);
     $this->form->addDropdown('map_type', $mapTypes, $this->settings['map_type']);
     $this->form->addDropdown('map_style', $mapStyles, isset($this->settings['map_style']) ? $this->settings['map_style'] : null);
 }
예제 #4
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('filter', null, 'get');
     // add fields
     $this->frm->addText('email', $this->filter['email']);
     $this->frm->addHidden('group_id', $this->group['id']);
     // manually parse fields
     $this->frm->parse($this->tpl);
     // check if the filter form was set
     if ($this->frm->isSubmitted()) {
         $this->tpl->assign('oPost', true);
     }
 }