/**
  * Check whether to render certain kinds of extra additions to the view for a displayed gallery
  * @param object $displayed_gallery
  * @param string $template_id
  * @param C_MVC_View_Element $root_element
  * @param string $addition_type what kind of addition is being made 'layout', 'decoration', 'style', 'logic' etc.
  * @return string|NULL
  */
 function _check_addition_rendering($displayed_gallery, $template_id, $root_element, $addition_type)
 {
     $view = $root_element->get_object();
     $mode = $view->get_param('render_mode');
     $ret = true;
     switch ($addition_type) {
         case 'layout':
             $ret = !in_array($mode, array('bare', 'basic'));
             break;
         case 'decoration':
             break;
         case 'style':
             break;
         case 'logic':
             break;
     }
     return $ret;
 }
Exemple #2
0
 function start_element($id, $type = null, $context = null)
 {
     if ($type == null) {
         $type = 'element';
     }
     $count = count($this->object->_queue);
     $element = new C_MVC_View_Element($id, $type);
     if ($context != null) {
         if (!is_array($context)) {
             $context = array('object' => $context);
         }
         foreach ($context as $context_name => $context_value) {
             $element->set_context($context_name, $context_value);
         }
     }
     $this->object->_queue[] = $element;
     if ($count > 0) {
         $old_element = $this->object->_queue[$count - 1];
         $content = ob_get_contents();
         ob_clean();
         $old_element->append($content);
         $old_element->append($element);
     }
     ob_start();
     return $element;
 }