Exemplo n.º 1
0
 public static function getPlugins()
 {
     if (self::$plugins == null) {
         self::$plugins = array();
         $dir_handle = @opendir(GSPLUGINPATH . 'i18n_gallery');
         while ($filename = readdir($dir_handle)) {
             if (substr($filename, 0, 7) == 'plugin_' && strrpos($filename, '.php') === strlen($filename) - 4) {
                 include_once GSPLUGINPATH . 'i18n_gallery/' . $filename;
             }
         }
     }
     return self::$plugins;
 }
Exemplo n.º 2
0
$languages = array();
if (function_exists('return_i18n_default_language')) {
    $dir_handle = @opendir(GSDATAPAGESPATH) or die("Unable to open pages directory");
    while ($filename = readdir($dir_handle)) {
        $pos = strpos($filename, '_');
        if ($pos !== false && strrpos($filename, '.xml') === strlen($filename) - 4 && !is_dir(GSDATAPAGESPATH . $filename)) {
            $language = substr($filename, $pos + 1, strlen($filename) - $pos - 5);
            if (!in_array($language, $languages)) {
                $languages[] = $language;
            }
        }
    }
}
$success = false;
$name = @$_GET['name'];
if (!I18nGallery::checkPrerequisites()) {
    $msg = i18n_r('i18n_gallery/MISSING_DIR');
} else {
    if (isset($_GET['undo']) && !isset($_POST['save'])) {
        $newname = @$_GET['new'] ? $_GET['new'] : $name;
        if (i18n_gallery_save_undo($name, $newname)) {
            $msg = i18n_r('i18n_gallery/UNDO_SUCCESS');
            $success = true;
        } else {
            $msg = i18n_r('i18n_gallery/UNDO_FAILURE');
        }
        $gallery = return_i18n_gallery(@$_GET['name']);
    } else {
        if (isset($_POST['save'])) {
            if (!@$_POST['post-name']) {
                $_POST['post-name'] = clean_url(to7bit(@$_POST['post-title'], 'UTF-8'));
Exemplo n.º 3
0
function i18n_gallery_index($item)
{
    require_once GSPLUGINPATH . 'i18n_gallery/gallery.class.php';
    return I18nGallery::index($item);
}