$rec->filename = $row['filename']; $rec->title = $row['title']; $rec->titlename = empty($row['title']) ? $row['filename'] : $row['title']; $rec->comment = $row['comment']; $rec->active = $row['active']; if ($galleryinfo['thumbwidth'] > 0) { $rec->thumb = DEFAULT_GALLERYTHUMBS_PATH . $row['fileid'] . '-' . $galleryinfo['templateid'] . substr($row['filename'], strrpos($row['filename'], '.')); } else { $rec->thumb = DEFAULT_GALLERY_PATH . $row['filepath'] . IM_PREFIX . $row['filename']; } $rec->isdir = false; $paramslink['dir'] = str_replace('%2F', '/', rawurlencode($row['filepath'])); $prettyurl = $urlprefix . '/' . $paramslink['dir'] . ($targetpage != '' ? $targetpage : $returnid); $rec->galleryid = $row['galleryid']; $rec->gallery_url = $this->CreateFrontendLink($id, $targetpage != '' ? $targetpage : $returnid, 'default', '', $paramslink, '', true, true, '', false, $prettyurl); $rec->fields = Gallery_utils::Getcustomfields($rec->fileid, $rec->isdir, '', 1); $itemcount++; $imgcount++; Gallery_utils::CreateThumbnail($rec->thumb, DEFAULT_GALLERY_PATH . trim($row['filepath'] . '/' . $row['filename'], '/'), $galleryinfo['thumbwidth'] > 0 ? $galleryinfo['thumbwidth'] : IM_THUMBWIDTH, $galleryinfo['thumbwidth'] > 0 ? $galleryinfo['thumbheight'] : IM_THUMBHEIGHT, $galleryinfo['thumbwidth'] > 0 ? $galleryinfo['resizemethod'] : 'sc'); array_push($images, $rec); } } } else { $params['module_message'] = $this->Lang('message_wrongdir', htmlspecialchars($params['dir'])); $smarty->assign('hideparentlink', true); } // Expose the list to smarty. Use "by_ref" to save memory. $smarty->assign_by_ref('images', $images); // and a count of records $smarty->assign('imagecount', $imgcount . ' ' . ($imgcount == 1 ? $this->Lang('image') : $this->Lang('images'))); $smarty->assign('itemcount', $itemcount);
$onerow->thumburl .= '?cache=' . time(); $onerow->defaultthumburl = '../' . DEFAULT_GALLERY_PATH . str_replace('%2F', '/', rawurlencode($file['filepath'] . IM_PREFIX . $file['filename'])) . '?nocache=' . time(); $onerow->thumb = '<img src="' . $onerow->defaultthumburl . '" alt="' . $file['filename'] . '" />'; $onerow->filename_input = $file['filename']; $onerow->title_input = $this->CreateInputText($id, 'filetitle', $file['title'], 30, 100); $onerow->comment = $file['comment']; $onerow->comment_input = $this->CreateTextArea(0, $id, $file['comment'], 'filecomment', 'fake" style="height:4em;', '', '', '', '40', '4'); // class filled with fake and style-info to overrule the theme-css if ($this->GetPreference('editfiledates')) { $onerow->filedate_input = $this->CreateInputText($id, 'filedate', substr($file['filedate'], 0, 10), 10, 10); } else { $onerow->filedate_input = $file['filedate']; } Gallery_utils::CreateThumbnail('../' . DEFAULT_GALLERY_PATH . $file['filepath'] . '/' . IM_PREFIX . $file['filename'], '../' . DEFAULT_GALLERY_PATH . $file['filepath'] . '/' . $file['filename'], IM_THUMBWIDTH, IM_THUMBHEIGHT, 'sc'); $onerow->deletelink = $this->CreateLink($id, 'multiaction', $returnid, $themeObject->DisplayImage('icons/system/delete.gif', $this->Lang('delete'), '', '', 'systemicon'), array('multiaction' => 'delete', 'fid' => $file['fileid'], 'origaction' => 'editgallery'), $this->Lang('areyousure')); $onerow->fields = Gallery_utils::Getcustomfields($params['fid'], 0, $id); $onerow->file .= '?cache=' . filemtime($onerow->file); $smarty->assign('image', $onerow); $smarty->assign('id', $id); $smarty->assign('file', $this->Lang('item')); $smarty->assign('title', $this->Lang('title')); $smarty->assign('comment', $this->Lang('comment')); $smarty->assign('filedate', $this->Lang('date')); $smarty->assign('cover', $this->Lang('albumcover')); $smarty->assign('active', $this->Lang('active')); $smarty->assign('rotateclockwise', $this->CreateLink($id, 'do_rotateimage', $returnid, '<img src="../modules/Gallery/images/clockwise.png" alt="' . $this->Lang('rotateclockwise') . '" title="' . $this->Lang('rotateclockwise') . '" />', array('fid' => $params['fid'], 'degr' => 270))); $smarty->assign('rotateanticlockwise', $this->CreateLink($id, 'do_rotateimage', $returnid, '<img src="../modules/Gallery/images/anticlockwise.png" alt="' . $this->Lang('rotateanticlockwise') . '" title="' . $this->Lang('rotateanticlockwise') . '" />', array('fid' => $params['fid'], 'degr' => 90))); $smarty->assign('formstart', $this->CreateFormStart($id, 'do_editimage', $returnid, 'post', '', false, '', $params)); // edit thumbs $smarty->assign('formstart2', $this->CreateFormStart($id, 'do_editthumb', $returnid, 'post', '', false, '', $params)); $smarty->assign('formend2', $this->CreateFormEnd());
$breadcrumbs = $this->CreateLink($id, 'defaultadmin', $returnid, $this->Lang('list')); $breadcrumbs .= ' / ' . $this->CreateLink($id, 'editgallery', $returnid, 'Gallery', array('gid' => 1, 'mode' => "edit")); foreach ($gallerypatharr as $item) { if (!empty($item)) { $path .= '/' . $item; $galinfo = Gallery_utils::Getgalleryinfo($path); $breadcrumbs .= ' / ' . $this->CreateLink($id, 'editgallery', $returnid, $item, array('gid' => $galinfo['fileid'], 'mode' => "edit")); } } $breadcrumbs .= ' / ' . trim($galleryinfo['filename'], '/'); $smarty->assign('pagetitle', $breadcrumbs); } $smarty->assign('prompt_gallerytitle', $this->Lang('gallerytitle')); $smarty->assign('prompt_comment', $this->Lang('comment')); $smarty->assign('prompt_date', $this->Lang('date')); $smarty->assign('customfields', Gallery_utils::Getcustomfields($params['gid'], 1, $id, FALSE, $permission_to_edit)); // template dropdown field $templatelist = array('- ' . $this->Lang('usedefault') . ' -' => 0); $query = "SELECT templateid, template FROM " . cms_db_prefix() . "module_gallery_templateprops " . ($this->CheckPermission('Modify Templates') ? "" : "WHERE visible=1 ") . "ORDER BY template ASC"; $result = $db->Execute($query); while ($result && ($row = $result->FetchRow())) { $templatelist[$row['template']] = $row['templateid']; } if (count($templatelist) == 1 || count($templatelist) == 2 && array_key_exists($defaulttemplate, $templatelist) || isset($galleryinfo['templateid']) && !in_array($galleryinfo['templateid'], $templatelist)) { $smarty->assign('prompt_template', ''); $smarty->assign('template', $this->CreateInputHidden($id, 'templateid', $galleryinfo['templateid'])); } else { $smarty->assign('prompt_template', $this->Lang('template')); $smarty->assign('template', $this->CreateInputDropdown($id, 'templateid', $templatelist, -1, isset($galleryinfo['templateid']) ? $galleryinfo['templateid'] : 0, $disabled)); } // editors multiselect field