function __construct($validate = TRUE)
 {
     parent::__construct();
     // load all the helpers we need
     $this->load->library('form');
     $this->load->helper('convert');
     $this->load->helper('ajax');
     $this->load->helper('cookie');
     $this->load->helper('inflector');
     //$this->load->helper('string'); already loaded in autoload
     $this->load->helper('text');
     // load main fuel config
     $this->load->module_config(FUEL_FOLDER, 'fuel', TRUE);
     // load the authentication library
     $this->load->module_library(FUEL_FOLDER, 'fuel_auth');
     // set the language based on first the users profile and then what is in the config... (FYI... fuel_auth is loaded in the hooks)
     $language = $this->fuel_auth->user_data('language');
     // in case the language field doesn't exist... due to older fersions'
     if (empty($language) or !is_string($language)) {
         $language = $this->config->item('language');
     }
     // load this language file first because fuel_modules needs it
     $this->load->module_language(FUEL_FOLDER, 'fuel', $language);
     // now load the other languages
     $this->_load_languages();
     // now load the fuel modules information
     $this->load->module_library(FUEL_FOLDER, 'fuel_modules');
     // load assets
     $this->config->load('asset');
     // load fuel helper
     $this->load->module_helper(FUEL_FOLDER, 'fuel');
     // check any remote host or IP restrictions first
     if (!$this->config->item('admin_enabled', 'fuel') or $this->config->item('restrict_to_remote_ip', 'fuel') and !in_array($_SERVER['REMOTE_ADDR'], $this->config->item('restrict_to_remote_ip', 'fuel'))) {
         show_404();
     }
     // set asset output settings
     $this->asset->assets_output = $this->config->item('fuel_assets_output', 'fuel');
     if ($validate) {
         $this->_check_login();
     }
     $this->load->model(FUEL_FOLDER . '/logs_model');
     $this->load->helpers(array('ajax', 'date'));
     // set up default variables
     $load_vars = array('js' => '', 'css' => $this->_load_css(), 'js_controller_params' => array(), 'keyboard_shortcuts' => $this->config->item('keyboard_shortcuts', 'fuel'), 'nav' => $this->_nav(), 'modules_allowed' => $this->config->item('modules_allowed', 'fuel'), 'page_title' => $this->_page_title());
     if ($validate) {
         $load_vars['user'] = $this->fuel_auth->user_data();
         $load_vars['session_key'] = $this->fuel_auth->get_session_namespace();
     }
     $this->js_controller_path = js_path('', FUEL_FOLDER);
     $this->load->vars($load_vars);
     $this->_load_js_localized();
     // set asset paths
     //$this->asset->assets_module = FUEL_FOLDER;
     $this->asset->assets_folders = array('images' => 'images/', 'css' => 'css/', 'js' => 'js/');
     $this->_last_page();
 }
Example #2
0
 /**
  *	add_news.
  *
  *	Displays a default list of news articles. The nbumber of articles displayed is managed via
  *	the news.default_article_count setting.
  *
  *	@return					<void>	This function outputs to the Template::render() function
  *
  */
 public function add_news()
 {
     $settings = $this->_settings;
     if ($this->input->post('submit')) {
         $this->load->module('news/content');
         $uploadData = array();
         $upload = true;
         if (isset($_FILES['attachment']) && is_array($_FILES['attachment']) && $_FILES['attachment']['error'] != 4) {
             $uploadData = $this->content->handle_upload();
             if (isset($uploadData['error']) && !empty($uploadData['error'])) {
                 $upload = false;
             }
         }
         if (count($uploadData) > 0 && $upload || count($uploadData) == 0 && $upload) {
             if ($id = $this->content->save_article($uploadData)) {
                 $article = $this->news_model->find($id);
                 $this->load->model('activities/activity_model');
                 $this->activity_model->log_activity($this->current_user->id, 'Created Article: ' . $article->id, 'news');
                 Template::set_message('Article successfully submitted. It will be reviewed by the news moderator.', 'success');
                 Template::set_view('index');
                 Template::render();
             } else {
                 Template::set_message('There was a problem creating the article: ' . $this->news_model->error);
             }
         } else {
             Template::set_message('There was a problem saving the file attachment: ' . $uploadData['error']);
         }
     }
     if ($settings['news.public_submissions'] == 1) {
         $showForm = true;
         if ($settings['news.public_submitters'] == 1) {
             $cookie = unserialize($this->input->cookie($this->config->item('sess_cookie_name')));
             $showForm = isset($cookie['logged_in']);
             $error = 'You must be <a href="' . site_url('/login/') . '">logged in</a> to post news to this site.';
             unset($cookie);
         }
         if ($showForm) {
             $this->load->helper('form');
             Assets::add_css(array(Template::theme_url('js/editors/markitup/skins/markitup/style.css'), Template::theme_url('js/editors/markitup/sets/default/style.css'), css_path() . 'chosen.css', css_path() . 'bootstrap-datepicker.css'));
             Assets::add_js(array(Template::theme_url('js/editors/markitup/jquery.markitup.js'), Template::theme_url('js/editors/markitup/sets/default/set.js'), js_path() . 'chosen.jquery.min.js', js_path() . 'bootstrap-datepicker.js'));
             Template::set('public', true);
             Template::set('settings', $settings);
             Template::set('toolbar_title', lang('us_create_news'));
             Template::set_view('content/news_form');
             Template::render();
         } else {
             show_error($error, 501, 'Form Access Error');
         }
     } else {
         show_error('<h2>Sorry</h2><br />Public news submissions are not currently available.<br /><a href="' . site_url() . '">Return to the site</a>.', 501, 'Public News Submission not available');
     }
 }
Example #3
0
 /**
  * Checks Auth Permissions and setups all java-scripts and other stuff
  *
  * @property CI_Pagination $pagination
  * @property MY_Model      $my_model
  * @property news_model    $news_model
  * @property author_model  $author_model
  *
  * @return   void
  */
 public function __construct()
 {
     parent::__construct();
     $this->auth->restrict('News.Content.View');
     $this->load->model('news/news_model');
     $this->load->model('news/author_model');
     $this->load->helper('news');
     $this->lang->load('news');
     $this->load->helper('author');
     $this->load->library('pagination');
     $this->_settings = $this->settings_model->select('name,value')->find_all_by('module', 'news');
     Assets::add_css(array(Template::theme_url('js/editors/markitup/skins/markitup/style.css'), Template::theme_url('js/editors/markitup/sets/default/style.css'), css_path() . 'chosen.css', css_path() . 'bootstrap-datepicker.css'));
     Assets::add_js(array(Template::theme_url('js/editors/markitup/jquery.markitup.js'), Template::theme_url('js/editors/markitup/sets/default/set.js'), js_path() . 'chosen.jquery.min.js', js_path() . 'bootstrap-datepicker.js'));
     $the_path = $this->_settings['news.upload_dir_path'];
     $this->_news_dir = realpath($the_path);
     if (!is_dir($this->_news_dir) && !is_writeable($this->_news_dir)) {
         Template::set_message('Attachment Upload Directory is not write-able: ' . $this->_news_dir, 'error');
         log_message('error', 'Attachment Upload Directory is not write-able: ' . $this->_news_dir);
     }
     Template::set_block('sub_nav', 'content/_sub_nav');
 }
Example #4
0
<meta http-equiv= 'pragma' content='no-cache' />
<meta name='robots' content='all' />

</head>
<body>

<br clear="all" />


<!-- START CONTENT -->
<div id="content">

<?php 
echo $body;
?>

</div>
<!-- END CONTENT -->


<script language="javascript">
SyntaxHighlighter.config['clipboardSwf'] = '<?php 
echo js_path('clipboard.swf', 'user_guide');
?>
';
SyntaxHighlighter.defaults['gutter'] = false;
SyntaxHighlighter.all();
</script>

</body>
</html>
Example #5
0
 /**
  * Retrieve the info for a module
  *
  * @access	public
  * @param	string	module name (optional)
  * @return	array
  */
 public function info($prop = NULL)
 {
     if (empty($this->_init)) {
         $inits = Fuel_modules::get_all_module_configs();
         if (isset($inits[$this->module])) {
             $this->_init = $inits[$this->module];
         }
     }
     if (empty($this->_info)) {
         $this->CI->load->helper('inflector');
         $this->CI->load->helper('string');
         $defaults = array('module_name' => humanize($this->module), 'module_uri' => $this->module, 'model_name' => $this->module . '_model', 'model_location' => '', 'view_location' => '', 'display_field' => '', 'preview_path' => '', 'views' => array('list' => 'modules/module_list', 'create_edit' => 'modules/module_create_edit', 'delete' => 'modules/module_delete'), 'permission' => array($this->module, 'create', 'edit', 'publish', 'delete', 'export'), 'js_controller' => 'fuel.controller.BaseFuelController', 'js_controller_path' => '', 'js_controller_params' => array(), 'js_localized' => array(), 'js' => '', 'edit_method' => 'find_one_array', 'instructions' => lang('module_instructions_default', strtolower(humanize($this->module))), 'filters' => array(), 'archivable' => TRUE, 'table_headers' => array(), 'table_actions' => array('EDIT', 'VIEW', 'DELETE'), 'item_actions' => array('save', 'view', 'publish', 'activate', 'delete', 'duplicate', 'replace', 'create'), 'list_actions' => array(), 'rows_selectable' => TRUE, 'precedence_col' => 'precedence', 'clear_cache_on_save' => TRUE, 'create_action_name' => lang('btn_create'), 'configuration' => '', 'nav_selected' => NULL, 'default_col' => NULL, 'default_order' => NULL, 'sanitize_input' => TRUE, 'sanitize_files' => FALSE, 'displayonly' => FALSE, 'language' => '', 'language_col' => 'language', 'hidden' => FALSE, 'disabled' => FALSE, 'icon_class' => '', 'folder' => '', 'exportable' => FALSE, 'limit_options' => array('50' => '50', '100' => '100', '200' => '200'), 'advanced_search' => FALSE, 'disable_heading_sort' => FALSE, 'description' => '', 'search_field' => '', 'pages' => array());
         $info = array();
         foreach ($defaults as $key => $val) {
             if (isset($this->_init[$key])) {
                 $info[$key] = $this->_init[$key];
             } else {
                 $info[$key] = $val;
             }
         }
         // icon class for module
         if (empty($info['icon_class'])) {
             $info['icon_class'] = 'ico_' . url_title(str_replace('/', '_', $info['module_uri']), '_', TRUE);
         }
         // localize certain fields
         if (empty($info['module_name']) and $module_name = lang('module_' . $this->module)) {
             $info['module_name'] = $module_name;
         }
         // set proper jqxController name
         if (is_array($info['js_controller'])) {
             if (empty($info['js_controller_path'])) {
                 $info['js_controller_path'] = js_path('', key($info['js_controller']));
             }
             $info['js_controller'] = current($info['js_controller']);
         } else {
             if (is_string($info['js_controller']) and strpos($info['js_controller'], '.') === FALSE) {
                 //$info['js_controller'] = 'fuel.controller.'.$info['js_controller'];
                 $info['js_controller'] = $info['js_controller'];
             }
         }
         // convert slashes to jqx object periods
         $info['js_controller'] = str_replace('/', '.', $info['js_controller']);
         // set the base path to the controller file if still empty
         if (empty($info['js_controller_path'])) {
             $info['js_controller_path'] = js_path('', FUEL_FOLDER);
         }
         if ($create_action_name = lang('module_' . $this->module . '_create')) {
             $info['create_action_name'] = $create_action_name;
         }
         $this->_info = $info;
         // must be done after the above
         if (empty($this->_info['display_field'])) {
             $fields = $this->model()->fields();
             // loop through the fields and find the first column that doesn't have id or _id at the end of it
             for ($i = 1; $i < count($fields); $i++) {
                 if (substr($fields[$i], -3) != '_id') {
                     $this->_info['display_field'] = $fields[$i];
                     break;
                 }
             }
             if (empty($this->_info['display_field'])) {
                 $this->_info['display_field'] = $fields[1];
             }
             // usually the second field is the display_field... first is the id
         }
     }
     if (empty($prop)) {
         return $this->_info;
     } else {
         if (isset($this->_info[$prop])) {
             return $this->_info[$prop];
         } else {
             return FALSE;
         }
     }
 }
 function theme_js_path($asset_name)
 {
     return js_path($asset_name, '_theme_');
 }
Example #7
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['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 = str_replace('</head>', css('fuel_inline', 'fuel') . "\n</head>", $output);
         $output = str_replace('</body>', $inline_edit_bar . "\n</body>", $output);
         $this->_CI->config->set_item('assets_path', $this->_CI->config->item('assets_path'));
     }
     $this->_fuelified_processed = TRUE;
     return $output;
 }
Example #8
0
" content="<?php 
                echo $value;
                ?>
" />
<?php 
            }
        }
    }
}
/**
 * Check if Gumroad is enabled and if it is then add the Gumroad script
 */
function site_enable_purchase()
{
    if (!DISABLE_GUMROAD) {
        site_script('https://gumroad.com/js/gumroad.js', true);
    }
}
// Set Defaults
// default site description
site_description('Designing <strong>Professional WordPress Themes</strong> since 2007.');
// default site title
site_title('Pro Theme Design - WordPress Themes and Plugins');
// default site page header title
site_header_title('Pro Theme Design');
// default site og:type
site_meta('og:type', 'website');
// default site scripts
site_script('https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js');
site_script(js_path('main.min.js'));
Example #9
0
<link rel="stylesheet" href="<?php 
echo css_path();
?>
jquery/jquery-ui-1.9.2.custom.min.css">
<script src="<?php 
echo js_path();
?>
jquery-ui-1.9.2.custom.min.js"></script>
    <meta charset="UTF-8">        
    <style>
		.ui-autocomplete { position: absolute; cursor: default; }	
        .ui-autocomplete-loading { background: white url('<?php 
echo base_url();
?>
assets/images/ui-anim_basic_16x16.gif') right center no-repeat; }
    </style>
<link rel="stylesheet" href="<?php 
echo base_url();
?>
assets/css/chosen.css" />

<?php 
if (validation_errors()) {
    ?>
<div class="alert alert-block alert-error fade in ">
  <a class="close" data-dismiss="alert">&times;</a>
  <h4 class="alert-heading">Please fix the following errors :</h4>
 <?php 
    echo validation_errors();
    ?>
</div>
Example #10
0
	// to prevent some issues with loading jquery twice on the page
	if (typeof jQuery == 'undefined'){
		document.write('<script type="text/javascript" charset="utf-8" src="<?php 
echo js_path('jquery/jquery', 'fuel');
?>
"><\/script>');
	}
</script>
<script>
	
	// must be less then version 1.9 or we will load campatability helper
	var __jq_version__ = jQuery.fn.jquery.split('.');
	if (parseInt(__jq_version__[0]) > 1 || (parseInt(__jq_version__[0]) == 1 && parseInt(__jq_version__[1]) >= 9)){
		jQuery.migrateMute = true;
		document.write('<script type="text/javascript" charset="utf-8" src="<?php 
echo js_path('jquery/plugins/jquery-migrate-1.1.1.js', 'fuel');
?>
"><\/script>');
	}

</script>
<?php 
echo js('fuel/fuel_inline.min.js', 'fuel', array('ignore_if_loaded' => TRUE, 'output' => $this->fuel->config('fuel_assets_output')));
?>

<div class="__fuel__" id="__fuel_edit_bar__">
	<?php 
echo $this->form->open(array('action' => fuel_url('pages/ajax_page_edit/'), 'method' => 'post', 'id' => '__fuel_edit_bar_form__'));
?>
	<div class="buttonbar buttonbar_notop">
Example #11
0
	/**
	 * Retrieve the info for a module
	 *
	 * @access	public
	 * @param	string	module name
	 * @return	array
	 */	
	public function info($module)
	{
		if (!empty($_cached[$module])) return $_cached[$module];
		//if (!$this->is_allowed($module)) return FALSE;

		if (!isset($this->_modules[$module])) return FALSE;
		
		$CI =& get_instance();
		$CI->load->helper('inflector');
		$CI->load->helper('string');
		
		$defaults = array(
			'module_name' => humanize($module),
			'module_uri' => $module,
			'model_name' => $module.'_model',
			'model_location' => '',
			'view_location' => '',
			'display_field' => '',
			'preview_path' => '',
			'views' => array(
				'list' => '_layouts/module_list', 
				'create_edit' => '_layouts/module_create_edit', 
				'delete' => '_layouts/module_delete'),
			'permission' => $module,
			'js_controller' => 'BaseFuelController',
			'js_controller_path' => '',
			'js_controller_params' => array(),
			'js_localized' => array(),
			'js' => '',
			'edit_method' => 'find_one_array',
			'instructions' => NULL,
			'filters' => array(),
			'archivable' => TRUE,
			'table_headers' => array(),
			'table_actions' => array('EDIT', 'VIEW', 'DELETE'),
			'item_actions' => array('save', 'view', 'publish', 'activate', 'delete', 'duplicate', 'create'),
			'list_actions' => array(),
			'rows_selectable' => TRUE,
			'precedence_col' => 'precedence',
			'clear_cache_on_save' => TRUE,
			'create_action_name' => lang('btn_create'),
			'configuration' => '',
			'nav_selected' => NULL,
			'default_col' => NULL,
			'default_order' => NULL,
			'sanitize_input' => TRUE,
			'sanitize_images' => TRUE,
			'displayonly' => FALSE,
			'language' => '',
			'hidden' => FALSE,
			);
		$return = array();
		$params = $this->_modules[$module];

		foreach ($defaults as $key => $val)
		{
			if (isset($params[$key]))
			{
				$return[$key] = $params[$key];
			}
			else
			{
				$return[$key] = $val;
			}
		}
		
		// localize certain fields
		if ($module_name = lang('module_'.$module))
		{
			$return['module_name'] = $module_name;
		}
		
		// set instructions
		if (empty($return['instructions']))
		{
			$return['instructions'] = lang('module_instructions_default', strtolower($return['module_name']));
		}
		
		// set proper jqxController name
		if (is_array($return['js_controller']))
		{
			if (empty($return['js_controller_path']))
			{
				$return['js_controller_path'] = js_path('', key($return['js_controller']));
			}
			$return['js_controller'] = current($return['js_controller']);
		}
		else if (is_string($return['js_controller']) AND strpos($return['js_controller'], '.') === FALSE)
		{
			$return['js_controller'] = 'fuel.controller.'.$return['js_controller'];
		}

		// convert slashes to jqx object periods
		$return['js_controller'] = str_replace('/', '.', $return['js_controller']);
		
		// set the base path to the controller file if still empty
		if (empty($return['js_controller_path']))
		{
			$return['js_controller_path'] = js_path('', FUEL_FOLDER);
		}
		
		
		
		if ($create_action_name = lang('module_'.$module.'_create'))
		{
			$return['create_action_name'] = $create_action_name;
		}
		
		$_cached[$module] = $return;
		return $return;
		
	}
<?php

$config['modules']['social_icons'] = array('module_name' => 'Icons', 'module_uri' => 'social/icons', 'model_name' => 'social_icons_model', 'model_location' => 'social', 'display_field' => 'url', 'default_col' => 'name', 'preview_path' => '', 'permission' => 'social_icons', 'instructions' => lang('module_instructions_default', 'social icons'), 'archivable' => TRUE, 'configuration' => array('social' => 'social'), 'nav_selected' => 'social/icons', 'js_controller' => 'SocialController', 'js_controller_path' => js_path('', SOCIAL_FOLDER));
//EOF
Example #13
0
?>
"></script>
    <script type="text/javascript" src="<?php 
echo js_asset_url('jquery.tablesorter.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo js_asset_url('bootstrap.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo js_asset_url('chosen.jquery.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo js_path('manage.js');
?>
"></script>




</head>
<body>
    <div class="container">
        <div class="row">
            <div class="col-xs-12">
                <ul class="nav nav-pills">
                    <li>
                        <a href="<?php 
echo site_url();
Example #14
0
echo lang('cp_admin_title') . ' - ' . $template['title'];
?>
</title>
	
	<base href="<?php 
echo base_url();
?>
" />
	
	<!-- Mobile Viewport Fix -->
	<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
	
	<!-- Grab Google CDNs jQuery, fall back if necessary -->
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
	<script>!window.jQuery && document.write('<script src="<?php 
echo js_path('jquery/jquery-1.4.2.min.js');
?>
"><\/script>')</script>
	
	<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> 
	
	<?php 
echo $template['partials']['metadata'];
?>
</head>

<body>
<noscript>
	PyroCMS requires that Javascript be turned on for many of the functions to work correctly. Please turn javascript on and reload the page.
</noscript>
<div id="page-wrapper">
Example #15
0
<!-- CKEditor -->
<?php 
echo js('ckeditor/ckeditor.js');
?>
<script type="text/javascript">
	jQuery(document).ready(function() {
		CKEDITOR.replaceAll( 'wysiwyg-advanced', {
			customConfig : '<?php 
echo js_path('ckeditor/config_advanced.js');
?>
'
		});

		CKEDITOR.replaceAll( 'wysiwyg-simple', {
			customConfig : '<?php 
echo js_path('ckeditor/config_simple.js');
?>
'
		});
	});
</script>
<!-- /CKEditor -->
Example #16
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');
		$this->_CI->load->helper('convert');
		
		
		// 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);
		$last_page = uri_path();
		if (empty($last_page)) $last_page = $this->_CI->config->item('default_home_view', 'fuel');
		$vars['last_page'] = uri_safe_encode($last_page);

		$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;
	}
Example #17
0
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!-- Always force latest IE rendering engine & Chrome Frame -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<!-- Grab Google CDNs jQuery, fall back if necessary -->
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
	<script>!window.jQuery && document.write('<script src="<?php echo js_path('jquery/jquery.min.js'); ?>"><\/script>')</script>

	<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->

	<?php echo css('admin/basic_layout.css'); ?>
</head>
<body>
	<?php $this->load->view('admin/partials/notices') ?>
	<?php echo $template['body']; ?>
</body>
</html>
Example #18
0
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!-- Always force latest IE rendering engine & Chrome Frame -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<title><?php echo lang('cp_admin_title').' - '.$template['title'];?></title>
	
	<base href="<?php echo base_url(); ?>" />
	
	<!-- Mobile Viewport Fix -->
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
	
	<!-- Grab Google CDNs jQuery, fall back if necessary -->
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
	<script>window.jQuery || document.write('<script src="<?php echo js_path('jquery/jquery.min.js'); ?>">\x3C/script>')</script>
	
	<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->

	<?php file_partial('metadata'); ?>
</head>

<body>
<noscript>
	<span class="noscript">PyroCMS requires that JavaScript be turned on for many of the functions to work correctly. Please turn JavaScript on and reload the page.</span>
</noscript>
<div id="page-wrapper">
	<section id="sidebar" dir=<?php $vars = $this->load->_ci_cached_vars; echo $vars['lang']['direction']; ?>>
<?php file_partial('header'); ?>
<?php file_partial('navigation'); ?>
		<div id="lang-select">
Example #19
0
 /**
  * Creates javascript code that first tries to pull in jquery from the Google CDN, and if it doesn't exist, goes to the local backup version
  *
  * @access	public
  * @param	string	jQuery version number for Google CDN
  * @param	string	local asset path to default version
  * @return	string
  */
 public function jquery($version = '1.7.1', $default = 'jquery')
 {
     $js = '<script src="//ajax.googleapis.com/ajax/libs/jquery/' . $version . '/jquery.min.js"></script>';
     $js .= '<script>window.jQuery || document.write(\'<script src="' . js_path($default) . '"><\\/script>\');</script>';
     return $js;
 }
if ($use_footer) {
    ?>
<div id="footer">
<p>
  &nbsp;&middot;  
<a href="#top">Top of Page</a>  &nbsp;&middot;  
<a href="<?php 
    echo user_guide_url();
    ?>
">User Guide Home</a>  &nbsp;&middot;  
</p>
<p><a href="http://getfuelcms.com">FUEL CMS</a> &nbsp;&middot;&nbsp; &copy; Copyright <?php 
    echo date('Y');
    ?>
 &nbsp;&middot;&nbsp; <a href="http://thedaylightstudio.com/">Daylight Studio</a></p>
</div>
<?php 
}
?>

<script language="javascript">
SyntaxHighlighter.config['clipboardSwf'] = '<?php 
echo js_path('', 'user_guide');
?>
clipboard.swf';
SyntaxHighlighter.defaults['gutter'] = false;
SyntaxHighlighter.all();
</script>

</body>
</html>
 function js_respond()
 {
     if (template_enable_oldie()) {
         ci()->load->helper('asset');
         if (config_item('load_javascripts_from_source')) {
             $js_path = js_path('lib/respond/respond-1.3.0.js');
         } else {
             $js_path = js_path('lib/respond/respond-1.3.0.min.js');
         }
         return "\n    <script type=\"text/javascript\">\n    //<![CDATA[\n        Modernizr.mq('(min-width:0)') || document.write('<scr' + 'ipt type=\"text/javascript\" src=\"{$js_path}\"></scr' + 'ipt>');\n    //]]>\n    </script>";
     }
     return '';
 }
var jqx_config = {};
jqx_config.basePath =  "<?php 
echo substr(site_url(), -1) != '/' ? site_url() . '/' : site_url();
?>
";
jqx_config.jsPath = "<?php 
echo js_path('', 'fuel');
?>
";
jqx_config.imgPath = "<?php 
echo img_path('', 'fuel');
?>
";

jqx_config.assetsImgPath = "<?php 
echo img_path('');
?>
";
jqx_config.assetsPath = "<?php 
echo assets_path('');
?>
";

jqx_config.jqxPath = jqx_config.jsPath + "jqx/";
jqx_config.controllerPath = <?php 
echo $this->js_controller_path;
?>
;
jqx_config.pluginPath = jqx_config.jsPath + "jquery/";
jqx_config.helpersPath = jqx_config.jqxPath + 'helpers/';
jqx_config.pluginPath = jqx_config.jsPath + 'jquery/plugins/';
Example #23
0
echo lang('cp_admin_title') . ' - ' . $template['title'];
?>
</title>
	
	<base href="<?php 
echo base_url();
?>
" />
	
	<!-- Mobile Viewport Fix -->
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
	
	<!-- Grab Google CDNs jQuery, fall back if necessary -->
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
	<script>!window.jQuery && document.write('<script src="<?php 
echo js_path('jquery/jquery.js');
?>
"><\/script>')</script>
	
	<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> 
	
	<?php 
echo $template['partials']['metadata'];
?>
</head>

<body>
<noscript>
	PyroCMS requires that Javascript be turned on for many of the functions to work correctly. Please turn javascript on and reload the page.
</noscript>
<div id="page-wrapper">
Example #24
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;
 }