<?php

$themeObject =& $gCms->variables['admintheme'];
Gallery_utils::UpdateGalleryDB('', 1);
$galleries = Gallery_utils::GetGalleries();
$showgalleries = array();
if (empty($galleries)) {
    $smarty->assign('nogalleriestext', $this->lang("nogalleriestext"));
} else {
    foreach ($galleries as $gallery) {
        $onerow = new stdClass();
        $onerow->id = $gallery['fileid'];
        $onerow->gidclass = $gallery['galleryid'] > 1 ? ' child-of-node-' . $gallery['galleryid'] : '';
        $onerow->file = $this->CreateLink($id, 'editgallery', $returnid, $gallery['fileid'] == 1 ? 'Gallery/' : $gallery['filename'], array('gid' => $gallery['fileid'], 'mode' => "edit"));
        $onerow->dirtag = '{Gallery' . ($gallery['fileid'] == 1 ? '}' : ' dir=\'' . substr($gallery['filepath'] . $gallery['filename'], 0, -1) . '\'}');
        if ($gallery['active']) {
            $activeimage = $themeObject->DisplayImage('icons/system/true.gif', $this->Lang('setfalse'), '', '', 'systemicon');
        } else {
            $activeimage = $themeObject->DisplayImage('icons/system/false.gif', $this->Lang('settrue'), '', '', 'systemicon');
        }
        $onerow->activelink = $this->CreateLink($id, 'multiaction', $returnid, $activeimage, array('multiaction' => 'switchactive', 'gid' => $gallery['galleryid'], 'fid' => $gallery['fileid'], 'origaction' => 'defaultadmin'));
        $onerow->editlink = $this->CreateLink($id, 'editgallery', $returnid, $themeObject->DisplayImage('icons/system/edit.gif', $this->Lang('editgallery'), '', '', 'systemicon'), array('gid' => $gallery['fileid'], 'mode' => "edit"));
        $onerow->deletelink = $this->CheckPermission('Gallery - Edit all galleries') ? $this->CreateLink($id, 'multiaction', $returnid, $gCms->variables['admintheme']->DisplayImage('icons/system/delete.gif', $this->Lang('delete'), '', '', 'systemicon'), array('multiaction' => 'delete', 'gid' => $gallery['galleryid'], 'fid' => $gallery['fileid'], 'origaction' => 'defaultadmin'), $this->Lang('areyousure')) : '';
        $onerow->imgselect = $this->CreateInputCheckbox($id, 'imgselect[' . $gallery['fileid'] . ']', 1);
        if (is_dir('../' . DEFAULT_GALLERY_PATH . $gallery['filepath'] . $gallery['filename']) || $gallery['fileid'] == 1) {
            array_push($showgalleries, $onerow);
        } else {
            // delete directory and all of its contents from the database
            Gallery_utils::DeleteGalleryDB($gallery['filepath'] . $gallery['filename'], $gallery['fileid']);
        }
    }
Ejemplo n.º 2
0
    $smarty->assign('formstart', $this->CreateFormStart($id, 'do_editgallery', $returnid, 'post', '', false, '', $params));
    $smarty->assign('prompt_directoryname', $this->Lang('directoryname'));
    $smarty->assign('directoryname', $this->CreateInputText($id, 'directoryname', "", 40, 100));
    $smarty->assign('gallerytitle', $this->CreateInputText($id, 'gallerytitle', "", 40, 100));
    $smarty->assign('gallerycomment', $this->CreateTextArea($this->GetPreference('use_comment_wysiwyg', 1), $id, "", 'gallerycomment', 'fake" style="height:6em;', '', '', '', '80', '3'));
    if ($this->GetPreference('editdirdates')) {
        $smarty->assign('gallerydate', $this->CreateInputText($id, 'gallerydate', Date('Y-m-d'), 10, 10));
    } else {
        $smarty->assign('gallerydate', "");
    }
    $smarty->assign('hideparentlink', $this->CreateInputCheckbox($id, 'hideparentlink', true));
    $smarty->assign('addgallery', '');
    $smarty->assign('addimages', '');
} else {
    $gallerypath = $galleryinfo['filepath'] . $galleryinfo['filename'];
    Gallery_utils::UpdateGalleryDB($gallerypath, $params['gid']);
    $gallery = Gallery_utils::Getgalleryfiles($gallerypath);
    $folderpath = $this->GetPreference('be_folderpath');
    $showgallery = array();
    $trueimage = $themeObject->DisplayImage('icons/system/true.gif', $this->Lang('setfalse'), '', '', 'systemicon');
    $falseimage = $themeObject->DisplayImage('icons/system/false.gif', $this->Lang('settrue'), '', '', 'systemicon');
    $falseimage2 = $themeObject->DisplayImage('icons/system/false.gif', $this->Lang('noalbumcover'), '', '', 'systemicon');
    // SWFUpload settings
    $ext = explode(',', $this->GetPreference('allowed_extensions', ''));
    $filetypes = '*.' . implode(';*.', $ext);
    $filedesc = ' Images: ' . implode('; ', $ext);
    $filesize = str_replace('M', ' MB', get_cfg_var('post_max_size'));
    $smarty->assign('file_size_limit', $filesize);
    $smarty->assign('file_types', $filetypes);
    $smarty->assign('file_types_description', $filedesc);
    $smarty->assign('msg_complete', '&' . $id . 'module_message=' . rawurlencode($this->Lang('galleryupdated')));