예제 #1
0
 function publish()
 {
     if ($this->ADMIN_CONF['publish']['publish_method'] == 'local_table') {
         $data = '<div class="content_header"><h2>Publish</h2></div>' . '<p>Your publish configuration is set to "Local Table" mode. This means publishes are immediate and this script is not needed.</p>';
         $this->layout->show($data);
         return;
     }
     $data = '<div class="content_header"><h2>PUBLISH</h2></div>' . '<iframe src="' . zonepath('scripts/db_publish.php?verbose=1') . '" style="background-color: #fff; width: 680px; height: 400px;">' . '</iframe>';
     $this->layout->show($data);
 }
예제 #2
0
 public function _getXSL($xsl_file = null)
 {
     // Error checking
     if (is_null($xsl_file) || empty($xsl_file)) {
         show_error('Could not create page. XSL template missing from transformation request.');
     }
     $server_path = DOCROOT . zonepath($xsl_file);
     if (!file_exists($server_path)) {
         show_error('Unable to display page, template not found (' . $xsl_file . ').');
     }
     return $server_path;
 }
예제 #3
0
 public function clearTmpFiles()
 {
     $FILE_CONF = CI()->loadConfig('file');
     $directory = DOCROOT . zonepath($FILE_CONF['file_directory'] . '/' . $FILE_CONF['temp_folder'] . '/');
     if (!@is_dir($directory)) {
         show_error('Directory not found.<br/><em>Path: ' . $directory . '</em>');
     }
     $rm_result = shell_exec('rm -fv ' . $directory . '*.jpg');
     $rm_result .= shell_exec('rm -fv ' . $directory . '*.gif');
     $rm_result .= shell_exec('rm -fv ' . $directory . '*.png');
     return $rm_result;
 }
예제 #4
0
 function __construct()
 {
     parent::__construct();
     $this->FILE_CONF = $this->loadConfig('file');
     ini_set('auto_detect_line_endings', 1);
     $this->upload_path = DOCROOT . zonepath($this->FILE_CONF['file_directory'], 'local') . '/' . $this->FILE_CONF['temp_folder'] . '/';
     // Required models
     $this->load->model('page_model');
     $this->load->model('page_attributejoin_model');
     $this->load->model('page_attributevalue_model');
     $this->load->model('template_model');
     //error_reporting(E_ALL);
 }
예제 #5
0
 public function __construct($config = array())
 {
     $this->config = $config;
     if (isset($config['assets']['add_app_path'])) {
         $this->add_app_path = $config['assets']['add_app_path'];
     }
     // TODO: This should not be in site conf
     $this->cache_location = zonepath($config['assets']['cache_directory']);
     $this->_sets = $config['asset_sets'];
     // Create holders for all the asset types
     foreach ($this->allowed_types as $type) {
         $this->_assets[$type] = array();
     }
 }
예제 #6
0
 public function clearAssetCache($type = 'all', $zone = null)
 {
     $directory = DOCROOT . zonepath('cache/', $zone);
     if (!@is_dir($directory)) {
         show_error('Directory not found.<br/><em>Path: ' . $directory . '</em>');
     }
     switch ($type) {
         case 'js':
             $file = 'asset_js_*.js';
             break;
         case 'css':
             $file = 'asset_css_*.css';
             break;
         default:
             $file = 'asset_*';
             break;
     }
     return shell_exec('rm -fv ' . $directory . $file);
 }
예제 #7
0
 public function __construct($config = array())
 {
     if (isset($config['assets']['cache_buster'])) {
         $this->cache_buster = $config['assets']['cache_buster'];
     }
     if (isset($config['assets']['add_app_path'])) {
         $this->add_app_path = $config['assets']['add_app_path'];
     }
     if (isset($config['assets']['compression_enabled']) && $config['assets']['compression_enabled'] === TRUE) {
         $this->compress_assets = TRUE;
     }
     if (CI()->input->get('compression_enabled') == 'FALSE') {
         $this->compress_assets = FALSE;
     }
     $this->cache_location = zonepath($config['assets']['cache_directory']);
     $this->_sets = $config['asset_sets'];
     // Create holders for all the asset types
     foreach ($this->allowed_types as $type) {
         $this->_assets[$type] = array();
     }
 }
예제 #8
0
 public function getAdminLogo()
 {
     if (!empty($this->ADMIN_CONF['theme']['header_image'])) {
         return '<img src="' . zonepath($this->ADMIN_CONF['theme']['header_image']) . '"/>';
     } else {
         return '<div class="logo_text">' . $this->ADMIN_CONF['site_title'] . '</div>';
     }
 }
예제 #9
0
 public function update($fields = array())
 {
     $row = parent::update($fields);
     if (empty($row['ext'])) {
         $sub = $this->getById($row[$this->id_field]);
         $row = $sub[0];
     }
     $var_length = (int) $this->FILE_CONF['file_dir_depth'] * 3;
     $path_array = str_split(str_pad($row[$this->id_field], $var_length, '0', STR_PAD_LEFT), 3);
     $upload_path = implode('/', $path_array);
     // Add file paths
     $row['server_path'] = DOCROOT . zonepath($this->FILE_CONF['file_directory'], 'local') . '/' . $upload_path . $row['ext'];
     $row['app_path'] = $upload_path . $row['ext'];
     // Queue file for publish
     //CI()->load->model('publish_queue_model');
     //CI()->publish_queue_model->publish($this->table, $row[$this->id_field], $row);
     return $row;
 }
예제 #10
0
 public function update($fields = array())
 {
     if (!empty($fields['file_name'])) {
         $fields['file_name'] = strtolower(preg_replace("/[^a-z\\-_\\d]/i", "", underscore($fields['file_name'])));
     }
     $row = parent::update($fields);
     if (empty($row['ext'])) {
         $sub = $this->getById($row[$this->id_field]);
         $row = $sub[0];
     }
     $var_length = (int) $this->FILE_CONF['file_dir_depth'] * 3;
     $path_array = str_split(str_pad($row[$this->id_field], $var_length, '0', STR_PAD_LEFT), 3);
     $upload_path = implode('/', $path_array);
     // Add file paths
     $row['server_path'] = DOCROOT . zonepath($this->FILE_CONF['file_directory'], 'local') . '/' . $upload_path . $row['ext'];
     $row['app_path'] = $upload_path . $row['ext'];
     if ($this->ADMIN_CONF['publish']['publish_method'] != 'local_table') {
         // Queue file for publish
         CI()->load->model('publish_queue_model');
         CI()->publish_queue_model->publish($this->table, $row[$this->id_field], $row);
     }
     return $row;
 }