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)); } }
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; }
define('I18N_SETTINGS_FILE', 'i18n_settings.xml'); define('I18N_LANGUAGE_PARAM', 'lang'); # language parameter in URL, e.g. "...?lang=de" define('I18N_SET_LANGUAGE_PARAM', 'setlang'); # parameter to set current language via GET/POST, e.g. "...?setlang=de" define('I18N_LANGUAGE_COOKIE', 'language'); # cookie set, if the user selects a language with the set language param // properties define('I18N_PROP_DEFAULT_LANGUAGE', 'default_language'); define('I18N_PROP_URLS_TO_IGNORE', 'urls-to-ignore'); define('I18N_PROP_PAGES_VIEW', 'pages-view'); $i18n_base_tab = 'pages'; if (basename($_SERVER['PHP_SELF']) == 'load.php' && @$_GET['id'] == 'i18n_base') { $i18n_base_tab = isset($_GET['sitemap']) ? 'theme' : 'pages'; } i18n_load_texts('i18n_base'); # register plugin register_plugin($thisfile, 'I18N Base', '3.2.9', 'Martin Vlcek', 'http://mvlcek.bplaced.net', i18n_r('i18n_base/PLUGIN_DESCRIPTION'), $i18n_base_tab, 'i18n_main'); # activate filter add_action('index-pretemplate', 'i18n_init'); add_action('edit-extras', 'i18n_base_edit'); add_action('pages-sidebar', 'i18n_base_sidebar_item', array($thisfile, i18n_r('i18n_base/PAGES'))); add_action('admin-pre-header', 'i18n_base_admin_pre_header'); // 3.1+ only add_action('header', 'i18n_base_admin_header'); // 3.0+ # always add sidebar action - for adminbar plugin add_action('theme-sidebar', 'i18n_base_sidebar_item', array($thisfile, i18n_r('SIDE_GEN_SITEMAP'), 'sitemap')); if (function_exists('generate_sitemap')) { # patches for sitemap generation (GetSimple 3.1, 3.2) # also use this for GetSimple 3.3, as just using hook sitemap-aftersave would generate the sitemap twice - slow
# show sub tree of current page including children of current page define('I18N_SHOW_NORMAL', I18N_FILTER_MENU | I18N_FILTER_CURRENT | I18N_OUTPUT_MENU); # 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: