コード例 #1
0
ファイル: gs.utils.php プロジェクト: hatasu/appdroid
 /** 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);
             }
         }
     }
 }
コード例 #2
0
ファイル: assets.php プロジェクト: promil23/GetSimpleCMS
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
 * @return bool
 */
function preRegisterScript($id, $config = array(), $CDN = false, $footer = false)
{
コード例 #3
0
ファイル: header.php プロジェクト: kix23/GetSimpleCMS
$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
    	
コード例 #4
0
ファイル: common.php プロジェクト: hatasu/appdroid
        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)
    {
コード例 #5
0
ファイル: gs-events.php プロジェクト: HelgeSverre/gs-events
    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");
    ?>

    <div id='calendar'></div>

コード例 #6
0
 /**
  *	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);
     }
 }
コード例 #7
0
        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';
            break;
        case 'html':
コード例 #8
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");
    /**
     * Initialize our PluginInstaller object
     **********************************************************************/
    $Installer = new PluginInstaller(dirname(__FILE__) . "/gs_plugin_installer/plugin_cache.json");
    /**
コード例 #9
0
    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
if (!is_frontend()) {
コード例 #10
0
Description: Adds extra options to the Pages Overview 
Version: 1.1
Author: Mike Swan
Author URI: http://www.digimute.com/
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
# register plugin
register_plugin($thisfile, 'Page Edit Options', '1.4', 'Mike Swan', 'http://www.digimute.com/', 'Adds extra options to the Page View Screen', 'plugins', '');
# activate hooks
$bt = debug_backtrace();
$shift = count($bt) - 1;
if (pathinfo_filename($bt[$shift]['file']) == "pages") {
    add_action('footer', 'DM_PE_addPageOptions', array());
    register_style('DM_Pageedit', $SITEURL . "plugins/DM_PE_Pageedit/style.css", '1.1', 'screen', FALSE);
    queue_style('DM_Pageedit', GSBACK);
}
function DM_PE_addPageOptions()
{
    $delNonce = get_nonce("delete", "deletefile.php");
    $cloneNonce = get_nonce("clone", "pages.php");
    $menu = "<tr><th>Pages</th><th>Date</th><th>Options</th></tr>";
    $menu .= DM_PE_getPages('', '', 0);
    echo '<script type="text/javascript">
	$("#editpages tr").each(function() {
		$(this).remove();
	})
	$(".hover").hover(
	  function () {
	  	alert(1);
	  	//if (!$(this).hasClass("selected")){
コード例 #11
0
# get correct id for plugin
$thisFile = basename(__FILE__, ".php");
/*************************************
 * Register Plugin
 */
register_plugin($thisFile, 'Open Graph Manager', '0.0.1', 'Danilo Puchelt', 'http://www.github.com/tecmec', 'Add open graph meta tags to your site', 'plugins', 'openGraphConfigure');
/*************************************
 * Merge langugage files
 */
i18n_merge(OGM_SUB_FOLDER, $LANG);
i18n_merge(OGM_SUB_FOLDER, "en_US");
/*************************************
 * Include BE Stylesheet
 */
register_style('ogm', $SITEURL . 'plugins/' . OGM_SUB_FOLDER . '/css/ogm-styles.css', '0.2', 'screen');
queue_style('ogm', GSBACK);
/*************************************
 * Add sidebar action
 */
add_action('plugins-sidebar', 'createSideMenu', array($thisFile, 'Open Graph Manager'));
function openGraphConfigure()
{
    require GSPLUGINPATH . OGM_SUB_FOLDER . '/configure.php';
}
/*************************************
 * Add meta tags to header
 */
add_action('theme-header', 'addMetaTagsToHeader');
function addMetaTagsToHeader()
{
    require GSPLUGINPATH . OGM_SUB_FOLDER . '/output.php';
コード例 #12
0
ファイル: flat-blue.php プロジェクト: hatasu/appdroid
<?php

/*
Plugin Name: FlatBlue Admin Theme
Description: A more modern look for the admin interface in GetSimple CMS
Version: 1.1
Author: PhireWare
Author URI: http://www.phireware.com/
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
# register plugin
register_plugin($thisfile, 'FlatBlue', '1.1', 'PhireWare', 'http://www.phireware.com/', 'A more modern look for the admin interface in GetSimple CMS', 'theme');
register_style('flat-blue', $SITEURL . 'plugins/flat-blue/css/style.css', 1.1, FALSE);
queue_style('flat-blue', GSBACK);
コード例 #13
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);
}