コード例 #1
0
ファイル: style.php プロジェクト: 119155012/kals
 public function custom($json)
 {
     $output = '';
     $data = json_decode($json, TRUE);
     foreach ($data as $d) {
         $selector = $d['selector'];
         $rule = $d['rule'];
         $rule = $this->_create_rule($selector, $rule);
         $output = $output . $rule;
     }
     send_css_header($this->output);
     $this->load->view('web_apps/display', array('data' => $output));
 }
コード例 #2
0
 /**
  * 舊的pack css程式
  * 不應該使用,這只是測試用的
  * 
  * @deprecated 20130219
  * @param string $path
  * @param string $path2
  * @return null 直接輸出到view了
  */
 function _20130219_pack_css($path, $path2 = NULL)
 {
     if (isset($path2)) {
         $path .= '/' . $path2;
     }
     $path .= '.css';
     if (FALSE === starts_with($path, 'style/')) {
         $path = 'style/' . $path;
     }
     $style = $this->load->view($this->dir . $path, NULL, TRUE);
     if ($this->config->item('output.package.enable')) {
         $style = $this->_compress_css($style);
         /**
          * 不使用YUI的CSS壓縮
          * @version 201302201 Pudding Chen
          */
         //$style = $this->_yui_compression_css($style);
     }
     //取代網址
     //$base_url = base_url();
     $base_url = get_kals_base_url();
     $style = str_replace('${base_url}', $base_url, $style);
     send_css_header($this->output);
     $this->load->view($this->dir . 'display', array('data' => $style));
 }
コード例 #3
0
 function pack_css($path, $path2 = NULL)
 {
     if (isset($path2)) {
         $path .= '/' . $path2;
     }
     $path .= '.css';
     if (FALSE === starts_with($path, 'style/')) {
         $path = 'style/' . $path;
     }
     $style = $this->load->view('web_apps/' . $path, NULL, TRUE);
     $style = $this->_compress_css($style);
     //取代網址
     //$base_url = base_url();
     $base_url = get_kals_base_url();
     $style = str_replace('${base_url}', $base_url, $style);
     send_css_header($this->output);
     $this->load->view('web_apps/display', array('data' => $style));
 }
コード例 #4
0
ファイル: generic.php プロジェクト: 119155012/kals
 function load_css_release($path, $path2 = NULL)
 {
     if (isset($path2)) {
         $path .= '/' . $path2;
     }
     $path .= '.css';
     if (FALSE === starts_with($path, 'style/')) {
         $path = 'style/' . $path;
     }
     $file_path = './system/application/views/' . $this->dir . $path;
     //test_msg($file_path, is_file($file_path));
     if (is_file($file_path) == FALSE) {
         return;
     }
     $style = $this->load->view($this->dir . $path, NULL, TRUE);
     //取代網址
     //$base_url = base_url();
     //$base_url = trim($base_url);
     //$style = str_replace('${base_url}', $base_url, $style);
     $style = $this->_css_replace_base_url($style);
     send_css_header($this->output);
     $this->load->view($this->release_dir . 'display', array('data' => $style));
 }