Ejemplo n.º 1
0
 /**
  * Render the Profiler
  *
  * @return string	rendered Profiler view
  **/
 public function render()
 {
     $rendered_sections = array();
     foreach ($this->sections as $index => $section) {
         $view = $this->view_factory->make($section->getViewName());
         $rendered_sections[] = $section->render($view, $index);
     }
     $view = $this->view_factory->make('profiler/container');
     return $view->render(array('sections' => $this->sections, 'rendered_sections' => $rendered_sections));
 }
Ejemplo n.º 2
0
 /**
  * Renders the sidebar
  *
  * @return string The rendered HTML of the sidebar
  */
 public function render()
 {
     $output = '';
     foreach ($this->headers as $header) {
         $output .= $header->render($this->view);
     }
     if (empty($output)) {
         return '';
     }
     return $this->view->make('_shared/sidebar/sidebar')->render(array('sidebar' => $output));
 }
Ejemplo n.º 3
0
 /**
  * Renders this item. This should not be called directly. Instead use
  * the Sidebar's render method.
  *
  * @see Sidebar::render
  * @param ViewFactory $view A ViewFactory object to use with rendering
  * @return string The rendered HTML of the item
  */
 public function render(ViewFactory $view)
 {
     $class = trim($this->class);
     if ($class) {
         $class = ' class="' . $class . '"';
     }
     $attrs = '';
     if ($this->url_is_external) {
         $attrs .= ' rel="external"';
     }
     if ($this->rel) {
         $attrs .= ' class="m-link" rel="' . $this->rel . '"';
     }
     $vars = array('text' => $this->text, 'url' => $this->url, 'attrs' => $attrs, 'class' => $class);
     return $view->make('_shared/sidebar/basic_item')->render($vars);
 }
Ejemplo n.º 4
0
 /**
  * Renders this item. This should not be called directly. Instead use
  * the Sidebar's render method.
  *
  * @see Sidebar::render
  * @param ViewFactory $view A ViewFactory object to use with rendering
  * @return string The rendered HTML of the item
  */
 public function render(ViewFactory $view)
 {
     $class = trim($this->class);
     if ($class) {
         $class = ' class="' . $class . '"';
     }
     $vars = array('text' => $this->text, 'url' => $this->url, 'external' => $this->url_is_external, 'class' => $class, 'edit' => $this->has_edit, 'remove' => $this->has_remove, 'edit_url' => $this->edit_url, 'modal_name' => $this->name, 'confirm' => $this->remove_confirmation, 'key' => $this->removal_key, 'value' => $this->removal_key_value);
     return $view->make('_shared/sidebar/folder_item')->render($vars);
 }
Ejemplo n.º 5
0
 /**
  * @see Filter::render
  *
  * Overriding the abstract class's render method in order to pass in the
  * timestamp value to a custom 'date' view
  */
 public function render(ViewFactory $view, URL $url)
 {
     $options = $this->prepareOptions($url);
     if (empty($options)) {
         return;
     }
     $value = $this->display_value;
     if (is_null($value)) {
         $value = array_key_exists($this->value(), $this->options) ? $this->options[$this->value()] : $this->value();
     }
     $filter = array('label' => $this->label, 'name' => $this->name, 'value' => $value, 'custom_value' => array_key_exists($this->name, $_POST) ? $_POST[$this->name] : FALSE, 'placeholder' => $this->placeholder, 'options' => $options, 'timestamp' => $this->timestamp);
     return $view->make('_shared/filters/date')->render($filter);
 }
Ejemplo n.º 6
0
 /**
  * Renders this header. This should not be called directly. Instead use
  * the Sidebar's render method.
  *
  * @see Sidebar::render
  * @param ViewFactory $view A ViewFactory object to use with rendering
  * @return string The rendered HTML of the header and its lists
  */
 public function render(ViewFactory $view)
 {
     $vars = array('text' => $this->text, 'class' => $this->class, 'url' => $this->url, 'external' => $this->url_is_external, 'button' => $this->button);
     $output = $view->make('_shared/sidebar/header')->render($vars);
     if (!empty($this->list)) {
         $output .= $this->list->render($view);
     }
     return $output;
 }
Ejemplo n.º 7
0
 /**
  * This renders the filter into HTML.
  *
  * @uses ViewFactory::make to create a View instance
  * @uses \EllisLab\ExpressionEngine\Service\View\View::render to generate HTML
  *
  * @param ViewFactory $view A view factory responsible for making a view
  * @param URL $url A URL object for use in generating URLs for the filter
  *   options
  * @return string Returns HTML
  */
 public function render(ViewFactory $view, URL $url)
 {
     $options = $this->prepareOptions($url);
     if (empty($options)) {
         return;
     }
     $value = $this->display_value;
     if (is_null($value)) {
         $value = array_key_exists($this->value(), $this->options) ? $this->options[$this->value()] : $this->value();
     }
     if (!$this->isValid()) {
         $value = $this->default_value;
     }
     $filter = array('label' => $this->label, 'name' => $this->name, 'value' => htmlspecialchars($value, ENT_QUOTES), 'has_custom_value' => $this->has_custom_value, 'custom_value' => array_key_exists($this->name, $_POST) ? $_POST[$this->name] : FALSE, 'placeholder' => htmlspecialchars($this->placeholder, ENT_QUOTES), 'options' => $options);
     return $view->make('_shared/filters/filter')->render($filter);
 }
Ejemplo n.º 8
0
 /**
  * @see Filter::render
  *
  * Overriding the abstract class's render method in order to render a custom
  * perpage view which includes a modal for show-all
  */
 public function render(ViewFactory $view, URL $url)
 {
     $options = $this->prepareOptions($url);
     if (empty($options)) {
         return;
     }
     $value = $this->value();
     if (is_null($value)) {
         $value = array_key_exists($this->value(), $this->options) ? $this->options[$this->value()] : $this->value();
     }
     $urls = array_keys($options);
     $show_all_url = end($urls);
     $filter = array('label' => $this->label, 'name' => $this->name, 'value' => $value, 'has_custom_value' => $this->has_custom_value, 'custom_value' => array_key_exists($this->name, $_POST) ? $_POST[$this->name] : FALSE, 'placeholder' => $this->placeholder, 'options' => $options, 'show_all_url' => $show_all_url, 'confirm_show_all' => $this->confirm_show_all, 'threshold' => $this->total_threshold);
     return $view->make('_shared/filters/perpage')->render($filter);
 }