コード例 #1
0
 /**
  * Define the enclosing tag.
  * Make the <ion:fancyupload /> tag available as parent tag
  *
  * @usage	<ion:fancyupload type="photoqueue" />
  *			type : 	"photoqueue" : 	Simple file queue uploader
  *					"complete" : 		Complete Fancyupload
  *
  */
 public static function index(FTL_Binding $tag)
 {
     // Get the module URI
     include APPPATH . 'config/modules.php';
     $uri = array_search('Fancyupload', $modules);
     $tag->expand();
     return $tag->parse_as_nested(file_get_contents(MODPATH . 'Fancyupload/views/fancyupload_' . config_item('fancyupload_type') . EXT));
 }
コード例 #2
0
 /**
  * Search form tag
  * 
  * Returns the search form view
  *
  * @usage	<ion:searchform />
  *
  */
 public static function searchform(FTL_Binding $tag)
 {
     $CI =& get_instance();
     $searchForm_action = isset($tag->attr['result_page']) ? $tag->attr['result_page'] : '';
     $tag->locals->result_page = $searchForm_action;
     // If the realm data was posted, the form will not be displayed
     // Useful when results should be displayed on the same page as the search form
     if ($realm = $CI->input->post('realm')) {
         return '';
     } else {
         $tag->expand();
         // the tag returns the content of this view :
         return $tag->parse_as_nested(file_get_contents(MODPATH . 'Search/views/search_form' . EXT));
     }
 }
コード例 #3
0
ファイル: Page.php プロジェクト: pompalini/emngo
 /**
  * Find and parses the page view
  *
  * @param 	FTL_Binding
  * @param   array
  *
  * @return string
  *
  */
 private static function find_and_parse_page_view(FTL_Binding $tag, $page)
 {
     // Default page view
     if (empty($page['view'])) {
         $page['view'] = Theme::get_default_view('page');
     }
     // View path
     $view_path = Theme::get_theme_path() . 'views/' . $page['view'] . EXT;
     // Return the Ionize default's theme view
     if (!file_exists($view_path)) {
         $view_path = Theme::get_theme_path() . 'views/' . Theme::get_default_view('page') . EXT;
         if (!file_exists($view_path)) {
             $view_path = APPPATH . 'views/' . Theme::get_default_view('page') . EXT;
         }
     }
     return $tag->parse_as_nested(file_get_contents($view_path));
 }
コード例 #4
0
ファイル: Tagmanager.php プロジェクト: pompalini/emngo
 /**
  * Loads a partial view from a FTL tag
  * Callback function linked to the tag <ion:partial />
  *
  * @param	FTL_Binding
  * @return 	string
  *
  */
 public static function tag_partial(FTL_Binding $tag)
 {
     // Set this tag as "process tag"
     $tag->setAsProcessTag();
     $view = $tag->getAttribute('view');
     // Compatibility reason
     if (is_null($view)) {
         $tag->getAttribute('path');
     }
     if (!is_null($view)) {
         $attributes = $tag->getAttributes();
         foreach ($attributes as $key => $value) {
             self::register($key, $value, 'attr');
         }
         if ($tag->getAttribute('php') == TRUE) {
             $data = $tag->getAttribute('data', array());
             return self::$ci->load->view($view, $data, TRUE);
         } else {
             $file = Theme::load($view);
             return $tag->parse_as_nested($file);
         }
     } else {
         show_error('TagManager : Please use the attribute <b>"view"</b> when using the tag <b>partial</b>');
     }
 }
コード例 #5
0
ファイル: search_tags.php プロジェクト: pompalini/emngo
 /**
  * Display the results view
  *
  * @usage	<ion:search:display />
  *
  */
 public static function tag_search_display(FTL_Binding $tag)
 {
     $tag->expand();
     // the tag returns the content of this view :
     return $tag->parse_as_nested(file_get_contents(MODPATH . 'Search/views/search_result' . EXT));
 }
コード例 #6
0
ファイル: tags.php プロジェクト: nbourguig/ionize
 /**
  * Print simpleform
  *
  * @access	public
  * @return	parsed view
  */
 public static function simple_form(FTL_Binding $tag)
 {
     return $tag->parse_as_nested(file_get_contents(MODPATH . 'Simpleform/views/form_view' . EXT));
 }
コード例 #7
0
ファイル: Article.php プロジェクト: pompalini/emngo
 /**
  * Find and parses the article view
  *
  * @param 	FTL_Binding
  * @param   array
  *
  * @return string
  *
  */
 private static function find_and_parse_article_view(FTL_Binding $tag, $article)
 {
     // Registered page
     $page = self::registry('page');
     // Local articles
     $articles = $tag->get('articles');
     // Try to get the view defined for article
     $tag_view = $tag->getAttribute('view');
     $article_view = !is_null($tag_view) ? $tag_view : (!empty($article['view']) ? $article['view'] : NULL);
     if (!is_null($article_view)) {
         // Force first the view defined by the tag
         if (!is_null($tag_view)) {
             $article['view'] = $tag_view;
         } else {
             if (count($articles) == 1) {
                 $article['view'] = $page['article_view'];
             } else {
                 $article['view'] = $page['article_list_view'];
             }
         }
     }
     // Default article view
     if (empty($article['view'])) {
         $article['view'] = Theme::get_default_view('article');
     }
     // View path
     $view_path = Theme::get_theme_path() . 'views/' . $article['view'] . EXT;
     // Return the Ionize default's theme view
     if (!file_exists($view_path)) {
         $view_path = Theme::get_theme_path() . 'views/' . Theme::get_default_view('article') . EXT;
         if (!file_exists($view_path)) {
             $view_path = APPPATH . 'views/' . Theme::get_default_view('article') . EXT;
         }
     }
     return $tag->parse_as_nested(file_get_contents($view_path));
 }
コード例 #8
0
 public static function comment_form(FTL_Binding $tag)
 {
     // the tag returns the content of this view :
     return $tag->parse_as_nested(file_get_contents(MODPATH . 'Comments/views/comment_form' . EXT));
 }