/**
 * Initialize plugins data
 * create GSPLUGINSFILE if not exist
 * else load in plugins and register the inactive ones
 *
 * @since  3.4
*/
function loadPluginData()
{
    global $live_plugins, $plugin_info, $live_plugins;
    $live_plugins = array();
    $plugin_info = array();
    // Check if data\other\plugins.xml exists
    if (!file_exists(GSDATAOTHERPATH . getDef('GSPLUGINSFILE'))) {
        create_pluginsxml();
        registerInactivePlugins(get_filename_id() == 'plugins');
        return true;
    }
    read_pluginsxml();
    // get the live plugins into $live_plugins array
    if (!is_frontend()) {
        create_pluginsxml(get_filename_id() == 'plugins');
    }
    // only on backend check that plugin files have not changed, and regen
    registerInactivePlugins();
    if (getDef('GSPLUGINORDER', true)) {
        $reorderplugins = explode(',', getDef('GSPLUGINORDER'));
        debugLog("reorder plugins" . print_r($reorderplugins, true));
        $reorderplugins = array_reverse($reorderplugins);
        foreach ($reorderplugins as $reorderplugin) {
            $live_plugins = array($reorderplugin => $live_plugins[$reorderplugin]) + $live_plugins;
        }
    }
    return true;
}
/**
 * Include any plugins, depending on where the referring 
 * file that calls it we need to set the correct paths. 
 *
 * @since  3.4.0
 * @uses  $live_plugins
*/
function loadPluginData()
{
    if (file_exists(GSPLUGINPATH)) {
        $pluginfiles = getFiles(GSPLUGINPATH);
    }
    // Check if data\other\plugins.xml exists
    if (!file_exists(GSDATAOTHERPATH . "plugins.xml")) {
        create_pluginsxml();
        registerInactivePlugins(get_filename_id() == 'plugins');
        return true;
    }
    read_pluginsxml();
    // get the live plugins into $live_plugins array
    if (!is_frontend()) {
        create_pluginsxml(get_filename_id() == 'plugins');
    }
    // only on backend check that plugin files have not changed, and regen
    registerInactivePlugins();
    return true;
}
Exemple #3
0
<h1 class="sitename"><a href="<?php 
echo $SITEURL;
?>
" target="_blank" ><?php 
echo cl($SITENAME);
?>
 <i class="icon fa fa-external-link"></i></a></h1>
<ul class="nav <?php 
echo $plugin_class;
?>
">

<?php 
$tabs = explode(',', getDef('GSTABS'));
// $tabs  = array_keys($sidemenudefinition); // debug all
$current = get_filename_id();
// if current tab is not in GSTABS, then set its parent tab as current
if (!in_array($current, $tabs)) {
    if (isset($sidemenudefinition[$current]) && !empty($sidemenudefinition[$current])) {
        $current = $sidemenudefinition[$current];
    }
}
if ($tabs) {
    foreach ($tabs as $tab) {
        if (empty($tab)) {
            continue;
        }
        $tabtitle = i18n_r('TAB_' . uppercase($tab));
        $class = $tab == $current ? ' current' : '';
        echo '<li id="nav_' . $tab . '" ><a class="' . $tab . $class . '" href="' . $tab . '.php" accesskey="' . find_accesskey($tabtitle) . '" >' . $tabtitle . '</a></li>';
    }
if (!defined('IN_GS')) {
    die('you cannot load this page directly.');
}
/**
 * Error Checking
 *
 * Displays error and success messages
 *
 * @package GetSimple
 *
 * You can pass $update(global) directly if not using a redirrect and querystring
 *
 */
// do not use these alerts if ajax requests as they will not be seen, and interfere with other alerts
if (!requestIsAjax() && file_exists(GSUSERSPATH . _id($USR) . ".xml.reset") && get_filename_id() != 'index' && get_filename_id() != 'resetpassword') {
    doNotify(sprintf(i18n_r('ER_PWD_CHANGE'), 'profile.php'), 'error');
}
if (!requestIsAjax() && (!defined('GSNOAPACHECHECK') || GSNOAPACHECHECK == false) and !server_is_apache()) {
    doNotify(i18n_r('WARNING') . ': <a href="health-check.php">' . i18n_r('SERVER_SETUP') . ' non-Apache</a>', 'info');
}
if (!isset($update)) {
    $update = '';
}
if (isset($_GET['upd'])) {
    $update = var_in($_GET['upd']);
}
if (isset($_GET['success'])) {
    $success = var_in($_GET['success']);
}
if (isset($_GET['error'])) {
/**
 * Navigation Include Template
 *
 * @package GetSimple
 */
$debugInfoUrl = 'http://get-simple.info/docs/debugging';
if (cookie_check()) {
    echo '<ul id="pill"><li class="leftnav"><a href="logout.php" accesskey="' . find_accesskey(i18n_r('TAB_LOGOUT')) . '" >' . i18n_r('TAB_LOGOUT') . '</a></li>';
    if (isDebug()) {
        echo '<li class="debug"><a href="' . $debugInfoUrl . '" target="_blank">' . i18n_r('DEBUG_MODE') . '</a></li>';
    }
    echo '<li class="rightnav" ><a href="settings.php#profile">' . i18n_r('WELCOME') . ' <strong>' . $USR . '</strong>!</a></li></ul>';
}
//determine page type if plugin is being shown
if (get_filename_id() == 'load') {
    $plugin_class = $plugin_info[$plugin_id]['page_type'];
} else {
    $plugin_class = '';
}
?>
<h1 id="sitename"><a href="<?php 
echo $SITEURL;
?>
" target="_blank" ><?php 
echo cl($SITENAME);
?>
</a></h1>
<ul class="nav <?php 
echo $plugin_class;
?>
Exemple #6
0
if (getGlobal('EDTOOL')) {
    echo ",toolbar: " . returnJsArray(getGlobal('EDTOOL'));
}
if (getGlobal('EDOPTIONS')) {
    echo ',' . trim(getGlobal('EDOPTIONS'));
}
?>
        };

        // wipe the ckeditor shim, so it does not interfere with the real one
        if(typeof CKEDITOR !== 'undefined'){
            if(CKEDITOR.SHIM == true) CKEDITOR = null;
        }

       <?php 
if (get_filename_id() == 'snippets') {
    echo "htmlEditorConfig.height = '130px';";
}
?>

    </script>

	<?php 
// load scripts after globals set
get_scripts_backend();
?>
    <script type="text/javascript">
		jQuery(document).ready(function () {
			// disable page editing during safemode
	       	$('body#edit.safemode :input').prop("disabled", true);
	    });
if (!defined('IN_GS')) {
    die('you cannot load this page directly.');
}
/****************************************************
*
* @File:  caching_functions.php
* @Package: GetSimple
* @since 3.1
* @Action:  Plugin to create pages.xml and new functions  
*
*****************************************************/
$pagesArray = array();
add_action('index-header', 'getPagesXmlValues', array(false));
// make $pagesArray available to the front
add_action('header', 'getPagesXmlValues', array(get_filename_id() != 'pages'));
// make $pagesArray available to the back
add_action('page-delete', 'create_pagesxml', array(true));
// Create pages.array if page deleted
add_action('page-restored', 'create_pagesxml', array(true));
// Create pages.array if page undo
add_action('changedata-aftersave', 'create_pagesxml', array(true));
// Create pages.array if page is updated
/**
 * Get Page Content
 *
 * Retrieve and display the content of the requested page. 
 * As the Content is not cahed the file is read in.
 *
 * @since 2.0
 * @param $page - slug of the page to retrieve content
	<?php 
if (!getDef('GSNOSITEMAP')) {
    ?>
 <li id="sb_sitemap" class="last_sb"><a href="sitemap.php" <?php 
    check_menu('sitemap');
    ?>
 accesskey="<?php 
    echo find_accesskey(i18n_r('SIDE_VIEW_SITEMAP'));
    ?>
" ><?php 
    i18n('SIDE_VIEW_SITEMAP');
    ?>
</a></li> <?php 
}
?>
	<?php 
exec_action("theme-sidebar");
?>
</ul>

<?php 
if (get_filename_id() === 'components' || get_filename_id() === 'theme-edit') {
    ?>
<p id="js_submit_line" ></p>
<?php 
}
?>



Exemple #9
0
    }
    // @callout plugin_preload_callout callout before loading plugin files
    // Include plugins files in global scope
    loadPluginData();
    foreach ($live_plugins as $file => $en) {
        if ($en == 'true' && file_exists(GSPLUGINPATH . $file)) {
            // debugLog('including plugin: ' . $file);
            include_once GSPLUGINPATH . $file;
            exec_action('plugin-loaded');
            // @hook plugin-loaded called after each plugin is included
        }
    }
    exec_action('plugins-loaded');
    // @hook plugins-loaded plugin files have been included
    // load api
    if (get_filename_id() == 'settings' || get_filename_id() == 'load') {
        /* this core plugin only needs to be visible when you are viewing the
        		settings page since that is where its sidebar item is. */
        if (getDef('GSEXTAPI', true)) {
            include_once 'api.plugin.php';
        }
    }
    # main hook for common.php
    exec_action('common');
    // @hook common common.php has completed loading resoruces, base not yet loaded
    // debugLog('calling common_callout');
    if (function_exists('common_callout')) {
        common_callout();
    }
    // @callout common_callout callout after common loaded, before templating
}
*
* @File:  shortcodes.php
* @Action:  Port of WP Shortcodes to GS  
*
*****************************************************/
$shortcode_tags = array();
// Shortcode tags array
$shortcode_info = array();
// Shortcode tags array
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
# register plugin
register_plugin($thisfile, 'Shortcodes', '1.1', 'Mike Swan', 'http://www.digimute.com/', 'Shortcodes for GS', 'plugins', 'shortcodes_show');
# activate hooks
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, 'Shortcode Info'));
if (get_filename_id() == "edit") {
    add_action('edit-extras', 'insertJS', array());
}
function insertJS()
{
    global $shortcode_tags;
    global $shortcode_info;
    echo "<script type=\"text/javascript\">";
    echo "jQuery(document).ready(function() { ";
    $js = "<div style='width:100%;background-color:#efefef;height:36px;margin-bottom:5px;'>";
    $js .= "<h2 style='padding-top:5px;padding-left:5px;color:#222;'>[shortcodes]";
    $js .= "<select style='width:300px;margin-left:30px;font-family:courier;font-size:11px;' id='shortcode_value'>";
    while (list($key, $val) = each($shortcode_tags)) {
        $js .= '<option >' . $key . ' - ' . str_replace("\"", "'", $shortcode_info[$key]) . '</option>';
    }
    $js .= "</select><input id='shorcode_insert' style='margin-left:15px;' type='button' value=' insert ' /></h2></div>";
Exemple #11
0
Plugin Name: Innovation Theme Settings
Description: Settings for the default GetSimple Theme: Innovation
Version: 1.2
Author: Chris Cagle
Author URI: http://chriscagle.me
*/
# get correct id for plugin
$thisfile_innov = basename(__FILE__, ".php");
$innovation_file = GSDATAOTHERPATH . 'InnovationSettings.xml';
# add in this plugin's language file
i18n_merge($thisfile_innov) || i18n_merge($thisfile_innov, 'en_US');
# register plugin
register_plugin($thisfile_innov, i18n_r($thisfile_innov . '/INNOVATION_TITLE'), '1.2', 'Chris Cagle', 'http://chriscagle.me', i18n_r($thisfile_innov . '/INNOVATION_DESC'), 'theme', 'innovation_show');
# hooks
# enable side menu is theme is innovation or on theme page and enabling innovation, handle plugin exec before global is set
if (($TEMPLATE == "Innovation" || get_filename_id() == 'theme' && isset($_POST['template']) && $_POST['template'] == 'Innovation') && !($TEMPLATE == "Innovation" && get_filename_id() == 'theme' && isset($_POST['template']) && $_POST['template'] != 'Innovation')) {
    add_action('theme-sidebar', 'createSideMenu', array($thisfile_innov, i18n_r($thisfile_innov . '/INNOVATION_TITLE')));
}
$services = array('facebook', 'googleplus', 'twitter', 'linkedin', 'tumblr', 'instagram', 'youtube', 'vimeo', 'github');
# get XML data
if (file_exists($innovation_file)) {
    $innovation_data = getXML($innovation_file);
}
function innovation_show()
{
    global $services, $innovation_file, $innovation_data, $thisfile_innov;
    $success = $error = null;
    // submitted form
    if (isset($_POST['submit'])) {
        foreach ($services as $var) {
            if ($_POST[$var] != '') {
/**
 * Check if a page is a public admin page
 * @return boolean true if page is non protected admin page
 */
function isAuthPage()
{
    $page = get_filename_id();
    return $page == 'index' || $page == 'resetpassword';
}
Exemple #13
0
function nm_update_extend_cache()
{
    if (!is_frontend() && get_filename_id() == 'plugins') {
        include GSADMININCPATH . 'configuration.php';
        $url = $site_link_back_url . 'api/extend/?id=541';
        $tempfile = GSCACHEPATH . md5($url) . '.txt';
        $cachefile = GSCACHEPATH . md5($site_link_back_url . 'api/extend/?file=news_manager.php') . '.txt';
        get_api_details('custom', $url);
        if (file_exists($cachefile)) {
            unlink($cachefile);
        }
        @copy($tempfile, $cachefile);
    }
}
Exemple #14
0
</p>
      	</div>
      	<div class="gslogo" >
	      	<a href="http://makingsolutions.net/" target="_blank" ><img src="http://makingsolutions.net/logo.jpg" alt="" /></a>
	      </div>
      	<div class="clear"></div>
      	<?php 
if (get_filename_id() != 'index') {
    get_scripts_backend(TRUE);
    exec_action('footer');
}
?>

		</div><!-- end #footer -->
		<?php 
if (get_filename_id() != 'index') {
    if (defined('GSDEBUG')) {
        global $GS_debug;
        echo '<h2>' . i18n_r('DEBUG_CONSOLE') . '</h2><div id="gsdebug">';
        echo '<pre>';
        foreach ($GS_debug as $log) {
            print $log . '<br/>';
        }
        echo '</pre>';
        echo '</div>';
    }
}
?>
	</div><!-- end .wrapper -->
	
	
    create_pluginsxml();
}
read_pluginsxml();
// get the live plugins into $live_plugins array
if (!is_frontend()) {
    create_pluginsxml();
}
// check that plugins have not been removed or added to the directory
// load each of the plugins
foreach ($live_plugins as $file => $en) {
    $pluginsLoaded = true;
    # debugLog("plugin: $file" . " exists: " . file_exists(GSPLUGINPATH . $file) ." enabled: " . $en);
    if ($en == 'true' && file_exists(GSPLUGINPATH . $file)) {
        require_once GSPLUGINPATH . $file;
    } else {
        if (!is_frontend() and get_filename_id() == 'plugins') {
            $apiback = get_api_details('plugin', $file, getDef('GSNOPLUGINCHECK', true));
            $response = json_decode($apiback);
            if ($response and $response->status == 'successful') {
                register_plugin(pathinfo_filename($file), $file, 'disabled', $response->owner, '', i18n_r('PLUGIN_DISABLED'), '', '');
            } else {
                register_plugin(pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
            }
        } else {
            register_plugin(pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
        }
    }
}
/**
 * change_plugin
 * 
    ?>
	<script type="text/javascript" src="template/js/jcrop/jquery.Jcrop.min.js"></script>
	<link rel="stylesheet" type="text/css" href="template/js/jcrop/jquery.Jcrop.css" media="screen" />
	<?php 
}
?>

	<?php 
# Plugin hook to allow insertion of stuff into the header
if (get_filename_id() != 'index') {
    exec_action('header');
}
?>
	
	<?php 
if (get_filename_id() != 'resetpassword' && get_filename_id() != 'index') {
    ?>
	<script>
		// check to see if core update is needed
		jQuery(document).ready(function() { 
			<?php 
    $data = get_api_details();
    if ($data) {
        $apikey = json_decode($data);
        $verstatus = $apikey->status;
        ?>
				var verstatus = <?php 
        echo $verstatus;
        ?>
;
				if(verstatus != 1) {
/**
 * Check Current Menu
 *
 * Checks to see if a menu item matches the current page
 *
 * @since 1.0
 *
 * @param string $text
 * @return string
 */
function check_menu($text)
{
    if (get_filename_id() === $text) {
        echo 'class="current"';
    }
}
Exemple #18
0
?>
	<script type="text/javascript" src="template/js/jquery.getsimple.js?v=<?php 
echo GSVERSION;
?>
"></script>

	<!--[if lt IE 9]><script type="text/javascript" src="//html5shiv.googlecode.com/svn/trunk/html5.js" ></script><![endif]-->
	<?php 
if ((get_filename_id() == 'upload' || get_filename_id() == 'image') && !getDef('GSNOUPLOADIFY', true)) {
    ?>
	<script type="text/javascript" src="template/js/uploadify/jquery.uploadify.js?v=3.0"></script>
	<?php 
}
?>
	<?php 
if (get_filename_id() == 'image') {
    ?>
	<script type="text/javascript" src="template/js/jcrop/jquery.Jcrop.min.js"></script>
	<link rel="stylesheet" type="text/css" href="template/js/jcrop/jquery.Jcrop.css" media="screen" />
	<?php 
}
?>

    <?php 
# Plugin hook to allow insertion of stuff into the header
if (!isAuthPage()) {
    exec_action('header');
}
function doVerCheck()
{
    return !isAuthPage() && !getDef('GSNOVERCHECK');
 */
?>
<ul class="snav">
<li><a href="settings.php" accesskey="<?php 
echo find_accesskey(i18n_r('SIDE_GEN_SETTINGS'));
?>
" <?php 
check_menu('settings');
?>
 ><?php 
i18n('SIDE_GEN_SETTINGS');
?>
</a></li>
<li><a href="settings.php#profile" accesskey="<?php 
echo find_accesskey(i18n_r('SIDE_USER_PROFILE'));
?>
" ><?php 
i18n('SIDE_USER_PROFILE');
?>
</a></li>
<?php 
exec_action("settings-sidebar");
?>
</ul>

<?php 
if (get_filename_id() === 'settings') {
    ?>
<p id="js_submit_line" ></p>
<?php 
}
Exemple #20
0
 * @package GetSimple
 */
?>
<ul class="snav">
	<li id="sb_backups" ><a href="backups.php" <?php 
check_menu('backups');
?>
 accesskey="<?php 
echo find_accesskey(i18n_r('SIDE_PAGE_BAK'));
?>
" ><?php 
i18n('SIDE_PAGE_BAK');
?>
</a></li>
	<?php 
if (get_filename_id() === 'backup-edit') {
    ?>
<li id="sb_viewbackup" ><a href="#" class="current"><?php 
    i18n('SIDE_VIEW_BAK');
    ?>
</a></li><?php 
}
?>
	<li id="sb_archives" ><a href="archive.php" <?php 
check_menu('archive');
?>
 accesskey="<?php 
echo find_accesskey(i18n_r('SIDE_WEB_ARCHIVES'));
?>
" ><?php 
i18n('SIDE_WEB_ARCHIVES');
Exemple #21
0
echo find_accesskey(i18n_r('MENU_MANAGER'));
?>
" <?php 
check_menu('menu-manager');
?>
><?php 
i18n('MENU_MANAGER');
?>
</a></li>
	<?php 
exec_action("pages-sidebar");
// @hook pages-sidebar sidebar list html output
?>
</ul>

<p id="js_submit_line" ></p>

<?php 
if (get_filename_id() === 'edit') {
    ?>
	<?php 
    if (getDef('GSAUTOSAVE')) {
        ?>
	<p id="autosavestatus"><?php 
        echo sprintf(i18n_r("AUTOSAVE_STATUS"), getDef('GSAUTOSAVE'));
        ?>
</p>
	<p id="autosavenotify"></p>
	<?php 
    }
}
 * Sidebar Support Template
 */
?>
<ul class="snav">
	<li id="sb_support" ><a href="support.php"  <?php 
check_menu('support');
?>
 accesskey="<?php 
echo find_accesskey(i18n_r('SIDE_SUPPORT_LOG'));
?>
" ><?php 
i18n('SIDE_SUPPORT_LOG');
?>
</a></li>
	<?php 
if (get_filename_id() === 'log') {
    ?>
<li id="sb_log" ><a href="#"  class="current" ><?php 
    i18n('SIDE_VIEW_LOG');
    ?>
</a></li><?php 
}
?>
	<li id="sb_healthcheck" ><a href="health-check.php" <?php 
check_menu('health-check');
?>
 accesskey="<?php 
echo find_accesskey(i18n_r('SIDE_HEALTH_CHK'));
?>
" ><?php 
i18n('SIDE_HEALTH_CHK');
Exemple #23
0
/**
 * checks if is current page is not an install page or stylesheet
 * @return bool true if we not in an install file
 */
function notInInstall()
{
    return get_filename_id() != 'install' && get_filename_id() != 'setup' && get_filename_id() != 'update' && get_filename_id() != 'style';
}
Exemple #24
0
function getDraftPageHead($editing = true, $path = '')
{
    global $id, $draftExists, $pageExists, $PRETTYURLS;
    echo '<h3 class="floated">' . ($editing ? i18n_r('PAGE_EDIT_MODE') : i18n_r('CREATE_NEW_PAGE')) . '</h3>';
    echo '<div class="title label label-draft secondary-lightest-back unselectable">' . i18n_r('LABEL_DRAFT') . '</div>';
    echo '<!-- pill edit navigation -->', "\n", '<div class="edit-nav clearfix" >';
    if ($editing) {
        echo '<a class="draftview" href="' . $path . ($PRETTYURLS || $id == 'index' ? '?' : '&amp;') . 'draft" target="_blank" accesskey="' . find_accesskey(i18n_r('VIEW')) . '" >' . i18n_r('VIEW') . '</a>';
        echo '<a class="draftpublish" href="changedata.php?publish&id=' . $id . '" accesskey="' . find_accesskey(i18n_r('PUBLISH')) . '" >' . i18n_r('PUBLISH') . '</a>';
    }
    exec_action(get_filename_id() . '-edit-nav');
    echo "\n</div>";
}
Exemple #25
0
<div class="bodycontent clearfix">
	
	<div id="maincontent">
		<div class="main">
			<h3 class="floated"><?php 
i18n('USER_PROFILE');
echo $userheading;
?>
</h3>
			<div class="edit-nav clearfix" >
				<?php 
exec_action(get_filename_id() . '-edit-nav');
?>
			</div>		
			<?php 
exec_action(get_filename_id() . '-body');
?>
			
			<!-- user form -->
			<form class="largeform" action="<?php 
myself();
?>
" method="post" accept-charset="utf-8" >
			<input id="nonce" name="nonce" type="hidden" value="<?php 
echo get_nonce("save_profile");
?>
" />
			<?php 
if ($adding === true) {
    ?>
 <input id="add" name="add" type="hidden" value="1" /> <?php 
Exemple #26
0
/**
 * Variable Globalization
 */
global $SITENAME, $SITEURL, $TEMPLATE, $TIMEZONE, $LANG, $SALT, $i18n, $USR, $PERMALINK, $GSADMIN;
/**
 * $base is if the site is being viewed from the front-end
 */
if (!isset($base)) {
    include_once GSADMININCPATH . 'cookie_functions.php';
} else {
    include_once GSADMININCPATH . 'theme_functions.php';
}
/**
 * Check to make sure site is already installed
 */
if (get_filename_id() != 'install' && get_filename_id() != 'setup' && get_filename_id() != 'update') {
    $fullpath = suggest_site_path();
    # if an update file was included in the install package, redirect there first
    if (file_exists(GSDATAOTHERPATH . 'user.xml')) {
        if (file_exists(GSADMINPATH . 'update.php')) {
            redirect($fullpath . $GSADMIN . '/update.php');
        }
    }
    # if there is no SITEURL set, then it's a fresh install. Start installation process
    if ($SITEURL == '') {
        redirect($fullpath . $GSADMIN . '/install.php');
    }
    # if you've made it this far, the site is already installed so remove the installation files
    if (file_exists(GSADMINPATH . 'install.php')) {
        unlink(GSADMINPATH . 'install.php');
    }