Пример #1
0
 public function get(Theme $theme)
 {
     $silos = Media::dir();
     foreach ($silos as &$silo) {
         $silo->path_slug = Utils::slugify($silo->path);
     }
     $this->vars['silos'] = $silos;
     return parent::get($theme);
 }
Пример #2
0
 /**
  * Produce HTML output for this password control.
  *
  * @param Theme $theme The theme to use to render this control
  * @return string HTML for this control in the form
  */
 public function get(Theme $theme)
 {
     if ($url = $this->get_setting('url', false)) {
         $url = Utils::addslashes($url);
         $this->set_properties(array('onclick' => "location.href='{$url}';return false;"));
     }
     $this->properties['value'] = $this->get_setting('caption', '');
     return parent::get($theme);
 }
Пример #3
0
 /**
  * Produce the control for display
  * @param Theme $theme The theme that will be used to render the template
  * @return string The output of the template
  */
 public function get(Theme $theme)
 {
     // Because this is a checkbox, the value isn't directly output in the control
     $this->properties['value'] = $this->returned_value;
     if ($this->value == false) {
         unset($this->properties['checked']);
     } else {
         $this->properties['checked'] = 'checked';
     }
     return parent::get($theme);
 }
Пример #4
0
 /**
  * Get this control for display
  * @param Theme $theme The theme to use for rendering
  * @return string The output
  */
 public function get(Theme $theme)
 {
     $this->vars['element'] = $this->get_setting('wrap_element', 'div');
     $content = '';
     foreach ($this->value as $key => $data) {
         // Push the $key of this array item into the control's name
         $this->each(function (FormControl $control) use($key) {
             $control->add_input_array($key);
         });
         $content .= $this->get_contents($theme);
         // Pop the key of this array item out of the control's name
         $this->each(function (FormControl $control) {
             $control->pop_input_array();
         });
     }
     $this->vars['content'] = $content;
     return FormControl::get($theme);
 }
Пример #5
0
 /**
  * Produce HTML output for this text control.
  *
  * @param boolean $forvalidation True if this control should render error information based on validation.
  * @return string HTML that will render this control in the form
  */
 public function get(Theme $theme)
 {
     $this->vars['options'] = $this->options;
     $this->settings['internal_value'] = true;
     return parent::get($theme);
 }
Пример #6
0
 public function get(Theme $theme)
 {
     $this->properties['type'] = 'hidden';
     $this->properties['data-facet-config'] = json_encode($this->properties['data-facet-config']);
     $this->set_template_properties('div', array('id' => $this->get_visualizer(), 'data-target' => $this->get_id()));
     return parent::get($theme);
 }
Пример #7
0
	/**
	 * Return the HTML construction of the control, after changing the encoding of the parent form to allow for file uploads.
	 *
	 * @param boolean $forvalidation True if the control should output validation information with the control.
	 */
	public function get( $forvalidation = true )
	{
		$form = $this->get_form();
		$form->properties['enctype'] = 'multipart/form-data';

		return parent::get( $forvalidation );
	}
Пример #8
0
 /**
  * Render this control
  * Ensures that this control has an id property
  * @param Theme $theme The theme used to render the control
  * @return string The HTML output of the control
  */
 public function get(Theme $theme)
 {
     $this->get_id(true);
     $this->set_settings(array('html_value' => json_encode($this->value)));
     return parent::get($theme);
 }
Пример #9
0
 public function get(Theme $theme)
 {
     if (isset($this->settings['ajax_url'])) {
         $this->properties['data-autocomplete-config']->ajax_url = $this->settings['ajax_url'];
     }
     if (isset($this->settings['ajax_ishtml'])) {
         $this->properties['data-autocomplete-config']->ajax_ishtml = $this->settings['ajax_ishtml'];
     }
     if (isset($this->settings['allow_new'])) {
         $this->properties['data-autocomplete-config']->tokenSeparators = array(',');
         $this->properties['data-autocomplete-config']->allow_new = true;
     }
     if (isset($this->settings['init_selection'])) {
         $this->properties['data-autocomplete-config']->init_selection = true;
     }
     $this->properties['data-autocomplete-config'] = json_encode($this->properties['data-autocomplete-config']);
     /*
     		Stack::add('template_header_javascript', 'select2' );
     		Stack::add('template_stylesheet', 'select2-css');
     */
     return parent::get($theme);
 }
Пример #10
0
 /**
  * Produce HTML output for all this fieldset and all contained controls
  *
  * @param Theme $theme The theme used to render the controls
  * @return string HTML that will render this control in the form
  */
 function get(Theme $theme)
 {
     if (!isset($this->vars['content'])) {
         $this->vars['content'] = $this->get_contents($theme);
     }
     return parent::get($theme);
 }
Пример #11
0
 /**
  * Produce HTML output for this static text control.
  *
  * @param Theme $theme The theme used to render this control
  * @return string HTML that will render this control in the form
  */
 public function get(Theme $theme)
 {
     $this->vars['static'] = $this->static;
     return parent::get($theme);
 }
Пример #12
0
 function get(Theme $theme)
 {
     // Tell the theme what template to render for this control
     $this->set_template('control.customz');
     return parent::get($theme);
 }