Exemplo n.º 1
0
function load_languages()
{
    global $LANG;
    if (basename($_SERVER['PHP_SELF']) != 'index.php') {
        i18n_merge('calendar', substr($LANG, 0, 2)) || i18n_merge('calendar', 'en');
    }
}
Exemplo n.º 2
0
 public static function outputGallery($gallery, $ignoreQuery = false)
 {
     global $LANG, $i18n_gallery_pic_used;
     include_once GSPLUGINPATH . 'i18n_gallery/helper.php';
     if (function_exists('i18n_load_texts')) {
         i18n_load_texts('i18n_gallery');
     } else {
         i18n_merge('i18n_gallery', substr($LANG, 0, 2)) || i18n_merge('i18n_gallery', 'en');
     }
     $pic = @$gallery['pic'];
     if (!$ignoreQuery && isset($_GET['pic']) && !$i18n_gallery_pic_used) {
         if (strpos($_GET['pic'], ':') === false) {
             $pic = intval($_GET['pic']);
             $i18n_gallery_pic_used = true;
         } else {
             if (substr($_GET['pic'], 0, strrpos($_GET['pic'], ':')) == $gallery['name']) {
                 $pic = intval(substr($_GET['pic'], strrpos($_GET['pic'], ':') + 1));
                 $i18n_gallery_pic_used = true;
             }
         }
     }
     $plugins = i18n_gallery_plugins();
     $plugin = @$plugins[$gallery['type']];
     if ($plugin) {
         call_user_func_array($plugin['content'], array($gallery, $pic));
     }
 }
Exemplo n.º 3
0
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);
}
/**
 * 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");
    /**
     * Run our plugin
     **********************************************************************/
    gs_plugin_installer_main($Installer);
}
Exemplo n.º 5
0
 public static function displayEvents($admin = false)
 {
     global $LANG;
     if (function_exists('i18n_load_texts')) {
         i18n_load_texts('calendar');
     } else {
         i18n_merge('calendar', substr($LANG, 0, 2)) || i18n_merge('my_plugin', 'en');
     }
     require_once GSPLUGINPATH . 'calendar/calendar.class.php';
     $text = '<div class="schedule">';
     $text .= '<div class="cal_title">' . i18n_r('calendar/EVENTS_LIST') . '</div>';
     $text .= '<div class="spacer"></div>';
     $calendar = new Calendar();
     $schedule = $calendar->getSchedule();
     $n = 0;
     foreach ($schedule->dates as $date) {
         $odd = $n % 2 == 0;
         $text .= self::addDate($date, $admin, $odd);
         $n++;
     }
     $text .= '</div>';
     echo $text;
 }
Exemplo n.º 6
0
function satb_automerge($array)
{
    global $LANG;
    // loop plugins for i18n text {}
    // index unique for single merge
    // merge plugin lang files in string for posible lang combinations ( which is inefficient )
    $i18n_merges = array();
    foreach ($array as $menu) {
        # satb_debugLog($menu);
        foreach ($menu as $item) {
            # satb_debugLog($item);
            if (preg_match('/^\\{(.*)\\/(.*)\\}$/', $item['title'], $matches)) {
                # satb_debugLog($item);
                if (isset($matches[1]) and isset($matches[2])) {
                    $i18n_merges[] = trim($matches[1]);
                }
            }
        }
    }
    $i18n_merges = array_unique($i18n_merges);
    foreach ($i18n_merges as $merge) {
        satb_debugLog('satb_automerge_custom', $merge);
        i18n_merge($merge, $LANG);
        i18n_merge($merge, substr($LANG, 0, 2));
        # i18n_merge($matches[1],'en_US');
    }
}
Exemplo n.º 7
0
<?php

/**
 * Basic Page Browser for I18N Custom Fields
 *
 * Displays and selects file link to insert
 */
include '../../../admin/inc/common.php';
$loggedin = cookie_check();
if (!$loggedin) {
    die;
}
include '../../../admin/inc/theme_functions.php';
i18n_merge('i18n_customfields') || i18n_merge('i18n_customfields', 'en_US');
$func = preg_replace('/[^\\w]/', '', @$_GET['func']);
global $SITEURL;
$path_parts = pathinfo($_SERVER['PHP_SELF']);
$sitepath = $SITEURL;
$isI18N = @$_GET['i18n'];
$pages = array();
$dir_handle = @opendir(GSDATAPAGESPATH) or die("Unable to open pages directory");
while ($filename = readdir($dir_handle)) {
    if (strrpos($filename, '.xml') === strlen($filename) - 4 && !is_dir(GSDATAPAGESPATH . $filename)) {
        $data = getXML(GSDATAPAGESPATH . $filename);
        if (!$isI18N || strpos($filename, '_') === false) {
            $url = '' . $data->url;
            if (!isset($pages[$url])) {
                $pages[$url] = array('url' => $url, 'variants' => array());
            }
            $pages[$url]['exists'] = true;
            $pages[$url]['parent'] = (string) $data->parent;
Exemplo n.º 8
0
Version: 1.0
Author: Chris Cagle
Author URI: http://www.cagintranet.com/
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
# register plugin
register_plugin($thisfile, 'Books Manager', '1.0', 'Abdellah Ait Hadji', 'http://www.abdelaithadji.com/', 'Finds email addresses in content and components and "hides" them', 'pages', 'bm_admin');
# hooks
add_filter('content', 'bm_show');
# add a link in the admin tab 'theme'
add_action('pages-sidebar', 'createSideMenu', array($thisfile, 'Books Manager'));
# includes
require_once 'books_manager/inc/common.php';
# language
i18n_merge('books_manager') || i18n_merge('books_manager', 'en_US');
# functions
function bm_admin()
{
    if (nm_env_check()) {
        # book management
        if (isset($_GET['edit'])) {
            bm_edit_book($_GET['edit']);
        } elseif (isset($_POST['book'])) {
            bm_save_book();
            bm_admin_panel();
        } elseif (isset($_GET['delete'])) {
            bm_delete_book($_GET['delete']);
            bm_admin_panel();
        } elseif (isset($_GET['restore'])) {
            bm_restore_book($_GET['restore']);
Exemplo n.º 9
0
        // fallback to first lang found
        $LANG = basename($filenames[0], ".php");
    }
}
i18n_merge(null);
// load $LANG file into $i18n
// Merge in default lang to avoid empty lang tokens
// if GSMERGELANG is undefined or false merge en_US else merge custom
if (getDef('GSMERGELANG', true) !== false and !getDef('GSMERGELANG', true)) {
    if ($LANG != 'en_US') {
        i18n_merge(null, "en_US");
    }
} else {
    // merge GSMERGELANG defined lang if not the same as $LANG
    if ($LANG != getDef('GSMERGELANG')) {
        i18n_merge(null, getDef('GSMERGELANG'));
    }
}
/** 
 * Init Editor globals
 * @uses $EDHEIGHT
 * @uses $EDLANG
 * @uses $EDTOOL js array string | php array | 'none' | ck toolbar_ name
 * @uses $EDOPTIONS js obj param strings, comma delimited
 */
if (defined('GSEDITORHEIGHT')) {
    $EDHEIGHT = GSEDITORHEIGHT . 'px';
} else {
    $EDHEIGHT = '500px';
}
if (defined('GSEDITORLANG')) {
Exemplo n.º 10
0
<?php

/* Custom Menu */
# thisfile
$thisfile = basename(__FILE__, '.php');
# language
i18n_merge($thisfile) || i18n_merge($thisfile, 'en_US');
# requires
require_once GSPLUGINPATH . $thisfile . '/php/class.php';
# class instantiation
$custommenu = new customMenu();
# register plugin
register_plugin($custommenu->info('id'), $custommenu->info('name'), $custommenu->info('version'), $custommenu->info('author'), $custommenu->info('url'), $custommenu->info('description'), $custommenu->info('page'), array($custommenu, 'admin'));
# activate actions/filters
# front-end
add_action('theme-header', array($custommenu, 'themeHeader'));
# back-end
if (isset($_GET['id']) && $_GET['id'] == customMenu::FILE) {
    add_action('header', array($custommenu, 'header'));
}
add_action($custommenu->info('page') . '-sidebar', 'createSideMenu', array($custommenu->info('id'), $custommenu->info('sidebar')));
// sidebar link
add_filter('content', array($custommenu, 'content'));
# functions
function get_custom_menu($name, $classes = array())
{
    $menu = new CustomMenuDisplay($name, $classes);
}
Exemplo n.º 11
0
Author URI: http://profileyourcity.com
Modified Version Of Mvlcek's Plugin
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
if (file_exists('ITEMSFILE')) {
    $item_manager_file = getXML(GSDATAOTHERPATH . 'item_manager.xml');
    global $item_title;
    $item_title = $item_manager_file->item->title;
} else {
    global $item_title;
    $item_title = "Item";
}
# register plugin
register_plugin($thisfile, 'Custom Fields For Items', '1.0', 'PYC', 'http://profileyourcity.com/', 'Manages Custom Fields For The Items Manager - Modified Version of Mvlcek\'s Plugin', 'pages', 'items_customfields_configure');
i18n_merge('items') || i18n_merge('items', 'en_US');
add_action('header', 'items_customfields_header');
// add hook to create styles for custom field editor.
require_once GSPLUGINPATH . 'items/common.php';
$im_customfield_def = null;
function items_customfields_header()
{
    if (!file_exists(GSDATAOTHERPATH . 'plugincustomfields.xml')) {
        $xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
        $xml->asXML(GSDATAOTHERPATH . 'plugincustomfields.xml');
        return true;
    }
    ?>
  <style type="text/css">
    form #metadata_window table.formtable td .cke_editor td:first-child { padding: 0; }
    form #metadata_window table.formtable .cke_editor td.cke_top { border-bottom: 1px solid #AAAAAA; }
Exemplo n.º 12
0
<?php

/*
DISCLAIMER - When I initially created this plugin I had very little knowledge of php and was a programming noob. I know it is in need of a rewrite and I will get around to it at some point --

Plugin Name: Multi User
Description: Adds Multi-User Management Section'
Version: 1.8.2
Author: Mike Henken
Author URI: http://michaelhenken.com/
*/
// get correct id for plugin
$thisfile = basename(__FILE__, ".php");
# add in this plugin's language file
i18n_merge('user-managment') || i18n_merge('user-managment', 'en_US');
// register plugin
register_plugin($thisfile, 'Multi User', '1.8.2', 'Mike Henken', 'http://www.michaelhenken.com/', i18n_r('user-managment/PLUGIN_DESCRIPTION'), 'settings', 'mm_admin');
// activate hooks //
//Add Sidebar Item In Settings Page
add_action('settings-sidebar', 'createSideMenu', array($thisfile, i18n_r('user-managment/SIDEBAR')));
//Make the multiuser_perm() function run before each admin page loads
add_action('header', 'mm_permissions');
add_action('settings-user', 'mm_gs_settings_pg');
add_action('settings-user-extras', 'settings_form_data');
define('MULTIUSERPLUGINFOLDER', GSPLUGINPATH . 'user-managment/');
class MultiUser
{
    public function __construct()
    {
        $old_add_file = GSPLUGINPATH . 'user-managment-add.php';
        if (file_exists($old_add_file)) {
Exemplo n.º 13
0
 * @global  (str) $LANG       language for auth user
 */
// grab cookie user data from userid.xml
global $datau, $USR, $HTMLEDITOR, $USRTIMEZONE, $USRLANG;
extract(getUserData(true));
/**
 * Global Language Data
 *
 * @global  (array) $i18n i18n token keyed translation array
 * @global  (str) $LANG  IETF langcode (w/underscore delim) [tag]_[subtag]
 */
global $i18n, $LANG;
// load language
$LANG = getDefaultLang();
// set global language from config heirarchy
i18n_merge(null);
// load $LANG file into $i18n
i18n_mergeDefault();
// load GSDEFAULTLANG or GSMERGELANG lang into $i18n to override ugly missing {} tokens if set
//save php locale
setOldLocale();
/**
 * Globals for salt and authentication data
 *
 * @global (obj) $dataa,       authorization xml raw obj from GSDATAOTHERPATH.GSAUTHFILE
 * @global (str) $SALT,        salt from gsconfig else authorization file
 * @global (str) $SESSIONHASH  used for stateless session confirmation, or as non-expiring nonce for certain operations
 */
global $dataa, $SALT, $SESSIONHASH;
// grab authorization and security data fatal fail if salt is not set
$SALT = getDefaultSalt();
Exemplo n.º 14
0
<?php

/*
 Plugin Name: GetSimple Contact
 Description: Simple contact form plugin for GetSimple
 Version: 1.3.0
 Author: Kolyok
 Author URI: http://get-simple.info/forums/member.php?action=profile&uid=7989
*/
$thisfile_sc = basename(__FILE__, ".php");
i18n_merge($thisfile_sc) || i18n_merge($thisfile_sc, 'en_US');
$sc_language = sc_language();
register_plugin($thisfile_sc, sc_i18n($thisfile_sc, $sc_language, 'SC_TITLE'), '1.3.0', 'Kolyok', 'http://get-simple.info/forums/member.php?action=profile&uid=7989', sc_i18n($thisfile_sc, $sc_language, 'SC_DESC'), 'plugins', 'sc_backend');
add_action('plugins-sidebar', 'createSideMenu', array($thisfile_sc, sc_i18n($thisfile_sc, $sc_language, 'SC_TITLE_ADMIN')));
add_action('index-pretemplate', 'sc_generate_token');
add_filter('content', 'sc_frontend');
define('SC_SMTPSALT', 'AfwoZCSlrcdyN_RzzC');
define('SC_SMTPPEPPER', 'Zh%7Qyar-WZH-i8%%w');
$settings_file = GSDATAOTHERPATH . 'getsimple_contact_settings.xml';
$settings_update = array('CAPTCHA_TYPE' => array('captcha_type' => 0), 'RECAPTCHA_STATUS' => array('recaptcha_status' => 0), 'SUPERADMIN_NAME' => array('superadmin_name' => 'Superadmin Name'), 'SUPERADMIN_EMAIL' => array('superadmin_email' => '*****@*****.**'), 'WYSIHTML5_EDITOR' => array('wysihtml5_editor' => 1), 'CC_STATUS' => array('cc_status' => 0), 'ATTACHMENTS_STATUS' => array('attachments_status' => 0), 'SMTP_STATUS' => array('smtp_status' => 0), 'SMTP_HOST' => array('smtp_host' => 'localhost'), 'SMTP_PORT' => array('smtp_port' => 25), 'SMTP_AUTH' => array('smtp_auth' => 0), 'SMTP_USERNAME' => array('smtp_username' => ''), 'SMTP_PASSWORD' => array('smtp_password' => ''));
sc_be_update_settings($settings_update);
function sc_backend()
{
    if (isset($_POST) && $_POST) {
        sc_save_settings($_POST);
        echo sc_be_content();
    } else {
        echo sc_be_content();
    }
}
function sc_frontend($content)
Exemplo n.º 15
0
<?php

/*
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, GSDEFAULTLANG);
# 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');
$hidemenu = true;
# hooks
# enable side menu is theme is innovation or on theme page and enabling innovation, handle plugin exec before global is set
if (!$hidemenu || ($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;
Exemplo n.º 16
0
Author: Martin Vlcek
Author URI: http://mvlcek.bplaced.net
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
define('I18N_GALLERY_DIR', 'i18n_gallery/');
define('I18N_GALLERY_DEFAULT_TYPE', 'prettyphoto');
define('I18N_GALLERY_DEFAULT_THUMB_WIDTH', 160);
define('I18N_GALLERY_DEFAULT_THUMB_HEIGHT', 120);
# register plugin
register_plugin($thisfile, 'I18N Gallery', '2.2.1', 'Martin Vlcek', 'http://mvlcek.bplaced.net', 'Display image galleries (I18N enabled)', 'i18n_gallery', 'i18n_gallery_main');
# load i18n texts
if (basename($_SERVER['PHP_SELF']) != 'index.php') {
    // back end only
    i18n_merge('i18n_gallery', substr($LANG, 0, 2));
    i18n_merge('i18n_gallery', 'en');
}
$i18n_gallery_on_page = null;
$i18n_gallery_pic_used = false;
# activate filter
add_action('header', 'i18n_gallery_header');
add_action('nav-tab', 'createNavTab', array('i18n_gallery', $thisfile, i18n_r('i18n_gallery/TAB'), 'overview'));
add_action('i18n_gallery-sidebar', 'createSideMenu', array($thisfile, i18n_r('i18n_gallery/GALLERIES'), 'overview'));
add_action('i18n_gallery-sidebar', 'createSideMenu', array($thisfile, i18n_r('i18n_gallery/CREATE_GALLERY'), 'create'));
add_action('i18n_gallery-sidebar', 'createSideMenu', array($thisfile, i18n_r('i18n_gallery/EDIT_GALLERY'), 'edit', false));
add_action('i18n_gallery-sidebar', 'createSideMenu', array($thisfile, i18n_r('i18n_gallery/SETTINGS'), 'configure'));
add_action('index-pretemplate', 'i18n_gallery_preview');
add_action('theme-header', 'i18n_gallery_theme_header');
add_filter('content', 'i18n_gallery_content');
add_filter('search-index-page', 'i18n_gallery_index');
function i18n_gallery_is_frontend()
Exemplo n.º 17
0
- Livefyre
- Facebook connect

*Can optionally override the page information so this call can be used
in external plugins like the News manager.
*Supports i18n language files
*Russian and German translations provided (Thanks Oleg and Connie)

Version: 0.9
Author: Rob Antonishen
Author URI: http://ffaat.poweredbyclear.com/
*/
# get correct id for plugin
$thisfile = basename(__FILE__, '.php');
#load internationalzation
i18n_merge('external_comments') || i18n_merge('external_comments', 'en_US');
# register plugin
register_plugin($thisfile, 'External Comments', '0.9', 'Rob Antonishen', 'http://ffaat.poweredbyclear.com', 'Provides external comments support', 'plugins', 'external_comments_config');
# global vars
$external_comments_conf = external_comments_loadconf();
# activate filter
add_filter('content', 'external_comments_display');
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, 'External Comments'));
add_action('theme-header', 'external_comments_header', array());
/* Inject meta code for facebook admin and VK into header as necessary */
function external_comments_header()
{
    global $external_comments_conf, $data_index;
    if (strpos($data_index->content, '(% external_comments %)') !== false && $external_comments_conf['provider'] == 'facebook') {
        echo '<meta property="fb:admins" content="' . $external_comments_conf['shortname'] . '" />' . "\n";
    }
Exemplo n.º 18
0
# show all menu entries independent of current page
define('I18N_SHOW_MENU', I18N_FILTER_MENU | I18N_OUTPUT_MENU);
# show all pages whether they are in the menu or not
define('I18N_SHOW_PAGES', I18N_FILTER_NONE | I18N_OUTPUT_MENU);
# like I18N_SHOW_NORMAL, but only pages available in current language
define('I18N_SHOW_LANGUAGE', I18N_FILTER_MENU | I18N_FILTER_CURRENT | I18N_FILTER_LANGUAGE | I18N_OUTPUT_MENU);
# show all pages whether they are in the menu or not, but show titles
define('I18N_SHOW_TITLES', I18N_FILTER_NONE | I18N_OUTPUT_TITLE);
# filter navigation items (vetoed items are removed from navigation)
#  - parameters: $url, $parent, $tags (tags as array)
#  - must return true, if item should not be included in the navigation
define('I18N_FILTER_VETO_NAV_ITEM', 'http://mvlcek/de/get-simple/i18nnavigation-veto');
if (function_exists('i18n_load_texts')) {
    i18n_load_texts('i18n_navigation');
} else {
    i18n_merge('i18n_navigation') || i18n_merge('i18n_navigation', 'en_US');
}
# register plugin
register_plugin($thisfile, 'I18N Navigation', '3.2.8', 'Martin Vlcek', 'http://mvlcek.bplaced.net', i18n_r('i18n_navigation/PLUGIN_DESCRIPTION'), 'pages', 'i18n_navigation');
# activate filter
add_action('edit-extras', 'i18n_navigation_edit');
add_action('html-editor-init', 'i18n_navigation_editor');
add_action('changedata-save', 'i18n_navigation_save');
add_action('page-delete', 'i18n_clear_cache');
// GetSimple 3.0+
add_action('pages-sidebar', 'createSideMenu', array($thisfile, i18n_r('i18n_navigation/EDIT_NAVIGATION')));
add_action('index-pretemplate', 'i18n_check_redirect');
add_action('header', 'i18n_navigation_admin_header');
# workaround for page-delete in GetSimple 2.03:
if (!function_exists('get_site_version') && basename($_SERVER['PHP_SELF']) == 'deletefile.php') {
    i18n_clear_cache();
Exemplo n.º 19
0
<?php

/*
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
Exemplo n.º 20
0
<?php

/*
Plugin Name: Send Anonymous Data
Description: GetSimple needs your anonymous data so we can understand our users better
Version: 1.0
Author: Chris Cagle
Author URI: http://get-simple.info/
*/
# get correct id for plugin
$thisfile_anony = basename(__FILE__, ".php");
# add in this plugin's language file
i18n_merge($thisfile_anony) || i18n_merge($thisfile_anony, 'en_US');
# register plugin
register_plugin($thisfile_anony, i18n_r($thisfile_anony . '/ANONY_TITLE'), '1.0', 'Chris Cagle', 'http://get-simple.info/', i18n_r($thisfile_anony . '/ANONY_DESC'), $thisfile_anony, 'gs_anonymousdata');
# activate hooks
add_action('plugins-sidebar', 'createSideMenu', array($thisfile_anony, i18n_r($thisfile_anony . '/ANONY_TITLE')));
add_action($thisfile_anony . '-sidebar', 'createSideMenu', array("", i18n_r("CANCEL")));
if (!function_exists('get_tld_from_url')) {
    function get_tld_from_url($url)
    {
        $tld = null;
        $url_parts = parse_url((string) $url);
        if (is_array($url_parts) && isset($url_parts['host'])) {
            $host_parts = explode('.', $url_parts['host']);
            if (is_array($host_parts) && count($host_parts) > 0) {
                $tld = array_pop($host_parts);
            }
        }
        return $tld;
    }
<?php

/*
Plugin Name: Page Read Only
Description: Limit ability to edit and save page via admin interface
Version: 1.0
Author: Dmitry Yakovlev
Author URI: http://dimayakovlev.ru/
*/
i18n_merge('PageReadOnly') || i18n_merge('PageReadOnly', 'en_US');
register_plugin('PageReadOnly', 'Page Read Only', '1.0', 'Dmitry Yakovlev', 'http://dimayakovlev.ru', i18n_r('PageReadOnly/DESCRIPTION'), '', '');
add_action('edit-extras', function () {
    global $data_edit;
    if (is_object($data_edit) && !empty($data_edit->readOnly)) {
        ?>
<script>
  $( document ).ready(function() {
    $("#editform :input").attr("disabled", true);
    $("#page_submit, #dropdown").remove();
    $('#editform').prepend('<div class="notify page-read-only-notify" style="display:block;"><?php 
        i18n('PageReadOnly/NOTIFICATION');
        ?>
</div>');
    $('.page-read-only-notify').fadeOut(500).fadeIn(500);
  })
</script>
<?php 
    }
});
add_action('pages-main', function () {
    global $pagesArray;
Exemplo n.º 22
0
#  - parameters: $item (of type I18nSearchResultItem or I18nSearchResultPage)
#  - must return true, if item should not be included in search results
define('I18N_FILTER_VETO_SEARCH_ITEM', 'search-veto');
# filter to display a search item
#  - parameters: $item, $showLanguage, $showDate, $dateFormat, $numWords
#                (item is of type I18nSearchResultItem, dateFormat for strftime)
#  - if the function handles the item, it must output the HTML
#  - must return true, if item was handled, false otherwise
define('I18N_FILTER_DISPLAY_ITEM', 'search-display');
# register plugin
register_plugin($thisfile, 'I18N Search', '2.12', 'Martin Vlcek', 'http://mvlcek.bplaced.net', 'Search (I18N enabled!)', 'plugins', 'i18n_search_configure');
# load i18n texts
if (basename($_SERVER['PHP_SELF']) != 'index.php') {
    // back end only
    i18n_merge('i18n_search', substr($LANG, 0, 2));
    i18n_merge('i18n_search', 'en');
}
# ===== BACKEND =====
add_action('changedata-save', 'delete_i18n_search_index');
add_action('page-delete', 'delete_i18n_search_index');
// GetSimple 3.0+
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, i18n_r('i18n_search/CONFIGURE')));
# ===== FRONTEND =====
add_action('index-pretemplate', 'i18n_search_pretemplate_for_rss');
add_action('index-pretemplate', 'i18n_search_pretemplate_for_mark');
add_action('theme-header', 'i18n_search_header_for_rss');
add_filter('content', 'i18n_search_content');
add_filter('search-index-page', 'i18n_search_index_page');
# ===== BACKEND HOOKS =====
# workaround for page-delete in GetSimple 2.03:
if (basename($_SERVER['PHP_SELF']) == 'deletefile.php') {
Exemplo n.º 23
0
function i18n_load_texts($plugin)
{
    global $LANG, $language;
    if (basename($_SERVER['PHP_SELF']) == 'index.php') {
        // frontend language with I18N plugin is always two characters long
        i18n_merge($plugin, $language) || i18n_merge($plugin, return_i18n_default_language()) || i18n_merge($plugin, 'en');
    } else {
        i18n_merge($plugin, $LANG) || strlen($LANG) > 2 && i18n_merge($plugin, substr($LANG, 0, 2)) || i18n_merge($plugin, 'en_US') || i18n_merge($plugin, 'en');
    }
}
 */
# define subfolder path
define('OGM_SUB_FOLDER', 'open-graph-manager');
# define subfolder path
define('OGM_SETTINGS_FILE', 'open-graph-manager.xml');
# 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
Exemplo n.º 25
0
<?php

/** GetSimple CMS Nibbler Verification 
* Web site: http://www.digimute.com/
* @version  1.0
* @author   mike@digimute.com
*
* original by Stephan Gerlach, http://blog.silktide.com/2012/02/verify-your-site-in-nibbler-with-wordpress-plugin/ 
*/
# get correct id for plugin
$thisfile_nibbler = basename(__FILE__, '.php');
$DM_nibbler_config_file = GSDATAOTHERPATH . 'nibbler.xml';
# add in this plugin's language file
i18n_merge($thisfile_nibbler) || i18n_merge($thisfile_nibbler, 'en_US');
# register plugin
register_plugin($thisfile_nibbler, 'Nibbler Verification', '1.0', 'Mike Swan', 'http://www.digimute.com/', 'Adds nibbler verification code to a website', 'plugins', 'DM_nibbler_init');
add_action('plugins-sidebar', 'createSideMenu', array($thisfile_nibbler, 'Nibbler Config'));
add_action('theme-header', 'DM_add_Nibbler_code', array());
if (file_exists($DM_nibbler_config_file)) {
    $x = getXML($DM_nibbler_config_file);
    $nibblercode = $x->nibblercode;
} else {
    $nibblercode = '';
    $xml = @new SimpleXMLElement('<item></item>');
    $xml->addChild('nibblercode', '');
    $xml->asXML($DM_nibbler_config_file);
}
function DM_add_Nibbler_code()
{
    global $nibblercode;
    if ($nibblercode != '') {
Exemplo n.º 26
0
 * Author URI: https://www.johnstray.com/
 */
# Define some important stuff
define('BLOGFILE', basename(__FILE__, ".php"));
define('BLOGPLUGINNAME', i18n_r(BLOGFILE . '/PLUGIN_TITLE'));
define('BLOGEXTENDID', '810');
define('BLOGVERSION', '3.3.1');
require_once BLOGFILE . '/inc/common.php';
# add in this plugin's language file
if (file_exists(BLOGSETTINGS)) {
    $settings_lang = getXML(BLOGSETTINGS);
    $GSBLOGLANG = $settings_lang->lang;
} else {
    $GSBLOGLANG = "en_US";
}
i18n_merge(BLOGFILE) || i18n_merge(BLOGFILE, "en_US");
# register plugin
register_plugin(BLOGFILE, i18n_r(BLOGFILE . '/PLUGIN_TITLE'), BLOGVERSION, 'John Stray', 'https://www.johnstray.id.au/get-simple/plug-ins/gs-blog-3/', i18n_r(BLOGFILE . '/PLUGIN_DESC'), 'blog', 'blog_admin_controller');
# Tab/Sidebar Actions
add_action('nav-tab', 'createNavTab', array('blog', BLOGFILE, i18n_r(BLOGFILE . '/BLOG_TAB_BUTTON'), 'manage'));
add_action('blog-sidebar', 'createSideMenu', array(BLOGFILE, i18n_r(BLOGFILE . '/MANAGE_POSTS_BUTTON'), 'manage'));
add_action('blog-sidebar', 'createSideMenu', array(BLOGFILE, i18n_r(BLOGFILE . '/CATEGORIES_BUTTON'), 'categories'));
add_action('blog-sidebar', 'createSideMenu', array(BLOGFILE, i18n_r(BLOGFILE . '/RSS_HEADER'), 'auto_importer'));
add_action('blog-sidebar', 'createSideMenu', array(BLOGFILE, i18n_r(BLOGFILE . '/SETTINGS_BUTTON'), 'settings'));
add_action('blog-sidebar', 'createSideMenu', array(BLOGFILE, i18n_r(BLOGFILE . '/UPDATE_BUTTON'), 'update'));
add_action('blog-sidebar', 'createSideMenu', array(BLOGFILE, i18n_r(BLOGFILE . '/HELP_BUTTON'), 'help'));
add_action('index-pretemplate', 'set_blog_title', array());
# Register/Queue Styles
register_style(BLOGFILE . '_css', $SITEURL . '/plugins/' . BLOGFILE . '/css/admin_styles.css', '1.0', 'screen');
register_style('font_awesome', '//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', '4.2.0', 'all');
queue_style(BLOGFILE . '_css', GSBACK);
Exemplo n.º 27
0
Version: 3.2.2
Original author: Rogier Koppejan
Updated by: Carlos Navarro
*/
# plugin version
define('NMVERSION', '3.2.2');
# get correct id for plugin
$thisfile = basename(__FILE__, '.php');
# register plugin
register_plugin($thisfile, 'News Manager', NMVERSION, 'Rogier Koppejan, Carlos Navarro', 'http://newsmanager.c1b.org/', 'A blog/news plugin for GetSimple', 'pages', 'nm_admin');
# includes
require_once GSPLUGINPATH . 'news_manager/inc/common.php';
# language
if (basename($_SERVER['PHP_SELF']) != 'index.php') {
    // back end only
    i18n_merge('news_manager') || i18n_merge('news_manager', nm_get_fallback_lang());
}
# hooks
add_action('pages-sidebar', 'createSideMenu', array($thisfile, i18n_r('news_manager/PLUGIN_NAME')));
add_action('header', 'nm_header_include');
add_action('index-pretemplate', 'nm_frontend_init');
add_action('theme-header', 'nm_restore_page_title');
//add_filter('content', 'nm_site'); // deprecated
if (!function_exists('generate_sitemap')) {
    add_action('sitemap-additem', 'nm_sitemap_include');
    // GetSimple 3.0
} else {
    add_filter('sitemap', 'nm_update_sitemap_xml');
    // for GetSimple 3.3+
}
if (!defined('NMNOAPIUPDATE') || !NMNOAPIUPDATE) {
Exemplo n.º 28
0
Description: Change rates for the camping
Version: 1.0.0
Author: Camping le Quebecois
Author URI: http://www.campinglequebecois.qc.ca
*/
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");
define('RATES_DIR', 'rates/');
define('RATES_FILENAME', 'rates');
# register plugin
register_plugin($thisfile, 'Rates', '1.0.0', 'Camping le Quebecois', 'http://www.campinglequebecois.qc.ca', 'Change rates for the camping', 'rates', 'rates_main');
# load i18n texts
if (basename($_SERVER['PHP_SELF']) != 'index.php') {
    // back end only
    i18n_merge('rates', substr($LANG, 0, 2));
    i18n_merge('rates', 'en');
}
# activate filter
add_action('header', 'rates_header');
add_action('footer', 'rates_footer');
add_action('nav-tab', 'createNavTab', array('rates', $thisfile, i18n_r('rates/TAB'), 'edit'));
# ===== BACKEND PAGES =====
function rates_register($type, $name, $description, $edit_function, $header_function, $content_function)
{
    require_once GSPLUGINPATH . 'rates/rates.class.php';
    return Rates::registerPlugin($type, $name, $description, $edit_function, $header_function, $content_function);
}
function rates_main()
{
    if (isset($_GET['edit'])) {
        include GSPLUGINPATH . 'rates/edit.php';
Exemplo n.º 29
0
/**
 * Merge GSMERGELANG, a fallback language, into i18n
 * This is a default lang to load after the custom lang to
 * avoid empty lang tokens not found in the custom lang
 *
 * @since 3.4
 * @global $LANG
 */
function i18n_mergeDefault()
{
    global $LANG;
    // Merge in default lang to avoid empty lang tokens
    // if GSMERGELANG is undefined or false merge GSDEFAULTLANG else merge custom
    if (getDef('GSMERGELANG', true) !== false and !getDef('GSMERGELANG', true)) {
        if ($LANG != GSDEFAULTLANG) {
            i18n_merge(null, GSDEFAULTLANG);
        }
    } else {
        // merge GSMERGELANG defined lang if not the same as $LANG
        if ($LANG != getDef('GSMERGELANG')) {
            i18n_merge(null, getDef('GSMERGELANG'));
        }
    }
}
Exemplo n.º 30
0
<?php

$thisfile = basename(__FILE__, ".php");
define('BLOGFILE', $thisfile);
define('BLOGPLUGINNAME', i18n_r(BLOGFILE . '/PLUGIN_TITLE'));
require_once "blog/inc/common.php";
# add in this plugin's language file
if (file_exists(BLOGSETTINGS)) {
    $settings_lang = getXML(BLOGSETTINGS);
    $GSBLOGLANG = $settings_lang->lang;
} else {
    $GSBLOGLANG = "en_US";
}
i18n_merge($thisfile) || i18n_merge($GSBLOGLANG);
# register plugin
register_plugin($thisfile, i18n_r(BLOGFILE . '/PLUGIN_TITLE'), '1.5', 'Mike Henken', 'http://michaelhenken.com/', i18n_r(BLOGFILE . '/PLUGIN_DESC'), 'pages', 'blog_admin_controller');
add_action('pages-sidebar', 'createSideMenu', array($thisfile, i18n_r(BLOGFILE . '/PLUGIN_SIDE')));
/** 
* Handles conditionals for admin functions
* 
* @return void
*/
function blog_admin_controller()
{
    $Blog = new Blog();
    getBlogUserPermissions();
    global $blogUserPermissions;
    showAdminNav();
    if (isset($_GET['edit_post']) && $blogUserPermissions['blogeditpost'] == true) {
        editPost($_GET['edit_post']);
    } elseif (isset($_GET['create_post']) && $blogUserPermissions['blogcreatepost'] == true) {