Exemple #1
0
 /**
  * @param int    $page
  * @param int    $numpages
  * @param string $url_template
  *
  * @return string
  */
 static function run($page, $numpages, $tpl)
 {
     if ($numpages < 2) {
         return '';
     }
     self::$url_template = $tpl;
     self::$current = $page;
     ob_start();
     if (IO_FS::exists(self::$template)) {
         include self::$template;
     } else {
         include CMS::view('page-navigator.phtml');
     }
     $out = ob_get_clean();
     return $out;
 }
Exemple #2
0
 /**
  * @param string $access
  *
  * @return string
  */
 static function admin_menu($access = 'full')
 {
     if (!CMS::$globals[$access]) {
         return '';
     }
     ob_start();
     $tpl = self::$admin_menu_tpl . '.phtml';
     if (IO_FS::exists("../app/views/{$tpl}")) {
         include "../app/views/{$tpl}";
     } else {
         include CMS::view("{$tpl}");
     }
     $content = ob_get_clean();
     return $content;
 }
Exemple #3
0
 protected function field_template_path($name)
 {
     $f = "{$name}.phtml";
     if (file_exists($f)) {
         return $f;
     }
     $f = CMS::app_view("admin/table/fields/{$name}.phtml");
     if (file_exists($f)) {
         return $f;
     }
     $f = CMS::view("admin/table/fields/{$name}.phtml");
     if (file_exists($f)) {
         return $f;
     }
     return CMS::view('admin/table/fields/input.phtml');
 }
Exemple #4
0
 public function draw($template = 'simple', $parms = array())
 {
     //var_dump($this);
     $this->links = $this->sub();
     if (!$this->links) {
         $this->links = new ArrayObject();
     }
     ob_start();
     $filename1 = CMS_Navigation2::$tpl_path . "/{$template}.phtml";
     $filename2 = CMS::view("navigation/{$template}.phtml");
     if (IO_FS::exists($filename1)) {
         include $filename1;
     } else {
         if (IO_FS::exists($filename2)) {
             include $filename2;
         }
     }
     return ob_get_clean();
 }
Exemple #5
0
 public function generate()
 {
     $tree = $this->data;
     ob_start();
     include CMS::view('admin/table/layout-tree.phtml');
     $rc = ob_get_contents();
     ob_end_clean();
     return $rc;
 }
Exemple #6
0
 public function draw($template = 'simple', $parms = array())
 {
     ob_start();
     $filename1 = CMS_Navigation3::$tpl_path . "/{$template}.phtml";
     $filename2 = CMS::view("navigation/{$template}.phtml");
     if (IO_FS::exists($filename1)) {
         include $filename1;
     } else {
         if (IO_FS::exists($filename2)) {
             include $filename2;
         }
     }
     return ob_get_clean();
 }
Exemple #7
0
 static function tpl($tpl)
 {
     $t = CMS::app_view("insertions/{$tpl}.phtml");
     if (IO_FS::exists($t)) {
         return $t;
     }
     return CMS::view("insertions/{$tpl}.phtml");
 }
Exemple #8
0
 /**
  * @param string $field
  * @param string $page
  */
 public function jsprotect($field, $page = '')
 {
     $keystring = self::key($page);
     ob_start();
     if (IO_FS::exists('../app/views/jsprotect.phtml')) {
         include '../app/views/jsprotect.phtml';
     } else {
         include CMS::view('jsprotect.phtml');
     }
     $content = ob_get_clean();
     return $content;
 }