function jQuery_migrate_init()
{
    global $thisfile_GSJQM, $SITEURL;
    i18n_merge($thisfile_GSJQM) || i18n_merge($thisfile_GSJQM, GSDEFAULTLANG);
    # register plugin
    register_plugin($thisfile_GSJQM, i18n_r($thisfile_GSJQM . '/GSJQMigrate_TITLE'), '1.0', 'GetSimpleCMS', 'http://get-simple.info', i18n_r($thisfile_GSJQM . '/GSJQMigrate_DESC'), '', '');
    $asset = isDebug() ? 'jquery-migrate-1.2.1.js' : 'jquery-migrate-1.2.1.min.js';
    // when debug is on, migrate will output to console with deprecated notices.
    $url = $SITEURL . 'plugins/' . $thisfile_GSJQM . '/assets/js/' . $asset;
    register_script('jquerymigrate', $url, '', FALSE);
    queue_script('jquerymigrate', GSBACK);
}
Esempio n. 2
0
 /** register JS/CSS dependencies from KO->lib with standard GS functions queue_ and register_
  *  @param {string} $plugin - Plugin base filename to compare to.
  *  @param {array} $libs - Array of library enum arrays
  */
 public static function registerLib($plugin, $libs)
 {
     // only register if the plugin id = this plugin, so as not to change CSS of other pages
     if (isset($_REQUEST) && isset($_REQUEST['id']) && $_REQUEST['id'] === $plugin) {
         foreach ($libs as $key => $lib) {
             if (strrpos($lib[0], '.js')) {
                 register_script($key, $lib[0], $lib[1], $lib[2]);
             } else {
                 register_style($key, $lib[0], $lib[1], $lib[2]);
             }
         }
         foreach ($libs as $key => $lib) {
             if (strrpos($lib[0], '.js')) {
                 queue_script($key, GSBACK);
             } else {
                 queue_style($key, GSBACK);
             }
         }
     }
 }
Esempio n. 3
0
preRegisterStyle('jcrop', '', false, 'screen');
preRegisterStyle('fancybox-css', '', false, 'screen');
// DEPRECATED legacy , styleid not matching scriptid is confusing.
preRegisterStyle('fancybox', '', false, 'screen');
preRegisterStyle('jquery-ui', '', false, 'screen');
/**
 * Queue our scripts and styles for the backend
 */
queue_script('jquery', GSBACK);
queue_script('jquery-ui', GSBACK);
queue_script('getsimple', GSBACK);
queue_script('lazyload', GSBACK);
queue_script('spin', GSBACK);
queue_script('gstree', GSBACK);
queue_script('fancybox', GSBACK);
queue_script('scrolltofixed', GSBACK);
queue_style('fancybox', GSBACK);
queue_style('jquery-ui', GSBACK);
// queue_style('jquery-ui-theme', GSBACK); // unused, reserved for custom GS jquery ui theme if ever needed
queue_style('font-awesome', GSBACK);
/**
 * ASSET FUNCTIONS
 */
/**
 * preregister scripts
 * helper for using global arrays to build script asset registration
 * 
 * @since 3.4
 * @param  str  $id     id of script asset
 * @param  boolean $CDN    use cdn if available
 * @param  boolean $footer put in footer
Esempio n. 4
0
// i18n for JS
$jsi18n = array_combine($jsi18nkeys, array_map('i18n_r', $jsi18nkeys));
?>
	<!--[if lt IE 9]><script type="text/javascript" src="//html5shiv.googlecode.com/svn/trunk/html5.js" ></script><![endif]-->
	<?php 
if (!getDef('GSNOHIGHLIGHT', true) || getDef('GSNOHIGHLIGHT') != true) {
    queue_script('gscodeeditor', GSBACK);
}
if ((get_filename_id() == 'snippets' || get_filename_id() == 'edit' || get_filename_id() == 'backup-edit') && getGlobal('HTMLEDITOR')) {
    queue_script('gshtmleditor', GSBACK);
}
if ((get_filename_id() == 'upload' || get_filename_id() == 'filebrowser' || get_filename_id() == 'image') && getDef('GSUSEGSUPLOADER', true)) {
    queue_script('gsuploader', GSBACK);
}
if (get_filename_id() == 'image') {
    queue_script('gscrop', GSBACK);
    queue_style('gscrop', GSBACK);
}
// HTMLEDITOR INIT
// ckeditor editorcss
if (file_exists(GSTHEMESPATH . getGlobal('TEMPLATE') . "/editor.css")) {
    $contentsCss = $SITEURL . getRelPath(GSTHEMESPATH) . getGlobal('TEMPLATE') . '/editor.css';
}
// ckeditor customconfig
if (file_exists(GSTHEMESPATH . getDef('GSEDITORCONFIGFILE'))) {
    $configjs = $SITEURL . getRelPath(GSTHEMESPATH) . getDef('GSEDITORCONFIGFILE');
}
?>

    <script type="text/javascript">
    	// @todo clean this up, use a better bridge to initialize config variables in js
</title>
	<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
	<meta name="generator" content="GetSimple - <?php 
echo GSVERSION;
?>
" />
	<link rel="author" href="humans.txt" />
	<meta name="robots" content="noindex, nofollow">
	<link rel="apple-touch-icon" href="apple-touch-icon.png"/>
	<link rel="stylesheet" type="text/css" href="template/style.php?v=<?php 
echo GSVERSION;
?>
" media="screen" />
	<?php 
if (get_filename_id() == 'menu-manager') {
    queue_script('jquery-ui', GSBACK);
}
?>
	<!--[if IE 6]><link rel="stylesheet" type="text/css" href="template/ie6.css?v=<?php 
echo GSVERSION;
?>
" media="screen" /><![endif]-->
	<?php 
get_scripts_backend();
?>
		
	<script type="text/javascript" src="template/js/jquery.getsimple.js?v=<?php 
echo GSVERSION;
?>
"></script>		
	
Esempio n. 6
0
        register_script('codemirror_js', $SITEURL . 'plugins/blog/js/codemirror/lib/codemirror.js', '1.0', FALSE);
        register_script('codemirror_javascript', $SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/javascript/javascript.js', '1.0', FALSE);
        register_script('codemirror_php', $SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/php/php.js', '1.0', FALSE);
        register_script('codemirror_css_hl', $SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/css/css.js', '1.0', FALSE);
        register_script('codemirror_clike', $SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/clike/clike.js', '1.0', FALSE);
        register_script('codemirror_xml_hl', $SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/xml/xml.js', '1.0', FALSE);
        register_style('codemirror_css', $SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/lib/codemirror.css', GSVERSION, 'screen');
        queue_script(BLOGPLUGINNAME . '_js', GSBACK);
        queue_style(BLOGPLUGINNAME . '_css', GSBACK);
        queue_script('codemirror_js', GSBACK);
        queue_script('codemirror_javascript', GSBACK);
        queue_script('codemirror_php', GSBACK);
        queue_script('codemirror_css', GSBACK);
        queue_script('codemirror_clike', GSBACK);
        queue_script('codemirror_xml_hl', GSBACK);
        queue_script('codemirror_css_hl', GSBACK);
        queue_style('codemirror_css', GSBACK);
    }
} else {
    if (isset($_GET['id']) && $_GET['id'] == BLOGPLUGINID) {
        add_action('header', 'addStyleP', array($SITEURL . '/plugins/' . BLOGPLUGINID . '/css/admin_styles.css'));
        add_action('header', 'addScriptP', array($SITEURL . '/plugins/' . BLOGPLUGINID . '/js/admin_js.js'));
        add_action('header', 'addStyleP', array($SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/lib/codemirror.css'));
        add_action('header', 'addScriptP', array($SITEURL . 'plugins/blog/js/codemirror/lib/codemirror.js'));
        add_action('header', 'addScriptP', array($SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/javascript/javascript.js'));
        add_action('header', 'addScriptP', array($SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/php/php.js'));
        add_action('header', 'addScriptP', array($SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/css/css.js'));
        add_action('header', 'addScriptP', array($SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/clike/clike.js'));
        add_action('header', 'addScriptP', array($SITEURL . '/plugins/' . BLOGPLUGINID . '/js/codemirror/mode/xml/xml.js'));
    }
    function addStyleP($stylesheet)
Esempio n. 7
0
} else {
    add_filter('sitemap', 'nm_update_sitemap_xml');
    // for GetSimple 3.3+
}
if (!defined('NMNOAPIUPDATE') || !NMNOAPIUPDATE) {
    add_action('common', 'nm_update_extend_cache');
}
# scripts (GetSimple 3.1+)
if (function_exists('register_script')) {
    if (isset($_GET['id']) && $_GET['id'] == 'news_manager' && (isset($_GET['edit']) || isset($_GET['settings']))) {
        if (!defined('GSNOCDN') || !GSNOCDN) {
            register_script('jquery-validate', '//ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js', '1.10.0', false);
        } else {
            register_script('jquery-validate', $SITEURL . 'plugins/news_manager/js/jquery.validate.min.js', '1.10.0', false);
        }
        queue_script('jquery-validate', GSBACK);
    }
}
/*******************************************************
 * @function nm_admin
 * @action back-end main function
 */
function nm_admin()
{
    if (nm_env_check()) {
        # post management
        if (isset($_GET['edit'])) {
            nm_edit_post($_GET['edit']);
        } elseif (isset($_POST['post'])) {
            nm_save_post();
            nm_admin_panel();
 /**
  *	Register plugin, hooks, and filters with getSimple
  */
 protected function _register()
 {
     $plugininfo = array($this->_info['id'], $this->_info['name'], $this->_info['version'], $this->_info['author'], $this->_info['author_website'], $this->_info['description'], $this->_info['page_type']);
     if (isset($this->_info['menu_callback'])) {
         $plugininfo[] = array($this, $this->_info['menu_callback']);
     }
     // register plugin
     call_user_func_array('register_plugin', $plugininfo);
     // register actions
     foreach ($this->_actions as $hook => $action) {
         add_action($hook, array($this, $action));
     }
     // register filters
     foreach ($this->_filters as $hook => $filter) {
         add_filter($hook, array($this, $filter));
     }
     // register scripts
     foreach ($this->_scripts as $name => $queue_region) {
         $script_name = $this->_info['id'] . '_' . $name . '_script';
         register_script($script_name, $this->_plugin_url('js/' . $name . '.js'), $this->_info['version'], FALSE);
         queue_script($script_name, $queue_region);
     }
     // register styles
     foreach ($this->_styles as $name => $queue_region) {
         $style_name = $this->_info['id'] . '_' . $name . '_style';
         register_style($style_name, $this->_plugin_url('css/' . $name . '.css'), $this->_info['version'], FALSE);
         queue_style($style_name, $queue_region);
     }
 }
Esempio n. 9
0
    register_script('gcal_js', $SITEURL . 'plugins/gs-events/js/gcal.js', '0.1');
    register_script('lang_all_js', $SITEURL . 'plugins/gs-events/js/lang-all.js', '0.1');
    /**
     *  Register the styles
     **********************************************************************/
    register_style('fullcalendar_css', $SITEURL . 'plugins/gs-events/css/fullcalendar.css', '0.1', 'screen');
    register_style('gs_jqueryui', $SITEURL . 'plugins/gs-events/css/jquery-ui.theme.css', '0.1', 'screen');
    register_style('gs_events_css', $SITEURL . 'plugins/gs-events/css/style.css', '0.1', 'screen');
    /**
     *  Queue the scripts
     **********************************************************************/
    queue_script('moment_js', GSBACK);
    queue_script('gcal_js', GSBACK);
    queue_script('lang_all_js', GSBACK);
    queue_script('fullcalendar_js', GSBACK);
    queue_script('gs_events_js', GSBACK);
    /**
     *  Queue the styles
     **********************************************************************/
    queue_style('fullcalendar_css', GSBACK);
    queue_style('gs_events_css', GSBACK);
}
/**
 * Function responsible for initializing the plugin
 */
function gs_events_init()
{
    /**
     *  Import localization files, default to english
     **********************************************************************/
    // i18n_merge('gs-events') || i18n_merge('gs-events', "en_US");
if (isset($_GET['id']) && $_GET['id'] === $thisfile) {
    /**
     *  Register scripts
     **********************************************************************/
    register_script('datatables_js', '//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js', '1.0');
    register_script('gs_plugin_installer_js', $SITEURL . 'plugins/gs_plugin_installer/js/script.js', '0.1');
    /**
     *  Register the styles
     **********************************************************************/
    register_style('datatables_css', '//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css', '1.0', 'screen');
    register_style('gs_plugin_installer_css', $SITEURL . 'plugins/gs_plugin_installer/css/style.css', '0.1', 'screen');
    /**
     *  Queue the scripts
     **********************************************************************/
    queue_script('datatables_js', GSBACK);
    queue_script('gs_plugin_installer_js', GSBACK);
    /**
     *  Queue the styles
     **********************************************************************/
    queue_style('gs_plugin_installer_css', GSBACK);
    queue_style('datatables_css', GSBACK);
}
/**
 * Function responsible for initializing the plugin
 */
function gs_plugin_installer_init()
{
    /**
     *  Import localization files, default to english
     **********************************************************************/
    i18n_merge('gs_plugin_installer') || i18n_merge('gs_plugin_installer', "en_US");
            $sel = "";
        }
        if ($filename == 'template.php') {
            $templatename = i18n_r('DEFAULT_TEMPLATE');
        } else {
            $templatename = $filenamefull;
        }
        $theme_templates .= '<option ' . $sel . ' value="' . $templatename . '" >' . $templatename . '</option>';
    }
}
$theme_templates .= "</select></span>";
if (!defined('GSNOHIGHLIGHT') || GSNOHIGHLIGHT != true) {
    register_script('codemirror', $SITEURL . 'admin/template/js/codemirror/lib/codemirror-compressed.js', '0.2.0', FALSE);
    register_style('codemirror-css', $SITEURL . 'admin/template/js/codemirror/lib/codemirror.css', 'screen', FALSE);
    register_style('codemirror-theme', $SITEURL . 'admin/template/js/codemirror/theme/default.css', 'screen', FALSE);
    queue_script('codemirror', GSBACK);
    queue_style('codemirror-css', GSBACK);
    queue_style('codemirror-theme', GSBACK);
}
get_template('header', cl($SITENAME) . ' &raquo; ' . i18n_r('THEME_MANAGEMENT'));
?>

<?php 
include 'template/include-nav.php';
if (!defined('GSNOHIGHLIGHT') || GSNOHIGHLIGHT != true) {
    switch (pathinfo($TEMPLATE_FILE, PATHINFO_EXTENSION)) {
        case 'css':
            $mode = 'text/css';
            break;
        case 'js':
            $mode = 'text/javascript';
Esempio n. 12
0
require_once GSPLUGINPATH . $thisfile . '/php/classes/parser.php';
require_once GSPLUGINPATH . $thisfile . '/php/classes/options.php';
require_once GSPLUGINPATH . $thisfile . '/php/classes/imageresize.php';
require_once GSPLUGINPATH . $thisfile . '/php/classes/imageupload.php';
require_once GSPLUGINPATH . $thisfile . '/php/classes/fields.display.php';
require_once GSPLUGINPATH . $thisfile . '/php/classes/fields.manipulate.php';
require_once GSPLUGINPATH . $thisfile . '/php/classes/matrix.php';
require_once GSPLUGINPATH . $thisfile . '/php/classes/search.php';
require_once GSPLUGINPATH . $thisfile . '/php/classes/extended.php';
# initialize matrix
$matrix = new TheMatrix();
# register plugin
register_plugin($matrix->pluginInfo('id'), $matrix->pluginInfo('name'), $matrix->pluginInfo('version'), $matrix->pluginInfo('author'), $matrix->pluginInfo('url'), $matrix->pluginInfo('description'), $matrix->pluginInfo('page'), array($matrix, 'admin'));
# actions & filters
# front-end
queue_script('jquery', GSFRONT);
add_action('error-404', array($matrix, 'doRoute'), array(0));
# back-end
# tab
add_action('nav-tab', 'createNavTab', array($thisfile, $thisfile, i18n_r($thisfile . '/PLUGIN_TITLE'), 'tables'));
# sidebar
add_action($thisfile . '-sidebar', 'createSideMenu', array($thisfile, i18n_r($thisfile . '/TABLES'), 'tables'));
if (isset($_GET['table']) && !empty($_GET['table'])) {
    add_action($thisfile . '-sidebar', 'createSideMenu', array($thisfile, strtoupper($_GET['table']), 'table'));
}
add_action($thisfile . '-sidebar', 'createSideMenu', array($thisfile, i18n_r($thisfile . '/ABOUT'), 'about'));
# both
# javascript
add_action('theme-header', array($matrix, 'themeHeader'), array('front'));
add_action('header', array($matrix, 'themeHeader'), array('back'));
# session (required for undo queries)
if (!getDef('GSNOCDN', true)) {
    register_script('jquery', $GS_script_assets['jquery']['cdn']['url'], $GS_script_assets['jquery']['cdn']['ver'], FALSE);
    register_script('jquery-ui', $GS_script_assets['jquery-ui']['cdn']['url'], $GS_script_assets['jquery-ui']['cdn']['ver'], FALSE);
} else {
    register_script('jquery', $GS_script_assets['jquery']['local']['url'], $GS_script_assets['jquery']['local']['ver'], FALSE);
    register_script('jquery-ui', $GS_script_assets['jquery-ui']['local']['url'], $GS_script_assets['jquery-ui']['local']['ver'], FALSE);
}
register_script('fancybox', $GS_script_assets['fancybox']['local']['url'], $GS_script_assets['fancybox']['local']['ver'], FALSE);
register_style('fancybox-css', $GS_style_assets['fancybox']['local']['url'], $GS_style_assets['fancybox']['local']['ver'], 'screen');
register_script('scrolltofixed', $GS_script_assets['scrolltofixed']['local']['url'], $GS_script_assets['scrolltofixed']['local']['ver'], FALSE);
/**
 * Queue our scripts and styles for the backend
 */
queue_script('jquery', GSBACK);
queue_script('jquery-ui', GSBACK);
queue_script('fancybox', GSBACK);
queue_style('fancybox-css', GSBACK);
/**
 * Include any plugins, depending on where the referring 
 * file that calls it we need to set the correct paths. 
*/
if (file_exists(GSPLUGINPATH)) {
    $pluginfiles = getFiles(GSPLUGINPATH);
}
$pluginsLoaded = false;
// Check if data\other\plugins.xml exists
if (!file_exists(GSDATAOTHERPATH . "plugins.xml")) {
    create_pluginsxml();
}
read_pluginsxml();
// get the live plugins into $live_plugins array
Esempio n. 14
0
}
/**-------------------------------------------------------------------------------------------------
 * Add Hooks & Filters. Register Scripts & Styles
 */
# Hooks & Filters
add_action('index-pretemplate', 'blog_display_posts');
// Displays posts on front end
add_action('theme-header', 'includeRssFeed');
// Add RSS link to site header
add_action('index-pretemplate', 'set_post_description');
// Place excerpt into meta description
add_action('common', 'checkPermissions');
// Check what permission the user has
# Scripts & Styles
register_script('pluginManagementFA', $SITEURL . 'plugins/' . BLOGFILE . '/js/pluginManagementFA.js', '1.0', TRUE);
queue_script('pluginManagementFA', GSBACK);
/**-------------------------------------------------------------------------------------------------
 * formatPostDate($date)
 * Format a date - Left here for backwards compatibility with older code.
 * 
 * @param $date (string) The date to format 
 * @return void (void)
 */
function formatPostDate($date)
{
    $Blog = new Blog();
    return $Blog->get_locale_date(strtotime($date), '%b %e, %Y');
}
/**-------------------------------------------------------------------------------------------------
 * includeRSSFeed()
 * Include RSS Feed (Link is included in header of front end pages)
Esempio n. 15
0
/**
 * Contactable Do Header
 *
 * Registers the required Javascripts and Styles required for the plugin
 * These are setup before the template header is loaded so the get_header call will load them
 * 
 * @since 1.0
 *
 */
function DM_contactable_doheader()
{
    global $SITEURL;
    register_script('contactable', $SITEURL . 'plugins/DM_contactable/js/jquery.contactable.js', '1.2.1', FALSE);
    register_script('contactable-validate', $SITEURL . 'plugins/DM_contactable/js/jquery.validate.pack.js', '1.5.1', FALSE);
    register_style('contactable-css', $SITEURL . 'plugins/DM_contactable/css/contactable.css', '1.2.1', 'screen');
    queue_script('jquery', GSFRONT);
    queue_script('contactable', GSFRONT);
    queue_script('contactable-validate', GSFRONT);
    queue_style('contactable-css', GSFRONT);
}