예제 #1
0
 function __construct()
 {
     parent::__construct();
     $this->load->config('validate');
     $this->load->language('validate');
     $this->js_controller_params['module'] = 'tools';
     // get localized js
     $js_localized = json_lang('validate/validate_js', FALSE);
     $this->_load_js_localized($js_localized);
     $this->_validate_user('tools/validate');
     // set pages input to blank if it is default value
     if (!empty($_POST['pages_input'])) {
         if ($_POST['pages_input'] == lang('validate_pages_input')) {
             $_POST['pages_input'] = FALSE;
         }
     }
 }
예제 #2
0
 protected function _load_js_localized($js_localized = array(), $load = TRUE)
 {
     static $localized;
     if (empty($localized)) {
         $localized = json_lang('fuel/fuel_js', FALSE);
     }
     $localized = array_merge($localized, $js_localized);
     if ($load) {
         $this->load->vars(array('js_localized' => $localized));
     }
     return $localized;
 }
예제 #3
0
    echo json_lang($js_localized);
    ?>
;
var __FUEL_LOCALIZED__ = <?php 
    echo json_lang($js_localized);
    ?>
; 
<?php 
} else {
    ?>
jqx_config.localized = <?php 
    echo json_lang('fuel/fuel_js', 'english');
    ?>
;
var __FUEL_LOCALIZED__ = <?php 
    echo json_lang('fuel/fuel_js', 'english');
    ?>
; 
<?php 
}
?>
jqx_config.editor = '<?php 
echo $this->fuel->config('text_editor');
?>
';
jqx_config.uiCookie = 'fuel_ui_<?php 
echo str_replace('fuel_', '', $this->fuel->auth->get_fuel_trigger_cookie_name());
?>
';
var __FUEL_PATH__ = '<?php 
echo site_url($this->fuel->config('fuel_path'));
예제 #4
0
 function fuelify($output)
 {
     // if not logged in then we remove the markers
     if (!$this->_CI->config->item('admin_enabled', 'fuel') or $this->variables('fuelified') === FALSE or !$this->_fuelified or empty($output) or defined('FUELIFY') and FUELIFY === FALSE) {
         return $this->remove_markers($output);
     }
     $this->_CI->load->library('session');
     // add top edit bar for fuel
     $this->_CI->config->module_load('fuel', 'fuel', TRUE);
     // render the markers to the proper html
     $output = $this->render_all_markers($output);
     // set main image and assets path before switching to fuel assets path
     $vars['init_params'] = array('assetsImgPath' => img_path(''), 'assetsPath' => assets_path(''));
     $this->_CI->asset->assets_path = $this->_CI->config->item('fuel_assets_path', 'fuel');
     $this->_CI->load->helper('ajax');
     $this->_CI->load->library('form');
     $vars['page'] = $this->properties();
     $vars['layouts'] = $this->_CI->fuel_layouts->layouts_list(TRUE);
     $editable_asset_types = $this->_CI->config->item('editable_asset_filetypes', 'fuel');
     // add javascript
     $vars['init_params']['pageId'] = !empty($vars['page']['id']) ? $vars['page']['id'] : 0;
     $vars['init_params']['basePath'] = WEB_PATH;
     $vars['init_params']['imgPath'] = img_path('', 'fuel');
     $vars['init_params']['cssPath'] = css_path('', 'fuel');
     $vars['init_params']['jsPath'] = js_path('', 'fuel');
     $vars['init_params']['editor'] = $this->_CI->config->item('text_editor', 'fuel');
     $vars['init_params']['editorConfig'] = $this->_CI->config->item('ck_editor_settings', 'fuel');
     // load language files
     $this->_CI->load->module_language(FUEL_FOLDER, 'fuel_inline_edit');
     $this->_CI->load->module_language(FUEL_FOLDER, 'fuel_js');
     // json localization
     $vars['js_localized'] = json_lang('fuel/fuel_js');
     $vars['assetsAccept']['assetsAccept'] = !empty($editable_asset_types['media']) ? $editable_asset_types['media'] : 'jpg|gif|png';
     // database specific... so we must check the fuel mode to see if we actually need to make a call to the database.
     // otherwise we get an error when the mode is set to views
     if ($this->_CI->config->item('fuel_mode', 'fuel') == 'views') {
         $vars['others'] = array();
     } else {
         $this->_CI->load->module_model(FUEL_FOLDER, 'pages_model');
         $vars['others'] = $this->_CI->pages_model->get_others('location', $this->location, 'location');
     }
     if (!$this->_fuelified_processed) {
         $inline_edit_bar = $this->_CI->load->module_view(FUEL_FOLDER, '_blocks/inline_edit_bar', $vars, TRUE);
         $output = preg_replace('#(</head>)#i', css('fuel_inline', 'fuel') . "\n\$1", $output);
         $output = preg_replace('#(</body>)#i', $inline_edit_bar . "\n\$1", $output);
         $this->_CI->config->set_item('assets_path', $this->_CI->config->item('assets_path'));
     }
     $this->_fuelified_processed = TRUE;
     return $output;
 }
예제 #5
0
?>
; 
jqx_config.cacheString = new Date('<?php 
echo date('F d, Y H:i:s', strtotime($this->config->item('last_updated')));
?>
').getTime().toString();
jqx_config.assetsAccept = '<?php 
$editable_asset_types = $this->config->item('editable_asset_filetypes', 'fuel');
echo !empty($editable_asset_types['media']) ? $editable_asset_types['media'] : 'jpg|gif|png';
?>
';
<?php 
if (!empty($js_localized)) {
    ?>
jqx_config.localized = <?php 
    echo json_lang($js_localized);
    ?>
;
<?php 
}
?>
jqx_config.editor = '<?php 
echo $this->config->item('text_editor', 'fuel');
?>
';
jqx_config.ckeditorConfig = <?php 
echo json_encode($this->config->item('ck_editor_settings', 'fuel'));
?>
;

var __FUEL_PATH__ = '<?php 
예제 #6
0
 /**
  * Returns the inline editing toolbar HTML
  *
  * @access	public
  * @return	void
  */
 public function toolbar()
 {
     $user_lang = $this->fuel->auth->user_lang();
     $this->fuel->load_language('fuel_inline_edit', $user_lang);
     $this->fuel->load_language('fuel_js', $user_lang);
     $vars['page'] = $this->fuel->page->properties();
     $vars['layouts'] = $this->fuel->layouts->options_list();
     $vars['language'] = $this->fuel->language->detect();
     $vars['language_mode'] = $this->fuel->language->mode();
     $vars['language_default'] = $this->fuel->language->default_option();
     $vars['tools'] = $this->toolbar_tools();
     $vars['js_localized'] = json_lang('fuel/fuel_js', $user_lang);
     $vars['is_fuelified'] = is_fuelified();
     $vars['can_edit_pages'] = $this->CI->fuel->auth->has_permission('pages', 'edit');
     if ($this->fuel->pages->mode() == 'views') {
         $vars['others'] = array();
     } else {
         $location = uri_path();
         $this->CI->load->module_model(FUEL_FOLDER, 'fuel_pages_model');
         $vars['others'] = $this->CI->fuel_pages_model->get_others('location', $location, 'location');
     }
     $vars['init_params']['pageId'] = !empty($vars['page']['id']) ? $vars['page']['id'] : 0;
     $vars['init_params']['pageLocation'] = !empty($vars['page']['location']) ? $vars['page']['location'] : uri_path();
     $vars['init_params']['basePath'] = WEB_PATH;
     $vars['init_params']['cookiePath'] = $this->CI->fuel->config('fuel_cookie_path');
     $vars['init_params']['imgPath'] = img_path('', 'fuel');
     $vars['init_params']['cssPath'] = css_path('', 'fuel');
     $vars['init_params']['jsPath'] = js_path('', 'fuel');
     $vars['init_params']['editor'] = $this->fuel->config('text_editor');
     $vars['init_params']['editorConfig'] = $this->fuel->config('ck_editor_settings');
     $last_page = uri_path();
     if (empty($last_page)) {
         $last_page = $this->fuel->config('default_home_view');
     }
     $vars['last_page'] = uri_safe_encode($last_page);
     $output = $this->CI->load->module_view(FUEL_FOLDER, '_blocks/inline_edit_bar', $vars, TRUE);
     return $output;
 }