From 15e2f752ee6a6528614bf057c8a9808f9bcbc222 Mon Sep 17 00:00:00 2001 From: "Duck (Jakob Munih)" Date: Mon, 26 Jan 2009 00:47:48 +0100 Subject: [PATCH] Missig commits --- news/add.php | 376 ++++++++++++++++++----------- news/admin/tabs.php | 6 +- news/browse.php | 17 +- news/cloud.php | 23 +- news/config/conf.xml | 6 +- news/content.php | 12 +- news/content_edit.php | 14 +- news/delete.php | 58 +++-- news/diff.php | 14 +- news/edit.php | 63 ++--- news/feed.php | 17 +- news/files.php | 107 +++++---- news/index.php | 9 +- news/lib/Block/categories.php | 5 +- news/lib/Block/category.php | 6 +- news/lib/Block/jonah.php | 5 +- news/lib/Block/last.php | 6 +- news/lib/Block/last_blogs.php | 4 +- news/lib/Block/last_comments.php | 7 +- news/lib/Block/most_commented.php | 6 +- news/lib/Block/most_read.php | 6 +- news/lib/Block/my_comments.php | 6 +- news/lib/Block/sources.php | 5 +- news/lib/Block/tags_cloud.php | 3 +- news/lib/Categories.php | 13 +- news/lib/Forms/Search.php | 23 +- news/lib/News.php | 255 +++++++++++++------- news/lib/TagCloud.php | 4 +- news/lib/View.php | 34 +-- news/lib/api.php | 20 +- news/lib/base.php | 4 +- news/lib/version.php | 1 - news/mail.php | 28 +-- news/news.php | 25 +- news/note.php | 25 +- news/po/news.pot | 350 ++++++++++++++++----------- news/po/sl_SI.po | 459 +++++++++++++++++++++--------------- news/print.php | 13 +- news/reads.php | 13 +- news/rss/comments.php | 7 +- news/rss/index.php | 2 +- news/rss/news.php | 13 +- news/scripts/sql/news.mysql.sql | 86 +++---- news/search.php | 18 +- news/templates/block/news.php | 4 +- news/templates/block/titles.php | 2 +- news/templates/browse/header.inc | 2 +- news/templates/browse/row.inc | 2 +- news/templates/categories/index.php | 4 +- news/templates/edit/info.php | 9 +- news/templates/edit/row.php | 14 +- news/templates/news/attachments.php | 2 +- news/templates/news/blog.php | 2 +- news/templates/news/news.php | 7 +- news/templates/news/parents.php | 2 +- news/templates/news/tools.php | 13 +- news/templates/sources/index.php | 2 +- news/trackback.php | 12 +- 58 files changed, 1271 insertions(+), 980 deletions(-) delete mode 100755 news/lib/version.php diff --git a/news/add.php b/news/add.php index bc1539f11..f095f5fb3 100644 --- a/news/add.php +++ b/news/add.php @@ -2,19 +2,16 @@ /** * Add * - * Copyright 2006 Duck + * $Id: add.php 1186 2009-01-21 10:24:00Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: add.php 750 2008-08-19 06:03:03Z duck $ - * - * @author Duck + * @author Duck * @package News */ -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; +require_once 'Horde/Variables.php'; /** * This routine removes all attributes from a given tag except @@ -59,24 +56,69 @@ function stripeentag($msg, $tag, $attr = array()) return $msg; } +/** + * Max upload size msg + */ +function _max_upload_size() +{ + static $msg; + + if ($msg) { + return $msg; + } + + $filesize = ini_get('upload_max_filesize'); + if (substr($filesize, -1) == 'M') { + $filesize = $filesize * 1048576; + } + $filesize = News::format_filesize($filesize); + + $postsize = ini_get('post_max_size'); + if (substr($postsize, -1) == 'M') { + $postsize = $postsize * 1048576; + } + $postsize = News::format_filesize($postsize); + + $msg = sprintf(_("Maximum file size: %s; with a total of: %s"), + $filesize, $postsize); + + return $msg; +} + // Is logged it? if (!Auth::isAuthenticated()) { $notification->push(_("Only authenticated users can post news."), 'horde.warning'); Horde::authenticationFailureRedirect(); } -/* default vars */ +// Default vars $title = _("Add news"); $default_lang = News::getLang(); $id = Util::getFormData('id', false); $return = Util::getFormData('return', false); -/* prepare form */ +// We just delete default image? +if ($id && Util::getFormData('submitbutton') == _("Delete existing picture")) { + $result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(0, $id)); + if ($sources instanceof PEAR_Error) { + $notification->push($sources); + } else { + News::deleteImage($id); + header('Location: ' . News::getUrlFor('news', $id)); + exit; + } +} + +// Prepare form $vars = Variables::getDefaultVariables(); -$form = &new Horde_Form($vars, '', 'addnews'); -$form->_submit = _("Save"); +$form = new Horde_Form($vars, '', 'addnews'); $form->addHidden('', 'return', 'text', false, true); +if ($id) { + $form->setButtons(array(_("Update"), _("Delete existing picture")), _("Reset")); +} else { + $form->setButtons(array(_("Save")), _("Reset")); +} // General $form->setSection('content', _("Content"), '', false); @@ -86,55 +128,23 @@ $v = &$form->addVariable(_("Publish"), 'publish', 'datetime', true, false, false $v->setDefault(date('Y-m-d H:i:s')); $form->addVariable(_("Primary category"), 'category1', 'enum', true, false, false, array($news_cat->getEnum(), _("-- select --"))); -/* Sources */ +// Sources $sources = $GLOBALS['news']->getSources(); if ($sources instanceof PEAR_Error) { - $notification->push($sources->getDebugInfo(), 'horde.error'); + $notification->push($sources); } elseif (!empty($sources)) { $form->addVariable(_("Source"), 'source', 'enum', false, false, false, array($sources, _("-- select --"))); } $form->addVariable(_("Source link"), 'sourcelink', 'text', false, false); -/* Picture */ -$form->addVariable(_("Picture"), 'picture', 'image', false, false, false, array('showUpload' => false)); -if ($id) { - $form->addVariable(_("Picture delete"), 'picture_delete', 'boolean', false, false, _("Delete existing picture")); -} - -/* Languages */ +// Languages foreach ($conf['attributes']['languages'] as $key) { $flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($key) . ' ' : ''; $form->addVariable($flag . _("Title"), "title_$key", 'text', ($key == $default_lang) ? true : false); - $form->addVariable($flag . _("Picture comment"), "picture_comment_$key", 'text', false); if ($conf['attributes']['tags']) { $form->addVariable($flag . _("Tags"), "tags_$key", 'text', false, false, _("Enter one or more keywords that describe your news. Separate them by spaces.")); } $form->addVariable($flag . _("Content"), "content_$key", 'longtext', ($key == $default_lang) ? true : false , false, false, array(20, 120)); - // TODO: tinymce is no longer available - Horde_Editor::singleton('tinymce', - array('id' => "content_$key", - 'config' => array('mode'=> 'exact', - 'elements' => "content_$key", - 'theme' => 'advanced', - 'plugins' => "xhtmlxtras,paste,media,fullscreen,wordfix", - 'extended_valid_elements' => "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],object,iframe[src|width|height|frameborder]", - 'paste_auto_cleanup_on_paste' => 'true', - 'paste_convert_headers_to_strong' => 'true', - 'theme_advanced_toolbar_location' => 'top', - 'theme_advanced_toolbar_align' => 'left', - 'theme_advanced_buttons1' => 'bold,italic,underline,fontsizeselect,separator,strikethrough,sub,sup,bullist,numlist,separator,link,unlink,image,separator,undo,redo,cleanup,code,hr,removeformat,wordfix,fullscreen', - 'theme_advanced_buttons2' => '', - 'theme_advanced_buttons3' => '', - 'theme_advanced_path_location' => 'bottom', - 'content_css' => '/include/tinymce/screen.css', - //'cleanup_on_startup' => 'true', - 'button_tile_map' => 'true', - 'theme_advanced_buttons1_add' => 'media', - 'language' => 'en', - 'gecko_spellcheck' => 'true', - 'entity_encoding' => 'raw' - ))); - } // Additional @@ -148,42 +158,83 @@ if ($registry->hasMethod('forums/doComments')) { $form->addVariable(sprintf(_("Threads in %s"), $registry->get('name', 'agora')), 'threads', 'intList', false, false, _("Enter threads separated by commas.")); } -/* Link to a gallery */ -if ($conf['attributes']['ansel-images'] +$form->setSection('images', _("Images"), '', true); +$form->addVariable(_("News images"), 'content', 'header', false); +$form->addVariable(_max_upload_size(), 'description', 'description', false); + +$form->addVariable(_("Picture"), 'picture_0', 'image', false, false, false, array(false)); + +foreach ($conf['attributes']['languages'] as $key) { + $flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($key) . ' ' : ''; + $form->addVariable($flag . _("Picture comment"), "caption_0_$key", 'text', false); +} + +// Link to a gallery +if ($conf['attributes']['ansel-images'] && $registry->hasMethod('images/listGalleries') && $registry->call('images/countGalleries', array()) > 0) { - if ($registry->call('images/countGalleries', array()) > 30) { - $form->addVariable(_("Gallery"), 'gallery', 'int', false); + $form->addVariable(_("Enter gallery ID or upload images below"), 'description', 'description', false); + + if ($registry->call('images/countGalleries', array()) > 50) { + $form->addVariable(_("Gallery"), 'gallery', 'int', false, false); } else { $ansel_galleries = $registry->call('images/listGalleries', array()); $galleries = array(); foreach ($ansel_galleries as $gallery_id => $gallery) { $galleries[$gallery_id] = $gallery['attribute_name']; } - $form->addVariable(_("Gallery"), 'gallery', 'enum', false, false, false, array('enum' => $galleries, 'prompt' => true)); + $form->addVariable(_("Gallery"), 'gallery', 'enum', false, false, false, array($galleries, true)); + } +} + +if ($registry->hasMethod('images/listGalleries')) { + $images = 4; +} + +if ($images > 1) { + $form->addVariable(_("Images will be added to a gallery linked with this article. You can edit and manage images in gallery."), 'description', 'description', false); + for ($i = 1; $i < $images; $i++) { + $form->addVariable(_("Picture") . ' ' . $i, 'picture_' . $i, 'image', false, false, false, array(false)); + $form->addVariable(_("Caption") . ' ' . $i, 'caption_' . $i, 'text', false); + } +} + +if ($conf['attributes']['attachments']) { + $form->setSection('files', _("Files"), '', true); + + $form->addVariable(_max_upload_size(), 'description', 'description', false); + + foreach ($conf['attributes']['languages'] as $key) { + $flag = (count($conf['attributes']['languages']) > 1) ? News::getFlag($key) . ' ' : ''; + for ($i = 1; $i < 6; $i++) { + $form->addVariable($flag . ' ' . _("File") . ' ' . $i, 'file_' . $key . '_' . $i, 'file', false); + } } } if (Auth::isAdmin('news:admin')) { + $form->setSection('admin', _("Admin"), '', true); + $form->addVariable(_("News administrator options"), 'content', 'header', false); + if ($conf['attributes']['sponsored']) { $form->addVariable(_("Sponsored"), 'sponsored', 'boolean', false); } - /* Allow commeting this content */ + // Allow commeting this content if ($conf['comments']['allow'] != 'never' && $registry->hasMethod('forums/doComments')) { $form->addVariable(_("Disallow comments"), 'disable_comments', 'boolean', false, false); } - /* Link to selling */ + // Link to selling $apis = array(); foreach ($registry->listAPIs() as $api) { if ($registry->hasMethod($api . '/getSellingForm')) { $apis[$api] = array(); $articles = $registry->call($api . '/listCostObjects'); if ($articles instanceof PEAR_Error) { - $notification->push($articles->getMessage(), 'horde.error'); + $notification->push($articles); } elseif (!empty($articles)) { foreach ($articles[0]['objects'] as $item) { $apis[$api][$item['id']] = $item['name']; @@ -196,7 +247,7 @@ if (Auth::isAdmin('news:admin')) { $v = &$form->addVariable(_("Selling item"), 'selling', 'mlenum', false, false, false, array($apis)); } - /* Show from */ + // Show from $available = $GLOBALS['registry']->callByPackage('ulaform', 'getForms'); if (!($available instanceof PEAR_Error)) { $forms = array(); @@ -209,16 +260,7 @@ if (Auth::isAdmin('news:admin')) { } } -/* Files in gollem */ -if ($conf['attributes']['attachments'] && $registry->hasMethod('files/setSelectList')) { - $selectid = Util::getFormData('selectlist_selectid', $registry->call('files/setSelectList')); - $form->addVariable(_("Attachments"), 'attachments', 'selectfiles', false, false, false, array('link_text' => _("Select files"), - 'link_style' => '', - 'icon' => false, - 'selectid' => $selectid)); -} - -/* Process form */ +// Process form if ($form->validate()) { $status_inserted = false; @@ -237,7 +279,7 @@ if ($form->validate()) { $info['status'] = News::CONFIRMED; } - /* Multi language */ + // Multi language $info['chars'] = strlen(preg_replace('/\s\s+/', '', trim(strip_tags($info["content_$default_lang"])))); foreach ($conf['attributes']['languages'] as $key) { @@ -246,30 +288,30 @@ if ($form->validate()) { } $info['body'][$key]['title'] = $info["title_$key"]; $info['body'][$key]['content'] = $info["content_$key"]; - $info['body'][$key]['picture_comment'] = $info["picture_comment_$key"]; + $info['body'][$key]['caption'] = empty($info["caption_0_$key"]) ? '' : $info["caption_0_$key"]; $info['body'][$key]['tags'] = $conf['attributes']['tags'] ? $info["tags_$key"] : ''; unset($info["title_$key"]); unset($info["content_$key"]); - unset($info["picture_comment_$key"]); + unset($info["caption_$key"]); unset($info["tags_$key"]); if (strpos($info['body'][$key]['content'], '<') === FALSE) { - $info['body'][$key]['content'] = nl2br($info['body'][$key]['content']); + $info['body'][$key]['content'] = nl2br(trim($info['body'][$key]['content'])); } else { - $info['body'][$key]['content'] = stripeentag($info['body'][$key]['content'], 'p', array()); - $info['body'][$key]['content'] = stripeentag($info['body'][$key]['content'], 'font', array()); + $info['body'][$key]['content'] = trim(stripeentag($info['body'][$key]['content'], 'p')); + $info['body'][$key]['content'] = trim(stripeentag($info['body'][$key]['content'], 'font')); } - $info['chars'] = strlen(strip_tags( $info['body'][$key]['content'])); + $info['chars'] = strlen(strip_tags($info['body'][$key]['content'])); } - /* Selling */ + // Selling if (empty($info['selling'][1])) { $info['selling'] = ''; } else { $info['selling'] = $info['selling'][1] . '|' . $info['selling'][2]; } - /* Clean up parents ID */ + // Clean up parents ID if ($info['parents']) { $info['parents'] = explode(',', trim($info['parents'])); foreach ($info['parents'] as $i => $parent_id) { @@ -280,9 +322,16 @@ if ($form->validate()) { $info['parents'] = implode(',', array_unique($info['parents'])); } - /* save as current version */ + // Save as current version if (empty($id)) { + $id = $news->write_db->nextID($news->prefix); + if ($id instanceof PEAR_Error) { + $notification->push($id); + header('Location: ' . Horde::applicationUrl('browse.php')); + exit; + } + $query = 'INSERT INTO ' . $news->prefix . ' (sortorder, status, publish, submitted, updated, user, editor, sourcelink, source,' . ' sponsored, parents, category1, category2, chars, attachments, gallery, selling,' @@ -307,11 +356,13 @@ if ($form->validate()) { $info['threads'], empty($info['form_id']) ? 0 : (int)$info['form_id'], empty($info['form_ttl']) ? 0 : (int)$info['form_ttl']); + $status_inserted = true; + } else { $query = 'UPDATE ' . $news->prefix . ' SET ' - . 'sortorder = ?, publish = ?, updated = NOW(), editor=?, sourcelink = ?, source = ?, ' + . 'sortorder = ?, publish = ?, updated = NOW(), editor = ?, sourcelink = ?, source = ?, ' . 'sponsored = ?, parents = ?, category1 = ?, category2 = ?, ' . 'chars = ?, attachments = ?, gallery = ?, selling = ?, threads = ?, ' . 'form_id = ?, form_ttl = ? WHERE id = ?'; @@ -335,81 +386,147 @@ if ($form->validate()) { $id); } - $result = $news->writedb->query($query, $data); + $result = $news->write_db->query($query, $data); if ($result instanceof PEAR_Error) { $notification->push($result->getDebugInfo(), 'horde.error'); header('Location: ' . Horde::applicationUrl('edit.php')); exit; } - if (!$id) { - $id = $news->writedb->getOne('SELECT LAST_INSERT_ID()'); + // Picture + $images_uploaded = array(); + if (isset($info['picture_0']['uploaded'])) { + if ($info['picture_0']['uploaded'] instanceof PEAR_Error) { + if ($info['picture_0']['uploaded']->getCode() != UPLOAD_ERR_NO_FILE) { + $notification->push($info['picture_0']['uploaded']->getMessage(), 'horde.warning'); + } + } else { + $images_uploaded[] = 0; + $result = News::saveImage($id, $info['picture_0']['file']); + if ($result instanceof PEAR_Error) { + $notification->push($result); + } else { + $news->write_db->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(1, $id)); + } + } } - /* picture */ - if (isset($info['picture_delete']) && $info['picture_delete']) { - $news->writedb->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(0, $id)); - } elseif (getimagesize(@$info['picture']['file']) !== FALSE) { - News::saveImage($id, $info['picture']['file']); - - $news->writedb->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(1, $id)); + for ($i = 1; $i < $images; $i++) { + if (isset($info['picture_' . $i]['uploaded'])) { + if ($info['picture_' . $i]['uploaded'] instanceof PEAR_Error) { + if ($uploaded->getCode() != UPLOAD_ERR_NO_FILE) { + $notification->push($uploaded->getMessage(), 'horde.warning'); + } + } else { + $images_uploaded[] = $i; + } + } } - /* comments */ - if (isset($info['disable_comments']) && $info['disable_comments']) { - $news->writedb->query('UPDATE ' . $news->prefix . ' SET comments = ? WHERE id = ?', array(-1, $id)); - } + // Don't create a galler if no picture or only default one was uploaded + if (!empty($images_uploaded) && + !(count($images_uploaded) == 1 && $images_uploaded[0] == 0)) { + + // Do we have a gallery? + if (empty($info['gallery'])) { + $abbr = String::substr(strip_tags($info['body'][$default_lang]['content']), 0, $conf['preview']['list_content']); + $result = $registry->call('images/createGallery', + array(null, + array('name' => $info['body'][$default_lang]['title'], + 'desc' => $abbr))); + if ($result instanceof PEAR_Error) { + $notification->push(_("There was an error creating gallery: ") . $result->getMessage(), 'horde.warning'); + } else { + $info['gallery'] = $result; + } + } - /* bodies */ - $news->writedb->query('DELETE FROM ' . $news->prefix . '_body WHERE id=?', array($id)); - $news->writedb->query('DELETE FROM ' . $news->prefix . '_attachment WHERE id=?', array($id)); + if (!empty($info['gallery'])) { + $news->write_db->query('UPDATE ' . $news->prefix . ' SET gallery = ? WHERE id = ?', array($info['gallery'], $id)); + foreach ($images_uploaded as $i) { + $result = $registry->call('images/saveImage', + array(null, $info['gallery'], + array('filename' => $info['picture_' . $i]['file'], + 'description' => $info['caption_' . ($i == 0 ? $i . '_' . $default_lang: $i)], + 'type' => $info['picture_' . $i]['type'], + 'data' => file_get_contents($info['picture_' . $i]['file'])))); + if ($result instanceof PEAR_Error) { + $notification->push(_("There was an error with the uploaded image: ") . $result->getMessage(), 'horde.warning'); + } + } + } + } - $attachments = array(); - if (isset($info['attachments'])) { - foreach ($info['attachments'] as $file) { - $attachments[] = Util::realPath(key($file) . '/' . current($file)); + // Files + if ($conf['attributes']['attachments']) { + $uploaded = false; + $form->setSection('files', _("Files"), '', true); + foreach ($conf['attributes']['languages'] as $key) { + for ($i = 1; $i < 6; $i++) { + $input = 'file_' . $key . '_' . $i; + $uploaded = Horde_Browser::wasFileUploaded($input); + if ($uploaded instanceof PEAR_Error) { + if ($uploaded->getCode() != UPLOAD_ERR_NO_FILE) { + $notification->push($uploaded->getMessage(), 'horde.warning'); + } + } elseif ($uploaded) { + $file_id = $news->write_db->nextID($news->prefix . '_files'); + if ($file_id instanceof PEAR_Error) { + $notification->push($file_id); + } else { + $result = News::saveFile($file_id, $info[$input]['file']); + if ($result instanceof PEAR_Error) { + $notification->push($result->getMessage(), 'horde.warning'); + } else { + $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_files (file_id, news_id, news_lang, file_name, file_size, file_type) VALUES (?, ?, ?, ?, ?, ?)', + array($file_id, $id, $key, $info[$input]['name'], $info[$input]['size'], $info[$input]['type'])); + if ($result instanceof PEAR_Error) { + $notification->push($result->getMessage(), 'horde.warning'); + } + } + } + } + } } + if ($uploaded) { + $news->write_db->query('UPDATE ' . $news->prefix . ' SET attachments = ? WHERE id = ?', array(1, $id)); + } + } + + // Comments + if (isset($info['disable_comments']) && $info['disable_comments']) { + $news->write_db->query('UPDATE ' . $news->prefix . ' SET comments = ? WHERE id = ?', array(-1, $id)); } - $query_attach = $news->writedb->prepare('INSERT INTO ' . $news->prefix . '_attachment (id, lang, filename, filesize) VALUES (?, ?, ?, ?)'); - $query_body = $news->writedb->prepare('INSERT INTO ' . $news->prefix . '_body ' + // Bodies + $news->write_db->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id)); + $query_body = $news->write_db->prepare('INSERT INTO ' . $news->prefix . '_body ' . '(id, lang, title, abbreviation, content, picture_comment, tags) VALUES (?, ?, ?, ?, ?, ?, ?)'); foreach ($info['body'] as $lang => $values) { $abbr = String::substr(strip_tags($values['content']), 0, $conf['preview']['list_content']); - $news->writedb->execute($query_body, array($id, $lang, $values['title'], $abbr, $values['content'], $values['picture_comment'], $values['tags'])); - if (isset($info['attachments'])) { - for ($i = 0; $i < sizeof($info['attachments']); $i++) { - $f = $conf['attributes']['attachments'] . $attachments[$i]; - $size = filesize($f); - if ($size) { - $news->writedb->execute($query_attach, array($id, $lang, $attachments[$i], $size)); - } else { - $notification->push(sprintf(_("Cannot access file %s"), $f), 'horde.warning'); - } - } - } + $news->write_db->execute($query_body, array($id, $lang, $values['title'], $abbr, $values['content'], $values['caption'], $values['tags'])); } - /* save as future version */ + // Save as future version if ($status_inserted === true) { $status_version = 'insert'; } else { $status_version = 'update'; } $version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id)); - $result = $news->writedb->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid, content) VALUES (?,?,?,NOW(),?,?)', + $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid, content) VALUES (?, ?, ?, NOW(), ? ,?)', array($id, $version + 1, $status_version, Auth::getAuth(), serialize($info['body']))); if ($result instanceof PEAR_Error) { - $notification->push($result->getMessage(), 'horde.error'); + $notification->push($result); } - /* Expire newscache */ + // Expire newscache foreach ($conf['attributes']['languages'] as $key) { - $cache->expire('news_' . $key . '_' . $id); + $cache->expire('news_' . $key . '_' . $id); } - /* return */ + // Return if ($return) { $url = $return; } elseif (in_array($info['category1'], $allowed_cats) || @@ -450,7 +567,7 @@ if ($form->validate()) { $vars->set('selling', array(1 => $value[0], 2 => $value[1])); continue; } - } + } $vars->set($key, $value); } @@ -460,30 +577,21 @@ if ($form->validate()) { foreach ($result as $row) { $vars->set('title_' . $row['lang'], $row['title']); $vars->set('content_' . $row['lang'], $row['content']); - $vars->set('picture_comment_' . $row['lang'], $row['picture_comment']); + $vars->set('caption_0_' . $row['lang'], $row['picture_comment']); if ($conf['attributes']['tags']) { $vars->set('tags_' . $row['lang'], $row['tags']); } } - if ($conf['attributes']['attachments'] && $registry->hasMethod('files/setSelectList')) { - $sql = 'SELECT lang, filename FROM ' . $news->prefix . '_attachment WHERE id = ?'; - $result = $news->db->getAll($sql, array($id), DB_FETCHMODE_ASSOC); - $files = array(); - if (sizeof($result)>0) { - foreach ($result as $row) { - $files[] = array(dirname($row['filename']) => basename($row['filename'])); - } - } - - $registry->call('files/setSelectList', array($selectid, $files)); - } - $form->_submit = _("Update"); $form->_reset = _("Reset"); } -/* display */ +// Add editor now to avoud JS error notifications no redirect +foreach ($conf['attributes']['languages'] as $key) { + Horde_Editor::singleton('fckeditor', array('id' => "content_$key")); +} + require_once NEWS_TEMPLATES . '/common-header.inc'; require_once NEWS_TEMPLATES . '/menu.inc'; require_once NEWS_TEMPLATES . '/add/before.inc'; diff --git a/news/admin/tabs.php b/news/admin/tabs.php index 908cbf03a..81d0a61b3 100644 --- a/news/admin/tabs.php +++ b/news/admin/tabs.php @@ -1,8 +1,8 @@ + * $Id: browse.php 1179 2009-01-20 13:19:34Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: browse.php 210 2008-01-10 12:41:43Z duck $ - * - * @author Duck + * @author Duck * @package News */ -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; require_once NEWS_BASE . '/lib/Forms/Search.php'; // Default vars $title = _("Browse"); $page = Util::getGet('news_page', 0); $per_page = $prefs->getValue('per_page'); -$news_url = Horde::applicationUrl('news.php'); $browse_url = Horde::applicationUrl('browse.php'); $cid = Util::getGet('cid'); @@ -39,7 +34,7 @@ if ($count instanceof PEAR_Error) { exit; } - +// Get news $rows = $news->listNews($criteria, $page*$per_page, $per_page); if ($rows instanceof PEAR_Error) { echo $rows->getMessage() . ': ' . $rows->getDebugInfo(); @@ -48,7 +43,7 @@ if ($rows instanceof PEAR_Error) { // If we have only one row redirect ot it if ($count == 1 && sizeof($cats) < 2 && $page < 1) { - header('Location: '. Util::addParameter($news_url, 'id', $rows[0]['id'], false)); + header('Location: '. News::getUrlFor('news', $rows[0]['id'])); exit; } diff --git a/news/cloud.php b/news/cloud.php index 1062699db..db35a8000 100644 --- a/news/cloud.php +++ b/news/cloud.php @@ -1,22 +1,17 @@ -* @package Folks -*/ - -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; + * $Id: index.php 31 2007-12-13 14:33:33Z duck $ + * + * Copyright Obala d.o.o. (www.obala.si) + * + * @author Duck + * @package News + */ +require_once dirname(__FILE__) . '/lib/base.php'; $cloud = $news->getCloud(); if ($cloud instanceof PEAR_Error) { - $notification->push($cloud->getMessage(), 'horde.error'); + $notification->push($cloud); $cloud = ''; } diff --git a/news/config/conf.xml b/news/config/conf.xml index 9f4934f8d..e52e74249 100644 --- a/news/config/conf.xml +++ b/news/config/conf.xml @@ -43,8 +43,8 @@ - Images settigns - true + Images settings + true horde horde_vfs @@ -53,7 +53,7 @@ /schedul-images - png jpeg diff --git a/news/content.php b/news/content.php index eb1c0b2ea..8bcc84785 100644 --- a/news/content.php +++ b/news/content.php @@ -1,26 +1,26 @@ */ - require_once dirname(__FILE__) . '/lib/base.php'; // Default layout. $layout = new Horde_Block_Layout_View( unserialize($prefs->getValue('news_layout')), - Horde::applicationUrl('content_edit.php')); -$layout_html = $layout->toHtml(); + Horde::applicationUrl('content_edit.php'), + Horde::applicationUrl('content.php')); +$layout_html = $layout->toHtml(); $title = $registry->get('name'); require NEWS_TEMPLATES . '/common-header.inc'; require NEWS_TEMPLATES . '/menu.inc'; echo '
 
'; echo $layout_html; -require $registry->get('templates', 'horde') . '/common-footer.inc'; +require $registry->get('templates', 'horde') . '/common-footer.inc'; \ No newline at end of file diff --git a/news/content_edit.php b/news/content_edit.php index 8211cb1f4..75895a106 100644 --- a/news/content_edit.php +++ b/news/content_edit.php @@ -1,17 +1,15 @@ + * @author Duck + * @package News */ - -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; // Instantiate the blocks objects. $blocks = &Horde_Block_Collection::singleton('news_layout', array('news')); diff --git a/news/delete.php b/news/delete.php index ada3de8de..bc17cdfa5 100644 --- a/news/delete.php +++ b/news/delete.php @@ -1,25 +1,22 @@ + * Copyright Obala d.o.o. (www.obala.si) * * @author Duck - * @package NEWS -*/ -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; + * @package News + */ +require_once dirname(__FILE__) . '/lib/base.php'; +require_once 'Horde/Variables.php'; if (!Auth::isAdmin('news:admin')) { $notification->push(_("Only admin can delete a news.")); header('Location: ' . Horde::applicationUrl('edit.php')); exit; -}; - -require_once 'Horde/Form.php'; -require_once 'Horde/Variables.php'; +} $vars = Variables::getDefaultVariables(); $form = new Horde_Form($vars, _("Are you sure you want to delete this news?"), 'delete'); @@ -28,34 +25,59 @@ $form->setButtons(array(_("Remove"), _("Cancel"))); $id = (int)Util::getFormData('id'); $form->addHidden('', 'id', 'int', $id); +$row = $news->get($id); +$form->addVariable($row['title'], 'news', 'description', true); +$form->addVariable($row['content'], 'content', 'description', true); + if ($form->validate()) { if (Util::getFormData('submitbutton') == _("Remove")) { - $news->writedb->query('DELETE FROM ' . $news->prefix . ' WHERE id=?', array($id)); - $news->writedb->query('DELETE FROM ' . $news->prefix . '_version WHERE id=?', array($id)); - $news->writedb->query('DELETE FROM ' . $news->prefix . '_body WHERE id=?', array($id)); - $news->writedb->query('DELETE FROM ' . $news->prefix . '_user_reads WHERE id=?', array($id)); - // Delete attachment $sql = 'SELECT filename FROM ' . $news->prefix . '_attachment WHERE id = ?'; $files = $news->db->getCol($sql, 0, array($id)); foreach ($files as $file) { unlink($conf['attributes']['attachments'] . $file); } - $news->writedb->query('DELETE FROM ' . $news->prefix . '_attachment WHERE id=?', array($id)); + + // Delete image and gallery + $sql = 'SELECT picture, gallery FROM ' . $news->prefix . ' WHERE id = ?'; + $image = $news->db->getRow($sql, array($id), DB_FETCHMODE_ASSOC); + if ($image['picture']) { + $result = News::deleteImage($id); + if ($result instanceof PEAR_Error) { + $notification->push($result); + } + } + if ($image['gallery']) { + $result = $registry->call('images/removeGallery', array(null, $image['gallery'])); + if ($result instanceof PEAR_Error) { + $notification->push($result); + } + } + + // Delete from DB + $news->write_db->query('DELETE FROM ' . $news->prefix . ' WHERE id = ?', array($id)); + $news->write_db->query('DELETE FROM ' . $news->prefix . '_version WHERE id = ?', array($id)); + $news->write_db->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id)); + $news->write_db->query('DELETE FROM ' . $news->prefix . '_user_reads WHERE id = ?', array($id)); + $news->write_db->query('DELETE FROM ' . $news->prefix . '_attachment WHERE id=?', array($id)); + // Delete forum if ($registry->hasMethod('forums/deleteForum')) { $comments = $registry->call('forums/deleteForum', array('news', $id)); if ($comments instanceof PEAR_Error) { - $notification->push($comments->getMessage(), 'horde.error'); + $notification->push($comments); } } $notification->push(sprintf(_("News %s: %s"), $id, _("deleted")), 'horde.success'); + } else { + $notification->push(sprintf(_("News %s: %s"), $id, _("not deleted")), 'horde.warning'); } + header('Location: ' . Horde::applicationUrl('edit.php')); exit; } diff --git a/news/diff.php b/news/diff.php index 233aa108b..9ae454b40 100644 --- a/news/diff.php +++ b/news/diff.php @@ -2,18 +2,14 @@ /** * Diff * - * Copyright 2006 Duck + * $Id: diff.php 803 2008-08-27 08:29:20Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: diff.php 183 2008-01-06 17:39:50Z duck $ - * - * @author Duck + * @author Duck * @package News */ -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; $title = _("Diff"); $id = Util::getFormData('id', 0); @@ -52,7 +48,7 @@ while (list($k, $v) = each($current_data)) { echo '
' . $nls['languages'][$k] . '
' . "\n"; $to = explode("\n", @htmlentities(strip_tags($v['content']))); $from = explode("\n", @htmlentities(strip_tags($version_data[$k]['content']))); - $diff = &new Text_Diff($from, $to); + $diff = new Text_Diff($from, $to); if (!empty($diff)) { echo nl2br($renderer->render($diff)); } else { diff --git a/news/edit.php b/news/edit.php index db45118ca..980eb9c50 100644 --- a/news/edit.php +++ b/news/edit.php @@ -2,23 +2,17 @@ /** * Edit browsing * - * Copyright 2006 Duck + * $Id: edit.php 1188 2009-01-21 10:33:56Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: edit.php 372 2008-02-29 12:05:00Z duck $ - * - * @author Duck + * @author Duck * @package News */ - -/* application include */ -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; require_once NEWS_BASE . '/lib/Forms/Search.php'; -/* redirect if not an admin */ +// redirect if not an admin $allowed_cats = $news_cat->getAllowed(PERMS_DELETE); if (empty($allowed_cats)) { $notification->push(_("You have not editor permission on any category.")); @@ -29,58 +23,51 @@ if (empty($allowed_cats)) { $id = Util::getFormData('id', 0); $page = Util::getFormData('page', 0); $browse_url = Horde::applicationUrl('edit.php'); -$news_url = Horde::applicationUrl('news.php'); $edit_url = Horde::applicationUrl('add.php'); $read_url = Horde::applicationUrl('reads.php'); $has_comments = $registry->hasMethod('forums/doComments'); $actionID = Util::getFormData('actionID'); +// save as future version if (!empty($actionID) && $id > 0) { - /* save as future version */ $version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id=?', array($id)); - $result = $news->writedb->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid) VALUES (?,?,?,NOW(),?)', - array($id, $version + 1, $actionID, Auth::getAuth())); + $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid) VALUES (?,?,?,NOW(),?)', + array($id, $version + 1, $actionID, Auth::getAuth())); } -switch ($actionID) { -case 'delete_attachments'; - - $news->writedb->query('DELETE FROM ' . $news->prefix . '_attachment WHERE id = ?', array($id)); - $news->writedb->query('UPDATE ' . $news->prefix . ' SET attachments = ? WHERE id = ?', array(0, $id)); - - $notification->push(sprintf(_("News %s: %s"), $id, _("Attachment deleted")), 'horde.success'); - header('Location: ' . $browse_url); - exit; +if ($id) { + $article = $news->get($id); +} -break; +switch ($actionID) { case 'deactivate'; - $news->writedb->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id)); - $notification->push(sprintf(_("News %s: %s"), $id, _("deactivated")), 'horde.success'); + $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id)); + $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("deactivated")), 'horde.success'); header('Location: ' . $browse_url); exit; break; case 'activate'; - $news->writedb->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::CONFIRMED, $id)); - $notification->push(sprintf(_("News %s: %s"), $id, _("activated")), 'horde.success'); + $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::CONFIRMED, $id)); + $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("activated")), 'horde.success'); header('Location: ' . $browse_url); exit; break; case 'lock'; - $news->writedb->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::LOCKED, $id)); - $notification->push(sprintf(_("News %s: %s"), $id, _("locked")), 'horde.success'); + $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::LOCKED, $id)); + $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("locked")), 'horde.success'); header('Location: ' . $browse_url); exit; break; case 'unlock'; - $news->writedb->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id)); - $notification->push(sprintf(_("News %s: %s"), $id, _("unlocked")), 'horde.success'); + $news->write_db->query('UPDATE ' . $news->prefix . ' SET status = ? WHERE id = ?', array(News::UNCONFIRMED, $id)); + $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("unlocked")), 'horde.success'); header('Location: ' . $browse_url); exit; @@ -93,7 +80,7 @@ case 'renew'; array($id, $version), DB_FETCHMODE_ASSOC); $version_data['content'] = unserialize($version_data['content']); - $news->writedb->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id)); + $news->write_db->query('DELETE FROM ' . $news->prefix . '_body WHERE id = ?', array($id)); $new_version = array(); $sql = 'INSERT INTO ' . $news->prefix . '_body (id,lang,title,abbreviation,content) VALUES (?,?,?,?,?)'; @@ -105,15 +92,15 @@ case 'renew'; $values['title'], substr(strip_tags($values['content']), 0, $conf['preview']['list_content']), $values['content']); - $news->writedb->query($sql, $data); + $news->write_db->query($sql, $data); } /* save as future version */ $version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id)) + 1; - $result = $news->writedb->query('INSERT INTO ' . $news->prefix . '_versions (id, version, created, user_uid, content) VALUES (?,?,NOW(),?,?)', + $result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, created, user_uid, content) VALUES (?,?,NOW(),?,?)', array($id, $version, Auth::getAuth(), serialize($new_version))); - $notification->push(sprintf(_("News %s: %s"), $id, _("renewed")), 'horde.success'); + $notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("renewed")), 'horde.success'); header('Location: ' . $browse_url); exit; @@ -160,7 +147,7 @@ if ($rows instanceof PEAR_Error) { // Get pager $pager = News_Search::getPager($binds[1], $count, $browse_url); -/* Output */ +// Output Horde::addScriptFile('tables.js', 'horde', true); Horde::addScriptFile('popup.js', 'horde', true); diff --git a/news/feed.php b/news/feed.php index e454ff9e9..0922e330a 100644 --- a/news/feed.php +++ b/news/feed.php @@ -2,18 +2,14 @@ /** * Show feed * - * Copyright 2007 Duck + * $Id: feed.php 1179 2009-01-20 13:19:34Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: feed.php 183 2008-01-06 17:39:50Z duck $ - * - * @author Duck + * @author Duck * @package News */ -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; function _getStories($feed_id) { @@ -23,7 +19,7 @@ function _getStories($feed_id) $GLOBALS['cache']->set('news_feed_' . $feed_id, serialize($stories)); return $stories; } else { - return unserialize($stories); + return unserialize($stories); } } @@ -32,5 +28,6 @@ $stories = _getStories($feed_id); $df = $GLOBALS['prefs']->getValue('date_format'); foreach ($stories as $story) { echo strftime($df, $story['story_published']) - . ' ' . $story['story_title'] . '
'; + . ' ' + . $story['story_title'] . '
'; } diff --git a/news/files.php b/news/files.php index 314e9fad7..b26e3d92e 100644 --- a/news/files.php +++ b/news/files.php @@ -1,72 +1,95 @@ + * Download and veiew files * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * $Id: files.php 1187 2009-01-21 10:33:06Z duck $ * - * $Id: files.php 183 2008-01-06 17:39:50Z duck $ + * Copyright Obala d.o.o. (www.obala.si) * - * @author Duck + * @author Duck * @package News */ - -/* application include */ $no_compress = true; -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; -$id = Util::getFormData('id', false); +$news_id = Util::getFormData('news_id', false); $actionID = Util::getFormData('actionID'); -$filedir = Util::getFormData('dir'); -$filename = Util::getFormData('file'); -$type = substr($filename, strpos($filename, '.')); +$file_id = Util::getFormData('file_id'); +$file_name = Util::getFormData('file_name'); +$news_lang = Util::getFormData('news_lang', News::getLang()); +$file_type = Util::getFormData('file_type'); +$file_size = Util::getFormData('file_size'); /* Run through action handlers. */ switch ($actionID) { case 'download_file': - $browser->downloadHeaders($filename); - readfile($conf['attributes']['attachments'] . $filedir . '/' . $filename); + $browser->downloadHeaders($file_name, $file_type, false, $file_size); + readfile($conf['attributes']['attachments'] . '/' . $file_id); break; case 'view_file': - require_once 'Horde/MIME/Part.php'; - require_once 'Horde/MIME/Viewer.php'; - require_once 'Horde/MIME/Magic.php'; - require_once 'Horde/MIME/Contents.php'; - - $data = file_get_contents($conf['attributes']['attachments'] . $filedir . '/' . $filename); - $mime = &new MIME_Part(MIME_Magic::extToMIME($type), $data); - $mime->setName($filename); - $contents = &new MIME_Contents($mime); - $body = $contents->renderMIMEPart($mime); - $type = $contents->getMIMEViewerType($mime); - $browser->downloadHeaders($mime->getName(true, true), $type, true, strlen($body)); - echo $body; + $data = file_get_contents($conf['attributes']['attachments'] . '/' . $file_id); + + $mime_part = new Horde_Mime_Part(); + $mime_part->setName($file_id); + $mime_part->setType($file_type); + $mime_part->setContents($data); + + $viewer = Horde_Mime_Viewer::factory($mime_part); + if ($viewer) { + $render = $viewer->render('full'); + if (!empty($render)) { + reset($render); + $key = key($render); + $browser->downloadHeaders($file_id, $render[$key]['type'], true, strlen($render[$key]['data'])); + echo $render[$key]['data']; + } + } else { + // We cannnot see this file, so download it + $browser->downloadHeaders($file_name, $file_type, false, $file_size); + echo $data; + } break; -case 'download_zip': +case 'download_zip_all': + + $file_id = sprintf(_("FilesOfNews-%s"), $news_id); + $zipfiles = array(); + foreach ($news->getFiles($news_id) as $file) { - if ($id) { - $filename = sprintf(_("FilesOfNews-%s"), $id); - $zipfiles = array(); - foreach ($news->getFiles($id) as $file_data) { - $zipfiles[] = array('data' => file_get_contents($conf['attributes']['attachments'] . $file_data['filename']), - 'name' => basename($file_data['filename'])); + $file_path = $conf['attributes']['attachments'] . '/' . $file['file_id']; + if (!file_exists($file_path)) { + continue; } - } else { - $zipfiles = array('data' => file_get_contents($conf['attributes']['attachments'] . $filedir . '/' . $filename), - 'name' => $filename); + $zipfiles[] = array('data' => $file_path, + 'name' => $file); } + if (empty($zipfiles)) { + exit; + } + +var_dump($zipfiles); +exit; + + $zip = Horde_Compress::singleton('zip'); + $body = @$zip->compress($zipfiles); + $browser->downloadHeaders($news_id . '.zip', 'application/zip', false, strlen($body)); + echo $body; + +break; + +case 'download_zip': + + $zipfiles = array('data' => file_get_contents($conf['attributes']['attachments'] . '/' . $file_id), + 'name' => $file_id); + $zip = Horde_Compress::singleton('zip'); - $body = $zip->compress($zipfiles); - $browser->downloadHeaders($filename . '.zip', 'application/zip', false, strlen($body)); + $body = @$zip->compress($zipfiles); + $browser->downloadHeaders($file_id . '.zip', 'application/zip', false, strlen($body)); echo $body; break; diff --git a/news/index.php b/news/index.php index 8a3a7fa54..9cc3b6569 100644 --- a/news/index.php +++ b/news/index.php @@ -1,13 +1,11 @@ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * $Id: index.php 1162 2009-01-14 11:00:29Z duck $ * - * $Id: index.php 308 2008-01-31 13:20:46Z duck $ + * Copyright Obala d.o.o. (www.obala.si) * - * @author Duck + * @author Duck * @package News */ @@ -16,7 +14,6 @@ $news_configured = (is_readable(NEWS_BASE . '/config/conf.php') && is_readable(NEWS_BASE . '/config/prefs.php')); if (!$news_configured) { - define('HORDE_LIBS', ''); require NEWS_BASE . '/../lib/Test.php'; Horde_Test::configFilesMissing('news', NEWS_BASE, array('conf.php', 'prefs.php', 'sources.php')); diff --git a/news/lib/Block/categories.php b/news/lib/Block/categories.php index 64e88766b..8420ff715 100755 --- a/news/lib/Block/categories.php +++ b/news/lib/Block/categories.php @@ -3,7 +3,7 @@ $block_name = _("Categories"); /** - * $Id: categories.php 22 2007-12-13 11:10:52Z duck $ + * $Id: categories.php 890 2008-09-23 09:58:23Z duck $ * * @package Horde_Block */ @@ -31,5 +31,4 @@ class Horde_Block_News_categories extends Horde_Block { require_once dirname(__FILE__) . '/../base.php'; return $GLOBALS['news_cat']->getHtml(); } - -} +} \ No newline at end of file diff --git a/news/lib/Block/category.php b/news/lib/Block/category.php index 330036752..e8694fba6 100755 --- a/news/lib/Block/category.php +++ b/news/lib/Block/category.php @@ -3,7 +3,7 @@ $block_name = _("Last news in category"); /** - * $Id: category.php 201 2008-01-09 08:38:05Z duck $ + * $Id: category.php 890 2008-09-23 09:58:23Z duck $ * * @package Horde_Block */ @@ -56,10 +56,8 @@ class Horde_Block_News_category extends Horde_Block { $view = new News_View(); $view->news = $rows; - $view->news_url = Horde::applicationUrl('news.php'); $view->moreurl = Util::addParameter(Horde::applicationUrl('browse.php'), 'category', $this->_params['category']); return $view->render('/block/news.php'); } - -} +} \ No newline at end of file diff --git a/news/lib/Block/jonah.php b/news/lib/Block/jonah.php index 6e74ae9e7..5cb05e44f 100755 --- a/news/lib/Block/jonah.php +++ b/news/lib/Block/jonah.php @@ -5,7 +5,7 @@ if ($GLOBALS['registry']->hasInterface('news')) { } /** - * $Id: jonah.php 201 2008-01-09 08:38:05Z duck $ + * $Id: jonah.php 890 2008-09-23 09:58:23Z duck $ * * @package Horde_Block */ @@ -56,5 +56,4 @@ class Horde_Block_News_jonah extends Horde_Block { return $html; } - -} +} \ No newline at end of file diff --git a/news/lib/Block/last.php b/news/lib/Block/last.php index 1b96aa147..fe60abe48 100755 --- a/news/lib/Block/last.php +++ b/news/lib/Block/last.php @@ -3,7 +3,7 @@ $block_name = _("Last news"); /** - * $Id: last.php 201 2008-01-09 08:38:05Z duck $ + * $Id: last.php 890 2008-09-23 09:58:23Z duck $ * * @package Horde_Block */ @@ -54,10 +54,8 @@ class Horde_Block_News_last extends Horde_Block { $view = new News_View(); $view->news = $rows; - $view->news_url = Horde::applicationUrl('news.php'); $view->moreurl = Horde::applicationUrl('browse.php'); return $view->render('/block/news.php'); } - -} +} \ No newline at end of file diff --git a/news/lib/Block/last_blogs.php b/news/lib/Block/last_blogs.php index 2f52f58cb..1998e4350 100755 --- a/news/lib/Block/last_blogs.php +++ b/news/lib/Block/last_blogs.php @@ -43,9 +43,7 @@ class Horde_Block_News_last_blogs extends Horde_Block { $view = new News_View(); $view->news = $rows; - $view->news_url = Horde::applicationUrl('news.php'); return $view->render('/block/news.php'); } - -} +} \ No newline at end of file diff --git a/news/lib/Block/last_comments.php b/news/lib/Block/last_comments.php index 402765512..df6879a53 100755 --- a/news/lib/Block/last_comments.php +++ b/news/lib/Block/last_comments.php @@ -6,7 +6,7 @@ $block_name = _("Last comments"); * thomas_Minisearch_Block:: Implementation of the Horde_Block API to * allows searching of addressbooks from the portal. * - * $Id: last_comments.php 22 2007-12-13 11:10:52Z duck $ + * $Id: last_comments.php 890 2008-09-23 09:58:23Z duck $ * * @package Horde_Block */ @@ -42,7 +42,7 @@ class Horde_Block_news_last_comments extends Horde_Block { $comments = News::getLastComments($this->_params['limit']); if ($comments instanceof PEAR_Error) { - return $comments->getMessage(); + return $comments; } $html = ''; @@ -53,5 +53,4 @@ class Horde_Block_news_last_comments extends Horde_Block { } return $html; } - -} +} \ No newline at end of file diff --git a/news/lib/Block/most_commented.php b/news/lib/Block/most_commented.php index a4bfed179..5f4fdb2df 100755 --- a/news/lib/Block/most_commented.php +++ b/news/lib/Block/most_commented.php @@ -3,7 +3,7 @@ $block_name = _("Last most commented news"); /** - * $Id: most_commented.php 201 2008-01-09 08:38:05Z duck $ + * $Id: most_commented.php 890 2008-09-23 09:58:23Z duck $ * * @package Horde_Block */ @@ -47,9 +47,7 @@ class Horde_Block_News_most_commented extends Horde_Block { $view = new News_View(); $view->news = $rows; - $view->news_url = Horde::applicationUrl('news.php'); return $view->render('/block/titles.php'); } - -} +} \ No newline at end of file diff --git a/news/lib/Block/most_read.php b/news/lib/Block/most_read.php index aff21f382..38f3ea65c 100755 --- a/news/lib/Block/most_read.php +++ b/news/lib/Block/most_read.php @@ -3,7 +3,7 @@ $block_name = _("Last most read news"); /** - * $Id: most_read.php 201 2008-01-09 08:38:05Z duck $ + * $Id: most_read.php 890 2008-09-23 09:58:23Z duck $ * * @package Horde_Block */ @@ -47,9 +47,7 @@ class Horde_Block_News_most_read extends Horde_Block { $view = new News_View(); $view->news = $rows; - $view->news_url = Horde::applicationUrl('news.php'); return $view->render('/block/titles.php'); } - -} +} \ No newline at end of file diff --git a/news/lib/Block/my_comments.php b/news/lib/Block/my_comments.php index 61aeacadb..39e41af0a 100644 --- a/news/lib/Block/my_comments.php +++ b/news/lib/Block/my_comments.php @@ -63,10 +63,9 @@ class Horde_Block_news_my_comments extends Horde_Block { return $threads->getMessage(); } - $url = Util::addParameter(Horde::applicationUrl('news.php'), 'id', null); foreach ($threads as $message) { $html .= '' - . '' + . '' . $message['message_subject'] . ' ' . '' . $message['message_author'] . ''; @@ -76,5 +75,4 @@ class Horde_Block_news_my_comments extends Horde_Block { $GLOBALS['cache']->set($cache_key, $html); return $html; } - -} +} \ No newline at end of file diff --git a/news/lib/Block/sources.php b/news/lib/Block/sources.php index 9316990c7..44817af49 100755 --- a/news/lib/Block/sources.php +++ b/news/lib/Block/sources.php @@ -3,7 +3,7 @@ $block_name = _("Sources"); /** - * $Id: sources.php 22 2007-12-13 11:10:52Z duck $ + * $Id: sources.php 890 2008-09-23 09:58:23Z duck $ * * @package Horde_Block */ @@ -41,5 +41,4 @@ class Horde_Block_News_sources extends Horde_Block { return $html; } - -} +} \ No newline at end of file diff --git a/news/lib/Block/tags_cloud.php b/news/lib/Block/tags_cloud.php index 0a66943f1..9197897bb 100644 --- a/news/lib/Block/tags_cloud.php +++ b/news/lib/Block/tags_cloud.php @@ -35,5 +35,4 @@ class Horde_Block_news_tags_cloud extends Horde_Block { return $GLOBALS['news']->getCloud(true); } - -} +} \ No newline at end of file diff --git a/news/lib/Categories.php b/news/lib/Categories.php index e2136e308..e888f1f20 100755 --- a/news/lib/Categories.php +++ b/news/lib/Categories.php @@ -2,12 +2,9 @@ /** * News Tree Class. * - * $Id: Categories.php 268 2008-01-22 10:15:10Z mclion $ + * $Id: Categories.php 1163 2009-01-14 17:47:23Z duck $ * - * Copyright 2007-2008 Obala d.o.o. (http://www.obala.si/) - * - * See the enclosed file COPYING for license information (GPL). If you - * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. + * Copyright Obala d.o.o. (www.obala.si) * * @author Duck * @package News @@ -170,7 +167,7 @@ class News_Categories { */ public function getHtml() { - $this->_view_url = Horde::applicationUrl('browse.php'); + $this->_view_url = News::getUrlFor('category', ''); $output = ''; foreach ($this->_root_nodes as $node_id) { @@ -186,7 +183,7 @@ class News_Categories { if ($this->_nodes[$node_id]['indent'] == 0) { $output .= ''; } - $url = Util::addParameter($this->_view_url, 'cid', $node_id); + $url = $this->_view_url . $node_id; $output .= Horde::link($url) . $this->_nodes[$node_id]['category_name'] . ', '; if ($this->_nodes[$node_id]['indent'] == 0) { $output .= '
'; @@ -594,6 +591,6 @@ class News_Categories { private function _connect() { $this->_db = $GLOBALS['news']->db; - $this->_write_db = $GLOBALS['news']->writedb; + $this->_write_db = $GLOBALS['news']->write_db; } } diff --git a/news/lib/Forms/Search.php b/news/lib/Forms/Search.php index a71895ac4..9493affc3 100644 --- a/news/lib/Forms/Search.php +++ b/news/lib/Forms/Search.php @@ -1,10 +1,15 @@ + * Copyright Obala d.o.o. (www.obala.si) * - * @author Duck + * @author Duck * @package News */ class News_Search extends Horde_Form { @@ -23,10 +28,15 @@ class News_Search extends Horde_Form { $s = array(News::UNCONFIRMED => _("Unconfirmed"), News::CONFIRMED => _("Confirmed"), News::LOCKED => _("Locked")); - $this->addVariable(_("Status"), 'status', 'enum', false, false, false, array($s, true)); + $this->addVariable(_("Status"), 'status', 'enum', false, false, false, array($s, _("-- select --"))); $allowed_cats = $GLOBALS['news_cat']->getAllowed(PERMS_DELETE); - $this->addVariable(_("Category"), 'category', 'enum', false, false, false, array($allowed_cats, true)); + $this->addVariable(_("Category"), 'category', 'enum', false, false, false, array($allowed_cats, _("-- select --"))); + + $sources = $GLOBALS['news']->getSources(); + if (!empty($sources)) { + $this->addVariable(_("Source"), 'source', 'enum', false, false, false, array($sources, _("-- select --"))); + } $this->addVariable(_("Order by"), 'sort_by', 'enum', false, false, false, array(array('n.publish' => _("Publish date"), 'n.id' => _("Id"), @@ -53,7 +63,7 @@ class News_Search extends Horde_Form { */ public function getPager($info, $count, $url) { - $pager = &new Horde_UI_Pager('news_page', + $pager = new Horde_UI_Pager('news_page', Variables::getDefaultVariables(), array('num' => $count, 'url' => $url, @@ -103,7 +113,6 @@ class News_Search extends Horde_Form { continue; } - require_once 'Horde/Array.php'; if (Horde_Array::getArrayParts($var->getVarName(), $base, $keys)) { if (!isset($info[$base])) { $info[$base] = array(); diff --git a/news/lib/News.php b/news/lib/News.php index 04dda600d..4d46a114d 100755 --- a/news/lib/News.php +++ b/news/lib/News.php @@ -2,14 +2,11 @@ /** * News base calss * - * Copyright 2007 Obala d.o.o. + * $Id: News.php 1190 2009-01-21 16:10:50Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: News.php 287 2008-01-25 17:45:33Z duck $ - * - * @author Duck + * @author Duck * @package News */ class News { @@ -17,6 +14,7 @@ class News { const UNCONFIRMED = 0; const CONFIRMED = 1; const LOCKED = 2; + const VFS_PATH = '.horde/news'; /** @@ -39,7 +37,7 @@ class News { * * @var DB */ - public $writedb; + public $write_db; /** * Handle for the tables prefix. @@ -49,6 +47,7 @@ class News { public $prefix = 'news'; /** + * Constructor */ public function __construct() { @@ -113,6 +112,45 @@ class News { } /** + * Return a properly formatted link depending on the global pretty url + * configuration + * + * @param string $controller The controller to generate a URL for. + * @param array $data The data needed to generate the URL. + * @param boolean $full Generate a full URL. + * @param integer $append_session 0 = only if needed, 1 = always, + * -1 = never. + * + * @param string The generated URL + */ + function getUrlFor($controller, $data, $full = false, $append_session = 0) + { + switch ($controller) { + + case 'news': + if (empty($GLOBALS['conf']['urls']['pretty'])) { + return Util::addParameter(Horde::applicationUrl('news.php', $full, $append_session), 'id', $data); + } else { + return Horde::applicationUrl('article/' . $data, $full, $append_session); + } + + case 'category': + if (empty($GLOBALS['conf']['urls']['pretty'])) { + return Util::addParameter(Horde::applicationUrl('browse.php', $full, $append_session), 'category', $data); + } else { + return Horde::applicationUrl('category/' . $data, $full, $append_session); + } + + case 'source': + if (empty($GLOBALS['conf']['urls']['pretty'])) { + return Util::addParameter(Horde::applicationUrl('browse.php', $full, $append_session), 'source', $data); + } else { + return Horde::applicationUrl('source/' . $data, $full, $append_session); + } + } + } + + /** * Template path * * @param intiger $id $category id @@ -133,62 +171,61 @@ class News { /** * Format file size * - * @param int filesize + * @param int $size File size * - * @return boolean formatted filesize. + * @return boolean formatted file_size. */ - static public function format_filesize($filesize) + static public function format_filesize($size) { $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); $pass = 0; // set zero, for Bytes - while ($filesize >= 1024) { - $filesize /= 1024; + while ($size >= 1024) { + $size /= 1024; $pass++; } - return round($filesize, 2) . ' ' . $units[$pass]; + return round($size, 2) . ' ' . $units[$pass]; } /** * Format file size * - * @param int filesize + * @param int $id News ID * - * @return boolean formatted filesize. + * @return boolean formatted file_size. */ - static public function format_attached($id) + public function format_attached($id) { - global $mime_drivers, $mime_drivers_map; + $files = $this->getFiles($id); + if (empty($files)) { + return ''; + } - require_once 'Horde/MIME/Part.php'; - require_once 'Horde/MIME/Viewer.php'; - require_once 'Horde/MIME/Magic.php'; - require_once 'Horde/MIME/Contents.php'; - require HORDE_BASE . '/config/mime_drivers.php'; + if (Auth::isAdmin('news:admin')) { + $delete_img = Horde::img('delete.png', _("Delete"), ' style="width: 16px height: 16px"', $GLOBALS['registry']->getImageDir('horde')); + $delete_url = Horde::applicationUrl('delete_file.php'); + } $dowload_img = Horde::img('save.png', _("Dowload"), ' style="width: 16px height: 16px"', $GLOBALS['registry']->getImageDir('horde')); $dowload_zip = Horde::img('mime/compressed.png', _("Dowload Zip Compressed"), 'style="width: 16px height: 16px"', $GLOBALS['registry']->getImageDir('horde')); $view_url = Horde::applicationUrl('files.php'); $html = ' diff --git a/news/templates/browse/header.inc b/news/templates/browse/header.inc index 7af15647a..21ac9eedd 100755 --- a/news/templates/browse/header.inc +++ b/news/templates/browse/header.inc @@ -1,3 +1,3 @@ -
()
+
()
render(); ?> diff --git a/news/templates/browse/row.inc b/news/templates/browse/row.inc index aa814708c..994cbc926 100755 --- a/news/templates/browse/row.inc +++ b/news/templates/browse/row.inc @@ -1,7 +1,7 @@

-'; ?> +'; ?> -
...
diff --git a/news/templates/categories/index.php b/news/templates/categories/index.php index 6022f7a0d..9dcfe5714 100644 --- a/news/templates/categories/index.php +++ b/news/templates/categories/index.php @@ -12,9 +12,9 @@

- +
'; - $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'dowload_zip', 'id' => $id)), _("Compress and dowload all files at once")) . $dowload_zip . ' ' . "\n"; + $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'download_zip_all', 'news_id' => $id)), _("Compress and dowload all files at once")) . $dowload_zip . ' ' . "\n"; $html .= _("Attached files: ") . '' . "\n"; - $sql = 'SELECT filename, filesize FROM ' . $this->prefix . '_attachment WHERE id = ? AND lang = ?'; - $files = $GLOBALS['news']->db->getAll($sql, array($id, NLS::select()), DB_FETCHMODE_ASSOC); - - foreach ($files as $file_data) { + foreach ($files as $file) { + $view_url = Util::addParameter($view_url, $file); $html .= ' - ' . "\n"; - $file = basename($file_data['filename']); - $dir = dirname($file_data['filename']); - - $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'dowload_zip', 'dir' => $dir, 'file' => $file)), sprintf(_("Compress and dowload %s"), $file)) . $dowload_zip . ' ' . "\n"; - $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'dowload_file', 'dir' => $dir, 'file' => $file)), sprintf(_("Dowload %s"), $file)) . $dowload_img . ' ' . "\n"; - $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'view_file', 'dir' => $dir, 'file' => $file)), sprintf(_("Preview %s"), $file), '', '_file_view'); - $html .= Horde::img(MIME_Viewer::getIcon(MIME_Magic::extToMIME(substr($file, strpos($file, '.')))), $file, 'width="16" height="16"', '') . ' '; - $html .= $file . ' ' . "\n"; - - $html .= ' (' . self::format_filesize($file_data['filesize']) . ')'; + $html .= Horde::link(Util::addParameter($view_url, 'actionID', 'download_zip'), sprintf(_("Compress and dowload %s"), $file['file_name'])) . $dowload_zip . ' ' . "\n"; + $html .= Horde::link(Util::addParameter($view_url, 'actionID', 'download_file'), sprintf(_("Dowload %s"), $file['file_name'])) . $dowload_img . ' ' . "\n"; + $html .= Horde::link(Util::addParameter($view_url, 'actionID', 'view_file'), sprintf(_("Preview %s"), $file['file_name']), '', '_file_view'); + $html .= Horde::img(Horde_Mime_Viewer::getIcon($file['file_type']), $file['file_name'], 'width="16" height="16"', '') . ' '; + if (Auth::isAdmin('news:admin')) { + $html .= Horde::link(Util::addParameter($delete_url, $file), sprintf(_("Delete %s"), $file['file_name'])) . $delete_img . ' ' . "\n"; + } + $html .= $file['file_name'] . ' ' . "\n"; + $html .= ' (' . self::format_filesize($file['file_size']) . ')'; $html .= '
' . "\n"; } @@ -202,20 +239,27 @@ class News { */ static public function loadVFS() { + static $vfs; + + if ($vfs) { + return $vfs; + } + $v_params = Horde::getVFSConfig('images'); if ($v_params instanceof PEAR_Error) { return $v_params; } require_once 'VFS.php'; - return VFS::singleton($v_params['type'], $v_params['params']); + $vfs = VFS::singleton($v_params['type'], $v_params['params']); + return $vfs; } /** * Store image * - * @param $id Image id (item id) - * @param $file Image file + * @param $id Image owner record id + * @param $file['file_name'] Horde_Form_Type_image::getInfo() result * @param $type Image type ('events', 'categories' ...) * @param $resize Resize the big image? */ @@ -223,10 +267,6 @@ class News { { global $conf; - if ($file['uploaded'] instanceof PEAR_Error) { - return $file['uploaded']; - } - $vfs = self::loadVFS(); if ($vfs instanceof PEAR_Error) { return $vfs; @@ -235,9 +275,10 @@ class News { $vfspath = self::VFS_PATH . '/images/' . $type; $vfs_name = $id . '.' . $conf['images']['image_type']; - require_once 'Horde/Image.php'; - $img = Horde_Image::factory('gd', array('type' => $conf['images']['image_type'], - 'temp' => Horde::getTempDir())); + $driver = empty($conf['image']['convert']) ? 'gd' : 'im'; + $img = Horde_Image::factory($driver, + array('type' => $conf['images']['image_type'], + 'temp' => Horde::getTempDir())); if ($img instanceof PEAR_Error) { return $img; @@ -251,6 +292,12 @@ class News { // Store big image for articles if ($type == 'news') { + // Store full image + $result = $vfs->writeData($vfspath . '/full/', $vfs_name, $img->raw(), true); + if ($result instanceof PEAR_Error) { + return $result; + } + // Resize big image? if ($resize) { $dimensions = $img->getDimensions(); @@ -296,22 +343,54 @@ class News { */ static public function deleteImage($id) { - global $conf; + $vfs = self::loadVFS(); + if ($vfs instanceof PEAR_Error) { + return $vfs; + } - $vfs = NEWS::loadVFS(); + $vfs_name = $id . '.' . $GLOBALS['conf']['images']['image_type']; + $vfs->deleteFile(self::VFS_PATH . '/images/small/', $vfs_name); + $vfs->deleteFile(self::VFS_PATH . '/images/big/', $vfs_name); + $vfs->deleteFile(self::VFS_PATH . '/images/full/', $vfs_name); + } + + /** + * Store file + * + * @param $file_id Image owner record id + * @param $file_src File path + */ + static public function saveFile($file_id, $file_src) + { + $vfs = self::loadVFS(); if ($vfs instanceof PEAR_Error) { return $vfs; } - $vfspath = self::VFS_PATH . '/images/' . $type; - $vfs_name = $id . '.' . $conf['images']['image_type']; + return $vfs->writeData(self::VFS_PATH . '/files/', $file_id, file_get_contents($file_src), true); + } + + /** + * Delete file + * + * @param $id Image owner record id + */ + static public function deleteFile($file_id) + { + $vfs = self::loadVFS(); + if ($vfs instanceof PEAR_Error) { + return $vfs; + } + + if ($vfs->exists(self::VFS_PATH . '/files/', $file_id)) { + return $vfs->deleteFile(self::VFS_PATH . '/files/', $file_id); + } - $vfs->deleteFile($vfspath . '/small/', $vfs_name); - $vfs->deleteFile($vfspath . '/big/', $vfs_name); + return true; } /** - * get Image path + * Returns image path */ static public function getImageUrl($id, $view = 'small', $type = 'news') { @@ -329,7 +408,7 @@ class News { } /** - * get gallery images + * Returns gallery images */ static public function getGalleyImages($id) { @@ -384,7 +463,7 @@ class News { $sql = 'SELECT MIN(YEAR(publish)) FROM ' . $this->prefix; $params = array('start_year' => $GLOBALS['news']->db->getOne($sql), 'end_year' => date('Y') + 1, - 'picker' => true, + 'picker' => true, 'format_in' => '%Y-%m-%d %H:%M:%S', 'format_out' => '%Y-%m-%d %H:%M:%S'); } @@ -417,7 +496,6 @@ class News { return $threads; } - $read_url = Horde::applicationUrl('news.php', true); foreach ($threads as $id => $message) { $news_id = $registry->call('forums/getForumName', array('news', $message['forum_id'])); if ($news_id instanceof PEAR_Error) { @@ -426,7 +504,7 @@ class News { } $threads[$id]['news_id'] = $news_id; - $threads[$id]['read_url'] = Util::addParameter($read_url, 'id', $news_id); + $threads[$id]['read_url'] = self::getUrlFor('news', $news_id); } $GLOBALS['cache']->set($cache_key, serialize($threads)); @@ -442,7 +520,7 @@ class News { */ public function updateComments($id, $count) { - return $this->writedb->query('UPDATE ' . $this->prefix . ' SET comments = ? WHERE id = ?', array($count, $id)); + return $this->write_db->query('UPDATE ' . $this->prefix . ' SET comments = ? WHERE id = ?', array($count, $id)); } /** @@ -520,16 +598,23 @@ class News { } /** - * Updates news comments counter + * Get news attached files * - * @param int $news news id + * @param int $news_id news id + * @param string $news_lang news language * * @return true on succes PEAR_Error on failure */ - public function getFiles($id) + public function getFiles($news_id, $news_lang = null) { - $sql = 'SELECT filename, filesize FROM ' . $this->prefix . '_attachment WHERE id=? AND lang=?'; - return $this->db->getAll($sql, array($id, self::getLang()), DB_FETCHMODE_ASSOC); + if (is_null($news_lang)) { + $news_lang = self::getLang(); + } + + $sql = 'SELECT file_id, news_id, news_lang, file_name, file_size, file_type FROM ' . $this->prefix . '_files' + . ' WHERE news_id = ? AND news_lang = ?'; + + return $this->db->getAll($sql, array($news_id, $news_lang), DB_FETCHMODE_ASSOC); } /** @@ -558,7 +643,7 @@ class News { */ public function getVerisons($id) { - $sql = 'SELECT version, created, user_uid,content,action FROM ' . $this->prefix . '_versions WHERE id = ? ORDER BY version DESC'; + $sql = 'SELECT version, created, user_uid, content, action FROM ' . $this->prefix . '_versions WHERE id = ? ORDER BY version DESC'; return $this->db->getAll($sql, array($id), DB_FETCHMODE_ASSOC); } @@ -586,18 +671,18 @@ class News { $_COOKIE['news_viewed_news'] .= $id . '|' . $_SERVER['REQUEST_TIME'] . ':'; setcookie('news_viewed_news', $_COOKIE['news_viewed_news'], $_SERVER['REQUEST_TIME'] + 22896000, $GLOBALS['conf']['cookie']['path'], - $GLOBALS['conf']['cookie']['domain'], $GLOBALS['conf']['use_ssl'] == 1 ? 1 : 0); + $GLOBALS['conf']['cookie']['domain'], $GLOBALS['conf']['use_ssl'] == 1 ? 1 : 0); /* Update the count */ $sql = 'UPDATE ' . $this->prefix . ' SET view_count = view_count + 1 WHERE id = ?'; - $result = $this->writedb->query($sql, array($id)); + $result = $this->write_db->query($sql, array($id)); if ($result instanceof PEAR_Error) { return $result; } /* Log it */ $sql = 'INSERT INTO ' . $this->prefix . '_user_reads (id,user,ip,useragent,readdate) VALUES (?,?,?,?,NOW())'; - $result = $this->writedb->query($sql, array($id,Auth::getAuth(),$_SERVER['REMOTE_ADDR'],$_SERVER["HTTP_USER_AGENT"])); + $result = $this->write_db->query($sql, array($id,Auth::getAuth(),$_SERVER['REMOTE_ADDR'],$_SERVER["HTTP_USER_AGENT"])); if ($result instanceof PEAR_Error) { return $result; } @@ -636,14 +721,14 @@ class News { 'created' => date('Y-m-d H:i:s')); $sql = 'INSERT INTO ' . $this->prefix . '_trackback (' . implode(',', array_keys($params)) . ') VALUES (?, ?, ?, ?, ?, ?)'; - $result = $this->writedb->query($sql, $params); + $result = $this->write_db->query($sql, $params); if ($result instanceof PEAR_Error) { return $result; } /* Update trackback count */ $GLOBALS['cache']->expire('news_' . self::getLang() . '_' . $id); - return $this->writedb->query('UPDATE ' . $this->prefix . ' SET trackbacks = trackbacks + 1 WHERE id = ?', array($id)); + return $this->write_db->query('UPDATE ' . $this->prefix . ' SET trackbacks = trackbacks + 1 WHERE id = ?', array($id)); } /** @@ -658,7 +743,7 @@ class News { $GLOBALS['cache']->expire('newsSources'); $this->deleteImage($id, 'sources'); $sql = 'DELETE FROM ' . $this->prefix . '_sources WHERE sources_id = ?'; - return $this->writedb->query($sql, array($id)); + return $this->write_db->query($sql, array($id)); } /** @@ -716,7 +801,7 @@ class News { } $sql = 'UPDATE ' . $this->prefix . '_sources SET source_image = ? WHERE source_id = ?'; - $this->writedb->query($sql, array(1, $info['source_id'])); + $this->write_db->query($sql, array(1, $info['source_id'])); } $GLOBALS['cache']->expire('newsSources'); @@ -732,7 +817,7 @@ class News { */ private function _insertSource($data) { - $new_id = $this->writedb->nextId('news_sources'); + $new_id = $this->write_db->nextId('news_sources'); $sql = 'INSERT INTO ' . $this->prefix . '_sources' . ' (source_id, source_name, source_url)' . @@ -741,7 +826,7 @@ class News { $data['source_name'], $data['source_url']); - $source = $this->writedb->query($sql, $values); + $source = $this->write_db->query($sql, $values); if ($source instanceof PEAR_Error) { Horde::logMessage($source, __FILE__, __LINE__, PEAR_LOG_ERR); return $source; @@ -767,7 +852,7 @@ class News { $data['source_url'], $source_id); - $source = $this->writedb->query($sql, $values); + $source = $this->write_db->query($sql, $values); if ($source instanceof PEAR_Error) { Horde::logMessage($source, __FILE__, __LINE__, PEAR_LOG_ERR); return $source; @@ -799,19 +884,19 @@ class News { /* Connect to the SQL server using the supplied parameters. */ require_once 'DB.php'; - $this->writedb = &DB::connect($this->_params, + $this->write_db = &DB::connect($this->_params, array('persistent' => !empty($this->_params['persistent']))); - if ($this->writedb instanceof PEAR_Error) { - Horde::fatal($this->writedb, __FILE__, __LINE__); + if ($this->write_db instanceof PEAR_Error) { + Horde::fatal($this->write_db, __FILE__, __LINE__); } // Set DB portability options. - switch ($this->writedb->phptype) { + switch ($this->write_db->phptype) { case 'mssql': - $this->writedb->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM); + $this->write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM); break; default: - $this->writedb->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS); + $this->write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS); } /* Check if we need to set up the read DB connection seperately. */ @@ -834,7 +919,7 @@ class News { } else { /* Default to the same DB handle for the writer too. */ - $this->db =& $this->writedb; + $this->db =& $this->write_db; } return true; @@ -874,6 +959,12 @@ class News { $params['status'] = $criteria['status']; } + /* check status */ + if (isset($criteria['source'])) { + $sql .= ' AND n.source = ?'; + $params['source'] = $criteria['source']; + } + /* get category */ if (isset($criteria['category'])) { $sql .= ' AND (n.category1 = ? OR n.category2 = ?)'; diff --git a/news/lib/TagCloud.php b/news/lib/TagCloud.php index b594d9062..e8ddac5ea 100644 --- a/news/lib/TagCloud.php +++ b/news/lib/TagCloud.php @@ -1,7 +1,7 @@ * @package News @@ -22,31 +19,6 @@ class News_View extends Horde_View { /* Set parents defualt data */ parent::__construct(array('templatePath' => NEWS_TEMPLATES, 'encoding' => NLS::select())); - - $this->list_url = Horde::applicationUrl('list.php'); - } - - /** - * Format value accoring to currency - * - * @param float $price The price value to format. - * - * @return Currency formatted price string. - */ - public public function format_price($price) - { - if (empty($price)) { - return ''; - } - - static $currency; - - if (is_null($currency)) { - $currencies = new Horde_CurrenciesMapper(); - $currency = $currencies->getDefault('data'); - } - - return Horde_Currencies::formatPrice($price, $currency); } /** @@ -96,4 +68,4 @@ class News_View extends Horde_View { return $html; } -} +} \ No newline at end of file diff --git a/news/lib/api.php b/news/lib/api.php index 5723e8f73..126a491a0 100755 --- a/news/lib/api.php +++ b/news/lib/api.php @@ -2,14 +2,11 @@ /** * News api * - * Copyright 2006 Duck + * $Id: api.php 970 2008-10-07 17:11:59Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: api.php 730 2008-08-10 09:52:55Z duck $ - * - * @author Duck + * @author Duck * @package News */ @@ -94,10 +91,17 @@ function _news_commentCallback($id, $type = 'title', $params = null) return $news['user']; case 'link': - return Util::addParameter(Horde::applicationUrl('news.php', true, -1), 'id', $id); + return News::getUrlFor('news', $id, true, -1); case 'messages': $GLOBALS['news']->updateComments($id, $params); + + if ($GLOBALS['registry']->hasMethod('logActivity', 'folks')) { + $link = '' . $news['title'] . ''; + $message = sprintf(_("Has commented news \"%s\""), $link); + $GLOBALS['registry']->callByPackage('folks', 'logActivity', array($message, 'news')); + } + return true; default: @@ -128,7 +132,7 @@ function _news_listNews($criteria = array(), $from = 0, $count = 0, $perms = PER { require_once dirname(__FILE__) . '/base.php'; - return $GLOBALS['news']->listNews($criteria, $perms); + return $GLOBALS['news']->listNews($criteria, $from, $count, $perms); } /** diff --git a/news/lib/base.php b/news/lib/base.php index e6561e80d..dbf5a3f02 100755 --- a/news/lib/base.php +++ b/news/lib/base.php @@ -7,7 +7,7 @@ * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. * - * $Id: base.php 200 2008-01-09 08:29:52Z duck $ + * $Id: base.php 1174 2009-01-19 15:11:03Z duck $ * * @author Duck * @package News @@ -21,7 +21,6 @@ if (!defined('HORDE_BASE')) { // Load the Horde Framework core, and set up inclusion paths. require_once HORDE_BASE . '/lib/core.php'; -require_once 'Horde/Loader.php'; // Registry. $registry = &Registry::singleton(); @@ -60,4 +59,3 @@ $GLOBALS['news_cat'] = new News_Categories(); if (!Util::nonInputVar('no_compress')) { Horde::compressOutput(); } - diff --git a/news/lib/version.php b/news/lib/version.php deleted file mode 100755 index 895ee16bc..000000000 --- a/news/lib/version.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/news/mail.php b/news/mail.php index 6526f0f60..d82d806ac 100644 --- a/news/mail.php +++ b/news/mail.php @@ -2,23 +2,19 @@ /** * News * - * Copyright 2006 Duck + * $Id: mail.php 1174 2009-01-19 15:11:03Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: mail.php 183 2008-01-06 17:39:50Z duck $ - * - * @author Duck + * @author Duck * @package News */ -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; $id = Util::getFormData('id'); $row = $news->get($id); if ($row instanceof PEAR_Error) { - $notification->push($row->getMessage(), 'horde.error'); + $notification->push($row); header('Location: ' . Horde::applicationUrl('browse.php')); exit; } @@ -27,8 +23,7 @@ if ($row instanceof PEAR_Error) { function _error($msg) { $GLOBALS['notification']->push($msg, 'horde.error'); - $news_url = Util::addParameter(Horde::applicationUrl('news.php', true), 'id', $GLOBALS['id']); - header('Location: ' . $news_url); + header('Location: ' . News::getUrlFor('news', $GLOBALS['id'])); exit; } @@ -52,16 +47,15 @@ $body = sprintf(_("%s would you like to invite you to read the news\n Title: %s\ Auth::getAuth(), $row['title'], $row['publish'], - Util::addParameter(Horde::applicationUrl('news.php', true, -1), 'id', $id)); + News::getUrlFor('news', $id, true, -1)); -require_once 'Horde/MIME/Mail.php'; -$mail = new MIME_Mail($row['title'], $body, $to, $from, NLS::getCharset()); +$mail = new Horde_Mime_Mail($row['title'], $body, $to, $from, NLS::getCharset()); $result = $mail->send($conf['mailer']['type'], $conf['mailer']['params']); if ($result instanceof PEAR_Error) { - $notification->push($result->getMessage(), 'horde.error'); + $notification->push($result); } else { $notification->push(sprintf(_("News succesfully send to %s"), $to), 'horde.success'); } -header('Location: ' . Util::addParameter(Horde::applicationUrl('news.php', true), 'id', $id)); -exit; +header('Location: ' . News::getUrlFor('news', $id)); +exit; \ No newline at end of file diff --git a/news/news.php b/news/news.php index 5ad644fe6..4c49b74e3 100644 --- a/news/news.php +++ b/news/news.php @@ -2,26 +2,21 @@ /** * News * - * Copyright 2006 Duck + * $Id: news.php 1190 2009-01-21 16:10:50Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: news.php 229 2008-01-12 19:47:30Z duck $ - * - * @author Duck + * @author Duck * @package News */ - -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; $id = Util::getFormData('id'); $row = $news->get($id); -// check if the news eyists +// check if the news exists if ($row instanceof PEAR_Error) { - $notification->push($row->getMessage(), 'horde.error'); + $notification->push($row); header('Location: ' . Horde::applicationUrl('index.php')); exit; } @@ -37,8 +32,8 @@ if (($version = Util::getFormData('version')) !== null) { $version_data['content'] = unserialize($version_data['content']); $row['content'] = $version_data['content'][NLS::select()]['content']; $row['title'] = $version_data['content'][NLS::select()]['title'] . - ' - v.' . $version . ' from ' . $version_data['user_uid'] . - ' @ ' . $version_data['created'] . ' '; + ' (v.' . $version . _(" by ") . $version_data['user_uid'] . + ' @ ' . $news->dateFormat($version_data['created']) . ')'; } } else { $news->logView($id); @@ -47,7 +42,6 @@ if (($version = Util::getFormData('version')) !== null) { $title = $row['title']; $template_path = News::getTemplatePath($row['category1'], 'news'); $browse_url = Horde::applicationUrl('browse.php'); -$news_url = Horde::applicationUrl('news.php', true); Horde::addScriptFile('popup.js', 'horde', true); require_once NEWS_TEMPLATES . '/common-header.inc'; @@ -55,5 +49,4 @@ require_once NEWS_TEMPLATES . '/menu.inc'; require $template_path . 'news.php'; -require_once $registry->get('templates', 'horde') . '/common-footer.inc'; - +require_once $registry->get('templates', 'horde') . '/common-footer.inc'; \ No newline at end of file diff --git a/news/note.php b/news/note.php index 741a16639..58d729228 100644 --- a/news/note.php +++ b/news/note.php @@ -2,31 +2,26 @@ /** * News * - * Copyright 2006 Duck + * $Id: note.php 890 2008-09-23 09:58:23Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: note.php 183 2008-01-06 17:39:50Z duck $ - * - * @author Duck + * @author Duck * @package News */ -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; $id = Util::getFormData('id'); $row = $news->get($id); if ($row instanceof PEAR_Error) { - $notification->push($row->getMessage(), 'horde.error'); + $notification->push($row); header('Location: ' . Horde::applicationUrl('browse.php')); exit; } -$news_url = Util::addParameter(Horde::applicationUrl('news.php', true), 'id', $id); -$body = $row['title'] . "\n\n" +$body = $row['title'] . "\n\n"getUrlFor . _("On") . ': ' . $news->dateFormat($row['publish']) . "\n" - . _("Link") . ': ' . $news_url . "\n\n" + . _("Link") . ': ' . News::getUrlFor('news', $id) . "\n\n" . strip_tags($row['content']); /* Create a new vNote object using this message's contents. */ @@ -38,11 +33,11 @@ $vNote->setAttribute('BODY', $body); $res = $registry->call('notes/import', array($vNote, 'text/x-vnote')); if ($res instanceof PEAR_Error) { - $notification->push($res->getMessage(), 'horde.error'); - header('Location: ' . $news_url); + $notification->push($res); + header('Location: ' . News::getUrlFor('news', $id)); exit; } else { $notification->push(_("News sucessfuly added to you notes."), 'horde.success'); header('Location: ' . $registry->getInitialPage('mnemo')); exit; -} +} \ No newline at end of file diff --git a/news/po/news.pot b/news/po/news.pot index 414acc94c..ab702bde1 100644 --- a/news/po/news.pot +++ b/news/po/news.pot @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright YEAR Horde Project +# Copyright (C) YEAR Horde Project # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" -"POT-Creation-Date: 2008-03-30 19:15+0200\n" +"POT-Creation-Date: 2009-01-21 01:31+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,20 +16,20 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: templates/edit/info.inc:86 templates/edit/info.php:91 +#: templates/edit/info.php:91 msgid " at " msgstr "" -#: templates/edit/info.inc:86 templates/edit/info.php:91 +#: templates/edit/info.php:91 msgid " by " msgstr "" -#: content_edit.php:28 +#: content_edit.php:26 #, php-format msgid "%s :: Add Content" msgstr "" -#: mail.php:51 +#: mail.php:46 #, php-format msgid "" "%s would you like to invite you to read the news\n" @@ -43,7 +43,8 @@ msgstr "" msgid "* Sponsored news" msgstr "" -#: add.php:87 add.php:94 add.php:142 +#: add.php:129 add.php:136 add.php:153 lib/Forms/Search.php:31 +#: lib/Forms/Search.php:34 lib/Forms/Search.php:38 msgid "-- select --" msgstr "" @@ -55,7 +56,7 @@ msgstr "" msgid "Activate" msgstr "" -#: lib/News.php:1048 +#: lib/News.php:1123 msgid "Add" msgstr "" @@ -67,7 +68,7 @@ msgstr "" msgid "Add New" msgstr "" -#: lib/Categories.php:474 lib/Categories.php:488 +#: lib/Categories.php:471 lib/Categories.php:485 msgid "Add New Item" msgstr "" @@ -79,43 +80,47 @@ msgstr "" msgid "Add category" msgstr "" -#: add.php:69 +#: add.php:95 msgid "Add news" msgstr "" -#: templates/news/tools.php:16 +#: templates/news/tools.php:18 msgid "Add to bookmarks." msgstr "" -#: templates/news/tools.php:22 +#: templates/news/tools.php:24 msgid "Add to notes." msgstr "" -#: add.php:141 +#: add.php:152 msgid "Additional news attributes" msgstr "" -#: lib/api.php:52 +#: add.php:218 lib/api.php:49 msgid "Admin" msgstr "" -#: lib/News.php:1056 +#: lib/News.php:1131 msgid "Administration" msgstr "" -#: templates/edit/info.inc:21 templates/edit/info.php:21 +#: templates/edit/info.php:21 msgid "Allow comments" msgstr "" -#: lib/News.php:1046 +#: lib/News.php:1121 msgid "Archive" msgstr "" -#: delete.php:25 +#: delete_file.php:22 +msgid "Are you sure you want to delete file?" +msgstr "" + +#: delete.php:22 msgid "Are you sure you want to delete this news?" msgstr "" -#: lib/Forms/Search.php:39 +#: lib/Forms/Search.php:49 msgid "Ascending" msgstr "" @@ -123,19 +128,19 @@ msgstr "" msgid "Ascesending" msgstr "" -#: lib/News.php:175 +#: lib/News.php:216 msgid "Attached files: " msgstr "" -#: edit.php:51 +#: edit.php:44 msgid "Attachment deleted" msgstr "" -#: add.php:214 lib/Forms/Search.php:36 +#: lib/Forms/Search.php:46 msgid "Attachments" msgstr "" -#: add.php:140 +#: add.php:151 msgid "Attributes" msgstr "" @@ -143,7 +148,7 @@ msgstr "" msgid "Besed" msgstr "" -#: trackback.php:67 +#: trackback.php:65 #, php-format msgid "Blog entry %s does not exist." msgstr "" @@ -152,7 +157,7 @@ msgstr "" msgid "Blogs" msgstr "" -#: browse.php:20 search.php:21 +#: browse.php:16 search.php:16 msgid "Browse" msgstr "" @@ -160,22 +165,26 @@ msgstr "" msgid "By" msgstr "" -#: delete.php:26 admin/categories/delete.php:18 admin/sources/delete.php:19 +#: delete_file.php:23 delete.php:23 admin/categories/delete.php:18 +#: admin/sources/delete.php:19 msgid "Cancel" msgstr "" -#: add.php:387 +#: files.php:52 #, php-format -msgid "Cannot access file %s" +msgid "Cannot read file %s" msgstr "" -#: admin/tabs.php:27 lib/api.php:60 lib/Block/categories.php:3 -#: lib/Block/categories.php:21 templates/categories/edit.html:5 -#: templates/categories/index.html:4 templates/categories/delete.html:5 +#: add.php:199 +msgid "Caption" +msgstr "" + +#: admin/tabs.php:25 lib/api.php:57 lib/Block/categories.php:3 +#: lib/Block/categories.php:21 msgid "Categories" msgstr "" -#: templates/menu.inc:4 templates/news/info.php:6 lib/Forms/Search.php:29 +#: templates/menu.inc:4 templates/news/info.php:6 lib/Forms/Search.php:34 #: lib/Block/category.php:35 msgid "Category" msgstr "" @@ -202,28 +211,28 @@ msgid "Chars" msgstr "" #: templates/browse/row.inc:10 templates/edit/header.inc:13 -#: lib/Forms/Search.php:34 +#: lib/Forms/Search.php:44 msgid "Comments" msgstr "" -#: lib/News.php:411 +#: lib/News.php:487 msgid "Comments are not supported." msgstr "" -#: lib/News.php:185 +#: lib/News.php:222 #, php-format msgid "Compress and dowload %s" msgstr "" -#: lib/News.php:174 +#: lib/News.php:215 msgid "Compress and dowload all files at once" msgstr "" -#: templates/edit/row.php:43 lib/Forms/Search.php:24 +#: templates/edit/row.php:46 lib/Forms/Search.php:29 msgid "Confirmed" msgstr "" -#: add.php:82 add.php:112 +#: add.php:124 add.php:147 msgid "Content" msgstr "" @@ -237,15 +246,20 @@ msgstr "" #: templates/edit/row.php:23 admin/categories/index.php:29 #: admin/categories/index.php:32 admin/sources/index.php:27 -#: admin/sources/index.php:34 +#: admin/sources/index.php:34 lib/News.php:206 msgid "Delete" msgstr "" -#: add.php:101 +#: lib/News.php:227 +#, php-format +msgid "Delete %s" +msgstr "" + +#: add.php:101 add.php:118 msgid "Delete existing picture" msgstr "" -#: lib/Forms/Search.php:38 +#: lib/Forms/Search.php:48 msgid "Descending" msgstr "" @@ -257,11 +271,11 @@ msgstr "" msgid "Description" msgstr "" -#: diff.php:18 templates/edit/info.inc:95 templates/edit/info.php:100 +#: diff.php:14 templates/edit/info.php:100 msgid "Diff" msgstr "" -#: add.php:175 +#: add.php:227 msgid "Disallow comments" msgstr "" @@ -273,20 +287,20 @@ msgstr "" msgid "Do you really wont to delete this source?" msgstr "" -#: lib/News.php:169 +#: lib/News.php:210 msgid "Dowload" msgstr "" -#: lib/News.php:186 +#: lib/News.php:223 #, php-format msgid "Dowload %s" msgstr "" -#: lib/News.php:170 +#: lib/News.php:211 msgid "Dowload Zip Compressed" msgstr "" -#: edit.php:123 templates/edit/row.php:6 templates/edit/row.php:7 +#: edit.php:116 templates/edit/row.php:6 templates/edit/row.php:7 #: admin/categories/index.php:27 admin/categories/index.php:34 #: admin/sources/index.php:25 admin/sources/index.php:36 msgid "Edit" @@ -300,54 +314,80 @@ msgstr "" msgid "Edit category" msgstr "" -#: templates/edit/info.inc:75 templates/edit/info.php:80 +#: templates/edit/info.php:80 msgid "Edit history: " msgstr "" -#: add.php:434 +#: add.php:542 msgid "Edit news" msgstr "" -#: templates/edit/info.inc:25 templates/edit/info.php:25 -#: lib/Forms/Search.php:46 +#: templates/edit/info.php:25 lib/Forms/Search.php:56 msgid "Editor" msgstr "" -#: lib/api.php:55 +#: lib/api.php:52 msgid "Editors" msgstr "" -#: lib/News.php:1055 +#: lib/News.php:1130 msgid "Editorship" msgstr "" -#: add.php:144 +#: add.php:177 +msgid "Enter gallery ID or upload images below" +msgstr "" + +#: add.php:155 msgid "Enter news ids separated by commas." msgstr "" -#: add.php:110 +#: add.php:145 msgid "" "Enter one or more keywords that describe your news. Separate them by spaces." msgstr "" -#: add.php:147 +#: add.php:158 msgid "Enter threads separated by commas." msgstr "" +#: delete_file.php:44 +#, php-format +msgid "Error deleteing file \"%s\" from news \"%s\"" +msgstr "" + #: templates/news/today.php:11 msgid "Events on this day." msgstr "" -#: files.php:56 +#: add.php:211 +msgid "File" +msgstr "" + +#: delete_file.php:49 +#, php-format +msgid "File \"%s\" was deleted from news \"%s\"" +msgstr "" + +#: delete_file.php:53 +#, php-format +msgid "File \"%s\" was not deleted from news \"%s\"" +msgstr "" + +#: add.php:204 add.php:458 +msgid "Files" +msgstr "" + +#: files.php:60 #, php-format msgid "FilesOfNews-%s" msgstr "" -#: add.php:206 +#: add.php:258 msgid "Form ID" msgstr "" -#: add.php:207 +#: add.php:259 msgid "Form to" msgstr "" @@ -355,10 +395,15 @@ msgstr "" msgid "From: " msgstr "" -#: add.php:156 add.php:163 +#: add.php:180 add.php:187 msgid "Gallery" msgstr "" +#: lib/api.php:101 +#, php-format +msgid "Has commented news \"%s\"" +msgstr "" + #: lib/Block/most_commented.php:26 lib/Block/most_read.php:26 msgid "How many days back to check?" msgstr "" @@ -381,7 +426,7 @@ msgid "IP" msgstr "" #: templates/categories/index.php:5 templates/sources/index.php:5 -#: lib/Forms/Search.php:32 config/prefs.php.dist:29 +#: lib/Forms/Search.php:42 config/prefs.php.dist:29 msgid "Id" msgstr "" @@ -389,11 +434,21 @@ msgstr "" msgid "Image" msgstr "" +#: add.php:161 +msgid "Images" +msgstr "" + +#: add.php:196 +msgid "" +"Images will be added to a gallery linked with this article. You can edit and " +"manage images in gallery." +msgstr "" + #: templates/edit/row.php:9 templates/edit/row.php:10 msgid "Info" msgstr "" -#: templates/edit/info.inc:83 templates/edit/info.php:88 +#: templates/edit/info.php:88 msgid "Insert" msgstr "" @@ -437,7 +492,7 @@ msgstr "" msgid "Last news in category" msgstr "" -#: note.php:29 pdf.php:51 +#: note.php:24 pdf.php:51 msgid "Link" msgstr "" @@ -445,10 +500,15 @@ msgstr "" msgid "Lock" msgstr "" -#: templates/edit/row.php:44 lib/Forms/Search.php:25 +#: templates/edit/row.php:50 lib/Forms/Search.php:30 msgid "Locked" msgstr "" +#: add.php:82 +#, php-format +msgid "Maximum file size: %s; with a total of: %s" +msgstr "" + #: templates/categories/index.php:6 templates/sources/index.php:6 #: admin/categories/edit.php:31 admin/sources/edit.php:32 msgid "Name" @@ -458,24 +518,28 @@ msgstr "" msgid "News" msgstr "" -#: reads.php:33 +#: reads.php:28 #, php-format msgid "News %s" msgstr "" -#: edit.php:51 edit.php:59 edit.php:67 edit.php:75 edit.php:83 edit.php:116 -#: delete.php:55 delete.php:57 +#: edit.php:44 edit.php:52 edit.php:60 edit.php:68 edit.php:76 edit.php:109 +#: delete.php:73 delete.php:75 #, php-format msgid "News %s: %s" msgstr "" -#: add.php:422 +#: add.php:530 msgid "" "News added. The editors will check the entry and confirm it if they find it " "suitable." msgstr "" -#: add.php:83 +#: add.php:219 +msgid "News administrator options" +msgstr "" + +#: add.php:125 msgid "News content" msgstr "" @@ -483,36 +547,40 @@ msgstr "" msgid "News data" msgstr "" +#: add.php:162 +msgid "News images" +msgstr "" + #: templates/news/today.php:5 msgid "News of this day." msgstr "" -#: add.php:424 +#: add.php:532 msgid "News published." msgstr "" -#: mail.php:63 +#: mail.php:57 #, php-format msgid "News succesfully send to %s" msgstr "" -#: note.php:45 +#: note.php:40 msgid "News sucessfuly added to you notes." msgstr "" -#: add.php:426 +#: add.php:534 msgid "News updated." msgstr "" -#: templates/edit/info.inc:21 templates/edit/info.php:21 +#: templates/edit/info.php:21 msgid "No" msgstr "" -#: diff.php:59 +#: diff.php:55 msgid "No change." msgstr "" -#: mail.php:41 +#: mail.php:36 msgid "No mail entered." msgstr "" @@ -520,7 +588,7 @@ msgstr "" msgid "Number of comments to display" msgstr "" -#: note.php:28 pdf.php:50 templates/news/info.php:5 +#: note.php:23 pdf.php:50 templates/news/info.php:5 msgid "On" msgstr "" @@ -528,23 +596,23 @@ msgstr "" msgid "On this day" msgstr "" -#: delete.php:16 +#: delete_file.php:16 delete.php:16 msgid "Only admin can delete a news." msgstr "" -#: add.php:64 +#: add.php:90 msgid "Only authenticated users can post news." msgstr "" -#: mail.php:36 +#: mail.php:31 msgid "Only authenticated users can send mails." msgstr "" -#: lib/Forms/Search.php:31 +#: lib/Forms/Search.php:41 msgid "Order by" msgstr "" -#: lib/News.php:1044 +#: lib/News.php:1119 msgid "Overview" msgstr "" @@ -556,23 +624,18 @@ msgstr "" msgid "Parent" msgstr "" -#: add.php:144 templates/news/parents.php:5 templates/edit/info.inc:33 -#: templates/edit/info.php:33 +#: add.php:155 templates/news/parents.php:5 templates/edit/info.php:33 msgid "Parents" msgstr "" -#: add.php:99 +#: add.php:165 add.php:198 msgid "Picture" msgstr "" -#: add.php:108 +#: add.php:169 msgid "Picture comment" msgstr "" -#: add.php:101 -msgid "Picture delete" -msgstr "" - #: lib/Block/jonah.php:4 lib/Block/jonah.php:24 msgid "Press overview" msgstr "" @@ -581,12 +644,12 @@ msgstr "" msgid "Preview" msgstr "" -#: lib/News.php:187 +#: lib/News.php:224 #, php-format msgid "Preview %s" msgstr "" -#: add.php:87 templates/edit/info.inc:10 templates/edit/info.php:10 +#: add.php:129 templates/edit/info.php:10 msgid "Primary category" msgstr "" @@ -594,7 +657,7 @@ msgstr "" msgid "Printer firendly" msgstr "" -#: add.php:85 lib/Forms/Search.php:41 +#: add.php:127 lib/Forms/Search.php:51 msgid "Publish" msgstr "" @@ -602,29 +665,29 @@ msgstr "" msgid "Publish at" msgstr "" -#: lib/Forms/Search.php:31 config/prefs.php.dist:28 +#: lib/Forms/Search.php:41 config/prefs.php.dist:28 msgid "Publish date" msgstr "" -#: templates/news/parents.php:8 templates/edit/row.php:48 +#: templates/news/parents.php:8 templates/edit/row.php:54 msgid "Read" msgstr "" -#: templates/edit/header.inc:10 lib/Forms/Search.php:35 +#: templates/edit/header.inc:10 lib/Forms/Search.php:45 msgid "Reads" msgstr "" -#: delete.php:26 delete.php:33 admin/categories/delete.php:18 -#: admin/categories/delete.php:24 admin/sources/delete.php:19 -#: admin/sources/delete.php:25 +#: delete_file.php:23 delete_file.php:41 delete.php:23 delete.php:34 +#: admin/categories/delete.php:18 admin/categories/delete.php:24 +#: admin/sources/delete.php:19 admin/sources/delete.php:25 msgid "Remove" msgstr "" -#: templates/edit/info.inc:92 templates/edit/info.php:97 +#: templates/edit/info.php:97 msgid "Renew" msgstr "" -#: add.php:482 +#: add.php:118 add.php:120 add.php:577 msgid "Reset" msgstr "" @@ -632,23 +695,23 @@ msgstr "" msgid "Resize Image" msgstr "" -#: add.php:77 +#: add.php:120 msgid "Save" msgstr "" -#: lib/News.php:1047 lib/Forms/Search.php:17 lib/Forms/Search.php:19 +#: lib/News.php:1122 lib/Forms/Search.php:22 lib/Forms/Search.php:24 msgid "Search" msgstr "" -#: lib/Forms/Search.php:21 +#: lib/Forms/Search.php:26 msgid "Search world" msgstr "" -#: add.php:142 templates/edit/info.inc:13 templates/edit/info.php:13 +#: add.php:153 templates/edit/info.php:13 msgid "Secondary category" msgstr "" -#: lib/Categories.php:481 +#: lib/Categories.php:478 msgid "Select Category" msgstr "" @@ -656,11 +719,7 @@ msgstr "" msgid "Select a feed." msgstr "" -#: add.php:214 -msgid "Select files" -msgstr "" - -#: add.php:195 templates/edit/info.inc:47 templates/edit/info.php:47 +#: add.php:247 templates/edit/info.php:47 msgid "Selling item" msgstr "" @@ -668,7 +727,7 @@ msgstr "" msgid "Send by mail" msgstr "" -#: lib/News.php:101 +#: lib/News.php:100 msgid "Services/Trackback is not installed." msgstr "" @@ -684,12 +743,11 @@ msgstr "" msgid "Sort news by" msgstr "" -#: add.php:143 templates/edit/info.inc:29 templates/edit/info.php:29 -#: lib/Forms/Search.php:38 +#: add.php:154 templates/edit/info.php:29 lib/Forms/Search.php:48 msgid "Sort order" msgstr "" -#: add.php:94 templates/edit/info.inc:37 templates/edit/info.php:37 +#: add.php:136 templates/edit/info.php:37 lib/Forms/Search.php:38 msgid "Source" msgstr "" @@ -697,7 +755,7 @@ msgstr "" msgid "Source deleted." msgstr "" -#: add.php:96 templates/edit/info.inc:41 templates/edit/info.php:41 +#: add.php:138 templates/edit/info.php:41 msgid "Source link" msgstr "" @@ -717,7 +775,7 @@ msgstr "" msgid "Source was not deleted." msgstr "" -#: admin/tabs.php:26 lib/Block/sources.php:3 lib/Block/sources.php:21 +#: admin/tabs.php:24 lib/Block/sources.php:3 lib/Block/sources.php:21 msgid "Sources" msgstr "" @@ -725,19 +783,19 @@ msgstr "" msgid "Sources Administration" msgstr "" -#: add.php:170 +#: add.php:222 msgid "Sponsored" msgstr "" -#: templates/edit/header.inc:6 lib/Forms/Search.php:26 +#: templates/edit/header.inc:6 lib/Forms/Search.php:31 msgid "Status" msgstr "" -#: lib/News.php:1051 +#: lib/News.php:1126 msgid "Tag cloud" msgstr "" -#: add.php:110 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24 +#: add.php:145 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24 msgid "Tags" msgstr "" @@ -753,21 +811,29 @@ msgstr "" msgid "There are no news to display." msgstr "" -#: lib/News.php:482 +#: lib/News.php:557 #, php-format msgid "There requested news %s don't exist." msgstr "" -#: news.php:34 +#: news.php:29 msgid "There requested version don't exist." msgstr "" -#: add.php:147 templates/news/threads.php:6 +#: add.php:433 +msgid "There was an error creating gallery: " +msgstr "" + +#: add.php:449 +msgid "There was an error with the uploaded image: " +msgstr "" + +#: add.php:158 templates/news/threads.php:6 #, php-format msgid "Threads in %s" msgstr "" -#: add.php:107 templates/edit/header.inc:7 lib/Forms/Search.php:33 +#: add.php:143 templates/edit/header.inc:7 lib/Forms/Search.php:43 #: lib/Block/my_comments.php:56 config/prefs.php.dist:30 msgid "Title" msgstr "" @@ -780,12 +846,12 @@ msgstr "" msgid "Trackback this blog on this site." msgstr "" -#: lib/News.php:628 +#: lib/News.php:703 #, php-format msgid "URL already trackbacked: %s" msgstr "" -#: templates/edit/row.php:42 lib/Forms/Search.php:23 +#: templates/edit/row.php:42 lib/Forms/Search.php:28 msgid "Unconfirmed" msgstr "" @@ -793,15 +859,15 @@ msgstr "" msgid "Unlock" msgstr "" -#: lib/Forms/Search.php:42 +#: lib/Forms/Search.php:52 msgid "Unpublish" msgstr "" -#: templates/edit/info.inc:17 templates/edit/info.php:17 +#: templates/edit/info.php:17 msgid "Unpublish date" msgstr "" -#: add.php:481 templates/edit/info.inc:81 templates/edit/info.php:86 +#: add.php:118 add.php:576 templates/edit/info.php:86 msgid "Update" msgstr "" @@ -814,11 +880,11 @@ msgid "Use the following link to trackback from your own site: " msgstr "" #: templates/reads/header.inc:6 templates/edit/header.inc:9 -#: lib/Forms/Search.php:43 lib/Block/my_comments.php:57 +#: lib/Forms/Search.php:53 lib/Block/my_comments.php:57 msgid "User" msgstr "" -#: templates/edit/info.inc:89 templates/edit/info.php:94 +#: templates/edit/info.php:94 msgid "View" msgstr "" @@ -830,7 +896,7 @@ msgstr "" msgid "View items" msgstr "" -#: templates/edit/info.inc:21 templates/edit/info.php:21 +#: templates/edit/info.php:21 msgid "Yes" msgstr "" @@ -838,38 +904,38 @@ msgstr "" msgid "You are not authorised for this action." msgstr "" -#: mail.php:47 +#: mail.php:42 msgid "You have no email set." msgstr "" -#: edit.php:24 +#: edit.php:18 msgid "You have not editor permission on any category." msgstr "" -#: edit.php:67 +#: edit.php:60 msgid "activated" msgstr "" -#: edit.php:59 +#: edit.php:52 msgid "deactivated" msgstr "" -#: delete.php:55 +#: delete.php:73 msgid "deleted" msgstr "" -#: edit.php:75 +#: edit.php:68 msgid "locked" msgstr "" -#: delete.php:57 +#: delete.php:75 msgid "not deleted" msgstr "" -#: edit.php:116 +#: edit.php:109 msgid "renewed" msgstr "" -#: edit.php:83 +#: edit.php:76 msgid "unlocked" msgstr "" diff --git a/news/po/sl_SI.po b/news/po/sl_SI.po index 2e8a84617..bbc4d1c64 100644 --- a/news/po/sl_SI.po +++ b/news/po/sl_SI.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: sl_SI\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" -"POT-Creation-Date: 2008-01-15 13:59+0100\n" +"POT-Creation-Date: 2009-01-21 01:31+0100\n" "PO-Revision-Date: 2008-01-15 14:13+0100\n" "Last-Translator: Marko Milost \n" "Language-Team: Slovene \n" @@ -14,20 +14,20 @@ msgstr "" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=3;\n" -#: templates/edit/info.inc:86 templates/edit/info.php:91 +#: templates/edit/info.php:91 msgid " at " msgstr " ob " -#: templates/edit/info.inc:86 templates/edit/info.php:91 +#: templates/edit/info.php:91 msgid " by " msgstr " od " -#: content_edit.php:28 +#: content_edit.php:26 #, php-format msgid "%s :: Add Content" msgstr "%s :: Dodaj vsebino" -#: mail.php:51 +#: mail.php:46 #, php-format msgid "" "%s would you like to invite you to read the news\n" @@ -42,11 +42,12 @@ msgstr "" " Objavljeno: %s\n" " Povezava: %s" -#: templates/news/news.inc:18 templates/news/news.php:18 +#: templates/news/news.php:18 msgid "* Sponsored news" msgstr "* Komercialna objava" -#: add.php:87 add.php:94 add.php:142 +#: add.php:129 add.php:136 add.php:153 lib/Forms/Search.php:31 +#: lib/Forms/Search.php:34 lib/Forms/Search.php:38 msgid "-- select --" msgstr "-- izberi --" @@ -54,15 +55,15 @@ msgstr "-- izberi --" msgid "Action" msgstr "Ukaz" -#: templates/edit/row.inc:20 templates/edit/row.php:20 +#: templates/edit/row.php:20 msgid "Activate" msgstr "Aktiviraj" -#: lib/News.php:451 +#: lib/News.php:1123 msgid "Add" msgstr "Vpis" -#: content.php:23 +#: content.php:24 msgid "Add Content" msgstr "Dodaj vsebino" @@ -70,6 +71,10 @@ msgstr "Dodaj vsebino" msgid "Add New" msgstr "Dodaj novo" +#: lib/Categories.php:471 lib/Categories.php:485 +msgid "Add New Item" +msgstr "Dodaj novo" + #: admin/sources/edit.php:19 msgid "Add Source" msgstr "Dodaj vir" @@ -78,43 +83,47 @@ msgstr "Dodaj vir" msgid "Add category" msgstr "Dodaj kategorije" -#: add.php:69 +#: add.php:95 msgid "Add news" msgstr "Dodaj novice" -#: templates/news/tools.inc:16 templates/news/tools.php:16 +#: templates/news/tools.php:18 msgid "Add to bookmarks." msgstr "Dodaj med priljubljene" -#: templates/news/tools.inc:22 templates/news/tools.php:22 +#: templates/news/tools.php:24 msgid "Add to notes." msgstr "Dodaj med zapiske" -#: add.php:141 +#: add.php:152 msgid "Additional news attributes" msgstr "Dodatne lastnosti novice" -#: lib/api.php:52 +#: add.php:218 lib/api.php:49 msgid "Admin" msgstr "Administracija" -#: lib/News.php:459 +#: lib/News.php:1131 msgid "Administration" msgstr "Administracija" -#: templates/edit/info.inc:21 templates/edit/info.php:21 +#: templates/edit/info.php:21 msgid "Allow comments" msgstr "Dovoli komentarje" -#: lib/News.php:449 +#: lib/News.php:1121 msgid "Archive" msgstr "Arhiv" -#: delete.php:25 +#: delete_file.php:22 +msgid "Are you sure you want to delete file?" +msgstr "Resnično želite to datoteko?" + +#: delete.php:22 msgid "Are you sure you want to delete this news?" msgstr "Resnično želite izbrisati to novico?" -#: lib/Forms/Search.php:40 +#: lib/Forms/Search.php:49 msgid "Ascending" msgstr "Naraščajoče" @@ -122,60 +131,64 @@ msgstr "Naraščajoče" msgid "Ascesending" msgstr "Naraščajoče" -#: lib/News.php:175 +#: lib/News.php:216 msgid "Attached files: " msgstr "Pripete datoteke: " -#: edit.php:51 +#: edit.php:44 msgid "Attachment deleted" msgstr "Pripeta datoteka je bila izbrisana" -#: add.php:214 lib/Forms/Search.php:37 +#: lib/Forms/Search.php:46 msgid "Attachments" msgstr "Pripete datoteke" -#: add.php:140 +#: add.php:151 msgid "Attributes" msgstr "Lastnosti" -#: templates/news/info.inc:10 templates/news/info.php:10 +#: templates/news/info.php:10 msgid "Besed" msgstr "Besed" -#: trackback.php:67 +#: trackback.php:65 #, php-format msgid "Blog entry %s does not exist." msgstr "Blog vpis %s ne obstaja." -#: templates/news/blog.inc:3 templates/news/blog.php:3 +#: templates/news/blog.php:3 msgid "Blogs" msgstr "Blogi" -#: browse.php:20 search.php:21 +#: browse.php:16 search.php:16 msgid "Browse" msgstr "Prebrskaj" -#: templates/news/info.inc:4 templates/news/info.php:4 +#: templates/news/info.php:4 msgid "By" msgstr "Od" -#: delete.php:26 admin/categories/delete.php:18 admin/sources/delete.php:19 +#: delete_file.php:23 delete.php:23 admin/categories/delete.php:18 +#: admin/sources/delete.php:19 msgid "Cancel" msgstr "Prekliči" -#: add.php:387 +#: files.php:52 #, php-format -msgid "Cannot access file %s" -msgstr "Ne morem odpreti datoteke %s" +msgid "Cannot read file %s" +msgstr "Ne morem prebrati datoteke %s" + +#: add.php:199 +msgid "Caption" +msgstr "Komentar k sliki" -#: admin/tabs.php:27 lib/api.php:60 lib/Block/categories.php:3 -#: lib/Block/categories.php:21 templates/categories/edit.html:5 -#: templates/categories/index.html:4 templates/categories/delete.html:5 +#: admin/tabs.php:25 lib/api.php:57 lib/Block/categories.php:3 +#: lib/Block/categories.php:21 msgid "Categories" msgstr "Kategorije" -#: lib/Forms/Search.php:30 lib/Block/category.php:35 templates/menu.inc:4 -#: templates/news/info.inc:6 templates/news/info.php:6 +#: templates/menu.inc:4 templates/news/info.php:6 lib/Forms/Search.php:34 +#: lib/Block/category.php:35 msgid "Category" msgstr "Kategorija" @@ -187,7 +200,7 @@ msgstr "Urejanje kategorij" msgid "Category deleted." msgstr "Kategorija je bila izbrisana." -#: admin/categories/edit.php:44 +#: admin/categories/edit.php:46 #, php-format msgid "Category succesfully saved." msgstr "Kategorija je bila uspešno shranjena." @@ -196,34 +209,33 @@ msgstr "Kategorija je bila uspešno shranjena." msgid "Category was not deleted." msgstr "Kategorija ni bila izbrisana." -#: templates/browse/row.inc:9 templates/news/info.inc:9 -#: templates/news/info.php:9 +#: templates/browse/row.inc:9 templates/news/info.php:9 msgid "Chars" msgstr "Znakov" -#: lib/Forms/Search.php:35 templates/browse/row.inc:10 -#: templates/edit/header.inc:13 +#: templates/browse/row.inc:10 templates/edit/header.inc:13 +#: lib/Forms/Search.php:44 msgid "Comments" msgstr "Komentarjev" -#: lib/News.php:411 +#: lib/News.php:487 msgid "Comments are not supported." msgstr "Komentarji niso podprti." -#: lib/News.php:185 +#: lib/News.php:222 #, php-format msgid "Compress and dowload %s" msgstr "Kompresiraj in prenesi datoteko %s" -#: lib/News.php:174 +#: lib/News.php:215 msgid "Compress and dowload all files at once" msgstr "Kompresiraj in prenesi vse datoteke naenkrat" -#: lib/Forms/Search.php:25 templates/edit/row.inc:43 templates/edit/row.php:43 +#: templates/edit/row.php:46 lib/Forms/Search.php:29 msgid "Confirmed" msgstr "Potrjena" -#: add.php:82 add.php:112 +#: add.php:124 add.php:147 msgid "Content" msgstr "Vsebina" @@ -231,21 +243,26 @@ msgstr "Vsebina" msgid "Date" msgstr "Datum" -#: templates/edit/row.inc:17 templates/edit/row.php:17 +#: templates/edit/row.php:17 msgid "Deactivate" msgstr "Deaktiviraj" -#: admin/categories/index.php:29 admin/categories/index.php:32 -#: admin/sources/index.php:27 admin/sources/index.php:34 -#: templates/edit/row.inc:23 templates/edit/row.php:23 +#: templates/edit/row.php:23 admin/categories/index.php:29 +#: admin/categories/index.php:32 admin/sources/index.php:27 +#: admin/sources/index.php:34 lib/News.php:206 msgid "Delete" msgstr "Izbriši" -#: add.php:101 +#: lib/News.php:227 +#, php-format +msgid "Delete %s" +msgstr "Izbriši %s" + +#: add.php:101 add.php:118 msgid "Delete existing picture" msgstr "Zbriši obstoječo sliko" -#: lib/Forms/Search.php:39 +#: lib/Forms/Search.php:48 msgid "Descending" msgstr "Padajoče" @@ -253,15 +270,15 @@ msgstr "Padajoče" msgid "Descesending" msgstr "Padajoče" -#: admin/categories/edit.php:31 templates/categories/index.php:8 +#: templates/categories/index.php:8 admin/categories/edit.php:32 msgid "Description" msgstr "Opis" -#: diff.php:18 templates/edit/info.inc:95 templates/edit/info.php:100 +#: diff.php:14 templates/edit/info.php:100 msgid "Diff" msgstr "Razlike" -#: add.php:175 +#: add.php:227 msgid "Disallow comments" msgstr "Ne dovoli komentarjev" @@ -273,23 +290,22 @@ msgstr "Resnično želite izbrisati izbrano kategorijo?" msgid "Do you really wont to delete this source?" msgstr "Resnično želite izbrisati ta vir?" -#: lib/News.php:169 +#: lib/News.php:210 msgid "Dowload" msgstr "Prenesi" -#: lib/News.php:186 +#: lib/News.php:223 #, php-format msgid "Dowload %s" msgstr "Prenesi datoteko %s" -#: lib/News.php:170 +#: lib/News.php:211 msgid "Dowload Zip Compressed" msgstr "Presnemi Zip kompresirano datoteko" -#: edit.php:123 admin/categories/index.php:27 admin/categories/index.php:34 +#: edit.php:116 templates/edit/row.php:6 templates/edit/row.php:7 +#: admin/categories/index.php:27 admin/categories/index.php:34 #: admin/sources/index.php:25 admin/sources/index.php:36 -#: templates/edit/row.inc:6 templates/edit/row.inc:7 templates/edit/row.php:6 -#: templates/edit/row.php:7 msgid "Edit" msgstr "Uredi" @@ -301,64 +317,96 @@ msgstr "Uredi vir" msgid "Edit category" msgstr "Uredi kategoijo" -#: templates/edit/info.inc:75 templates/edit/info.php:80 +#: templates/edit/info.php:80 msgid "Edit history: " msgstr "Zgodovina urejanja:" -#: add.php:434 +#: add.php:542 msgid "Edit news" msgstr "Uredi novico" -#: lib/Forms/Search.php:47 templates/edit/info.inc:25 -#: templates/edit/info.php:25 +#: templates/edit/info.php:25 lib/Forms/Search.php:56 msgid "Editor" msgstr "Urednik" -#: lib/api.php:55 +#: lib/api.php:52 msgid "Editors" msgstr "Uredniki" -#: lib/News.php:458 +#: lib/News.php:1130 msgid "Editorship" msgstr "Uredništvo" -#: add.php:144 +#: add.php:177 +msgid "Enter gallery ID or upload images below" +msgstr "Vnesite ID galerija ali naložite slike" + +#: add.php:155 msgid "Enter news ids separated by commas." msgstr "Vnesi id-je novic ločene z vejico." -#: add.php:110 -msgid "Enter one or more keywords that describe your news. Separate them by spaces." -msgstr "" +#: add.php:145 +msgid "" +"Enter one or more keywords that describe your news. Separate them by spaces." +msgstr "Vnesite eno ali več besed ločenih s presledki." -#: add.php:147 +#: add.php:158 msgid "Enter threads separated by commas." msgstr "Vnesi id-je debat ločene z vejico." -#: templates/news/today.inc:11 templates/news/today.php:11 +#: delete_file.php:44 +#, php-format +msgid "Error deleteing file \"%s\" from news \"%s\"" +msgstr "Napaka pri brisanju datoteke \"%s\" z novice \"%s\"" + +#: templates/news/today.php:11 msgid "Events on this day." msgstr "Dogodki tega dne" -#: files.php:56 +#: add.php:211 +msgid "File" +msgstr "Datoteka" + +#: delete_file.php:49 +#, php-format +msgid "File \"%s\" was deleted from news \"%s\"" +msgstr "Datoteke \"%s\" je bila odstranjena od novice \"%s\"" + +#: delete_file.php:53 +#, php-format +msgid "File \"%s\" was not deleted from news \"%s\"" +msgstr "Datoteke \"%s\" ni bila odstranjena od novice \"%s\"" + +#: add.php:204 add.php:458 +msgid "Files" +msgstr "Datoteke" + +#: files.php:60 #, php-format msgid "FilesOfNews-%s" msgstr "DatotekeNovice-%s" -#: add.php:206 +#: add.php:258 msgid "Form ID" msgstr "Formular" -#: add.php:207 +#: add.php:259 msgid "Form to" msgstr "Veljavnost formularja " -#: templates/news/blog.inc:10 templates/news/blog.php:10 +#: templates/news/blog.php:10 msgid "From: " msgstr "Od: " -#: add.php:156 add.php:163 +#: add.php:180 add.php:187 msgid "Gallery" msgstr "Galerija" +#: lib/api.php:101 +#, php-format +msgid "Has commented news \"%s\"" +msgstr "Je komentiral novico \"%s\"" + #: lib/Block/most_commented.php:26 lib/Block/most_read.php:26 msgid "How many days back to check?" msgstr "Koliko dni stare novice naj pregledam?" @@ -380,29 +428,44 @@ msgstr "Kako naj prikažem novice" msgid "IP" msgstr "ID" -#: lib/Forms/Search.php:33 templates/categories/index.php:5 -#: templates/sources/index.php:5 config/prefs.php.dist:29 +#: templates/categories/index.php:5 templates/sources/index.php:5 +#: lib/Forms/Search.php:42 config/prefs.php.dist:29 msgid "Id" msgstr "Id" -#: admin/categories/edit.php:36 admin/sources/edit.php:37 +#: admin/categories/edit.php:38 admin/sources/edit.php:37 msgid "Image" msgstr "Slika" -#: templates/edit/row.inc:9 templates/edit/row.inc:10 templates/edit/row.php:9 -#: templates/edit/row.php:10 +#: add.php:161 +msgid "Images" +msgstr "Slike" + +#: add.php:196 +msgid "" +"Images will be added to a gallery linked with this article. You can edit and " +"manage images in gallery." +msgstr "" +"Slike bodo naložene v galerijo, ki bo povezana z člankom. Slike lahko " +"urajate v galeriji" + +#: templates/edit/row.php:9 templates/edit/row.php:10 msgid "Info" msgstr "Info" -#: templates/edit/info.inc:83 templates/edit/info.php:88 +#: templates/edit/info.php:88 msgid "Insert" msgstr "Dodana" +#: templates/common-header.inc:27 rss/index.php:44 rss/comments.php:22 #: lib/Block/last_comments.php:3 lib/Block/last_comments.php:31 -#: templates/common-header.inc:27 msgid "Last comments" msgstr "Zadnji komentarji" +#: lib/Block/my_comments.php:3 +msgid "Last comments on my news" +msgstr "Zadnji komentarji na moje novice" + #: lib/Block/most_commented.php:3 lib/Block/most_commented.php:17 msgid "Last most commented news" msgstr "Zadnje najbolj komentirane" @@ -411,7 +474,9 @@ msgstr "Zadnje najbolj komentirane" msgid "Last most read news" msgstr "Zadnje najbolj brane" -#: lib/Block/last.php:3 lib/Block/last.php:17 templates/common-header.inc:26 +#: templates/common-header.inc:26 rss/index.php:38 rss/news.php:33 +#: lib/Block/last.php:3 lib/Block/last.php:17 +#, php-format msgid "Last news" msgstr "Zadnje novice" @@ -432,20 +497,25 @@ msgstr "Zadnje novice v %s" msgid "Last news in category" msgstr "Zadnje novice v kategoriji" -#: note.php:29 pdf.php:51 +#: note.php:24 pdf.php:51 msgid "Link" msgstr "Povezava" -#: templates/edit/row.inc:30 templates/edit/row.php:30 +#: templates/edit/row.php:30 msgid "Lock" msgstr "Zakleni" -#: lib/Forms/Search.php:26 templates/edit/row.inc:44 templates/edit/row.php:44 +#: templates/edit/row.php:50 lib/Forms/Search.php:30 msgid "Locked" msgstr "Zaklenjena" -#: admin/categories/edit.php:30 admin/sources/edit.php:32 +#: add.php:82 +#, php-format +msgid "Maximum file size: %s; with a total of: %s" +msgstr "Največja velikost datoteke: %s; skupno: %s" + #: templates/categories/index.php:6 templates/sources/index.php:6 +#: admin/categories/edit.php:31 admin/sources/edit.php:32 msgid "Name" msgstr "Ime" @@ -453,18 +523,18 @@ msgstr "Ime" msgid "News" msgstr "Novica" -#: reads.php:33 +#: reads.php:28 #, php-format msgid "News %s" msgstr "Novica %s" -#: edit.php:51 edit.php:59 edit.php:67 edit.php:75 edit.php:83 edit.php:116 -#: delete.php:55 delete.php:57 +#: edit.php:44 edit.php:52 edit.php:60 edit.php:68 edit.php:76 edit.php:109 +#: delete.php:73 delete.php:75 #, php-format msgid "News %s: %s" msgstr "Novica %s: %s" -#: add.php:422 +#: add.php:530 msgid "" "News added. The editors will check the entry and confirm it if they find it " "suitable." @@ -472,104 +542,107 @@ msgstr "" "Novica je bila vpisana. Uredniki bodo pregledali vaš vpis in ga potrdili, če " "je le-ta primeren za objavo pri nas." -#: add.php:83 +#: add.php:219 +msgid "News administrator options" +msgstr "Adminstratorske lastnosti" + +#: add.php:125 msgid "News content" msgstr "Vsebina novice" -#: templates/news/info.inc:3 templates/news/info.php:3 +#: templates/news/info.php:3 msgid "News data" msgstr "O novici" -#: templates/news/today.inc:5 templates/news/today.php:5 +#: add.php:162 +msgid "News images" +msgstr "Slike k novici" + +#: templates/news/today.php:5 msgid "News of this day." msgstr "Novice tega dne" -#: add.php:424 +#: add.php:532 msgid "News published." msgstr "Novica objavljena." -#: mail.php:63 +#: mail.php:57 #, php-format msgid "News succesfully send to %s" msgstr "Novice je bila uspešno poslana na %s." -#: note.php:45 +#: note.php:40 msgid "News sucessfuly added to you notes." msgstr "Novica je bila uspešno dodana med vaše zapiske" -#: add.php:426 +#: add.php:534 msgid "News updated." msgstr "Novica osvežena." -#: templates/edit/info.inc:21 templates/edit/info.php:21 +#: templates/edit/info.php:21 msgid "No" msgstr "Št." -#: diff.php:59 +#: diff.php:55 msgid "No change." msgstr "Ni spremembe." -#: mail.php:41 +#: mail.php:36 msgid "No mail entered." msgstr "Pozabili ste vnesti email." -#: lib/Block/last_comments.php:19 +#: lib/Block/my_comments.php:19 lib/Block/last_comments.php:19 msgid "Number of comments to display" msgstr "Število komentarjev" -#: note.php:28 pdf.php:50 templates/news/info.inc:5 templates/news/info.php:5 +#: note.php:23 pdf.php:50 templates/news/info.php:5 msgid "On" msgstr "Objavljena" -#: templates/news/today.inc:3 templates/news/today.php:3 +#: templates/news/today.php:3 msgid "On this day" msgstr "Na današnji dan" -#: delete.php:16 +#: delete_file.php:16 delete.php:16 msgid "Only admin can delete a news." msgstr "Samo administratorji lahko brišejo novice." -#: add.php:64 +#: add.php:90 msgid "Only authenticated users can post news." msgstr "Samo ragistrirani uporabniki lahko vpisujejo novice." -#: mail.php:36 +#: mail.php:31 msgid "Only authenticated users can send mails." msgstr "Samo ragistrirani uporabniki lahko pošiljajo novice." -#: lib/Forms/Search.php:32 +#: lib/Forms/Search.php:41 msgid "Order by" msgstr "Razvrsti po" -#: lib/News.php:447 +#: lib/News.php:1119 msgid "Overview" msgstr "Pregled" -#: templates/news/tools.inc:9 templates/news/tools.php:9 +#: templates/news/tools.php:9 msgid "PDF" msgstr "PDF" -#: admin/categories/edit.php:32 templates/categories/index.php:7 +#: templates/categories/index.php:7 admin/categories/edit.php:35 msgid "Parent" msgstr "Sorodne" -#: add.php:144 templates/news/parents.inc:5 templates/news/parents.php:5 -#: templates/edit/info.inc:33 templates/edit/info.php:33 +#: add.php:155 templates/news/parents.php:5 templates/edit/info.php:33 msgid "Parents" msgstr "Sorodne novice" -#: add.php:99 +#: add.php:165 add.php:198 msgid "Picture" msgstr "Slika" -#: add.php:108 +#: add.php:169 msgid "Picture comment" msgstr "Komentar k sliki" -#: add.php:101 -msgid "Picture delete" -msgstr "Izbriši sliko" - #: lib/Block/jonah.php:4 lib/Block/jonah.php:24 msgid "Press overview" msgstr "Pregled tiska" @@ -578,20 +651,20 @@ msgstr "Pregled tiska" msgid "Preview" msgstr "Pregled %s" -#: lib/News.php:187 +#: lib/News.php:224 #, php-format msgid "Preview %s" msgstr "Pregled %s" -#: add.php:87 templates/edit/info.inc:10 templates/edit/info.php:10 +#: add.php:129 templates/edit/info.php:10 msgid "Primary category" msgstr "Primarna kategorija" -#: templates/news/tools.inc:6 templates/news/tools.php:6 +#: templates/news/tools.php:6 msgid "Printer firendly" msgstr "Tiskanju prijazen izpis" -#: add.php:85 lib/Forms/Search.php:42 +#: add.php:127 lib/Forms/Search.php:51 msgid "Publish" msgstr "Objavi ob" @@ -599,70 +672,69 @@ msgstr "Objavi ob" msgid "Publish at" msgstr "Objavi ob" -#: lib/Forms/Search.php:32 config/prefs.php.dist:28 +#: lib/Forms/Search.php:41 config/prefs.php.dist:28 msgid "Publish date" msgstr "Objavi ob" -#: templates/news/parents.inc:8 templates/news/parents.php:8 -#: templates/edit/row.inc:48 templates/edit/row.php:48 +#: templates/news/parents.php:8 templates/edit/row.php:54 msgid "Read" msgstr "Preberi" -#: lib/Forms/Search.php:36 templates/edit/header.inc:10 +#: templates/edit/header.inc:10 lib/Forms/Search.php:45 msgid "Reads" msgstr "Branj" -#: delete.php:26 delete.php:33 admin/categories/delete.php:18 -#: admin/categories/delete.php:24 admin/sources/delete.php:19 -#: admin/sources/delete.php:25 +#: delete_file.php:23 delete_file.php:41 delete.php:23 delete.php:34 +#: admin/categories/delete.php:18 admin/categories/delete.php:24 +#: admin/sources/delete.php:19 admin/sources/delete.php:25 msgid "Remove" msgstr "Odstrani" -#: templates/edit/info.inc:92 templates/edit/info.php:97 +#: templates/edit/info.php:97 msgid "Renew" msgstr "Obnovi" -#: add.php:482 +#: add.php:118 add.php:120 add.php:577 msgid "Reset" msgstr "Povrni" -#: admin/categories/edit.php:34 admin/sources/edit.php:35 +#: admin/categories/edit.php:36 admin/sources/edit.php:35 msgid "Resize Image" msgstr "Spremeni velikost slike" -#: add.php:77 +#: add.php:120 msgid "Save" msgstr "Shrani" -#: lib/News.php:450 lib/Forms/Search.php:18 lib/Forms/Search.php:20 +#: lib/News.php:1122 lib/Forms/Search.php:22 lib/Forms/Search.php:24 msgid "Search" msgstr "Najdi" -#: lib/Forms/Search.php:22 +#: lib/Forms/Search.php:26 msgid "Search world" msgstr "Iskana beseda" -#: add.php:142 templates/edit/info.inc:13 templates/edit/info.php:13 +#: add.php:153 templates/edit/info.php:13 msgid "Secondary category" msgstr "Pomožna kategorija" +#: lib/Categories.php:478 +msgid "Select Category" +msgstr "Izberite kategorijo" + #: lib/Block/jonah.php:35 msgid "Select a feed." msgstr "Izberite vir." -#: add.php:214 -msgid "Select files" -msgstr "Izberi datoteke" - -#: add.php:195 templates/edit/info.inc:47 templates/edit/info.php:47 +#: add.php:247 templates/edit/info.php:47 msgid "Selling item" msgstr "Prodajani artikel" -#: templates/news/mail.inc:2 templates/news/mail.php:2 +#: templates/news/mail.php:2 msgid "Send by mail" msgstr "Pošlji po emailu" -#: lib/News.php:101 +#: lib/News.php:100 msgid "Services/Trackback is not installed." msgstr "Services/Trackback ni nameščen." @@ -678,12 +750,11 @@ msgstr "Preskoči kategorijo" msgid "Sort news by" msgstr "Razvrsti novice po" -#: add.php:143 lib/Forms/Search.php:39 templates/edit/info.inc:29 -#: templates/edit/info.php:29 +#: add.php:154 templates/edit/info.php:29 lib/Forms/Search.php:48 msgid "Sort order" msgstr "Vrstni red" -#: add.php:94 templates/edit/info.inc:37 templates/edit/info.php:37 +#: add.php:136 templates/edit/info.php:37 lib/Forms/Search.php:38 msgid "Source" msgstr "Vir" @@ -691,15 +762,15 @@ msgstr "Vir" msgid "Source deleted." msgstr "Vir je bil izbrisan." -#: add.php:96 templates/edit/info.inc:41 templates/edit/info.php:41 +#: add.php:138 templates/edit/info.php:41 msgid "Source link" msgstr "Izvirna novica" -#: templates/news/info.inc:18 templates/news/info.php:18 +#: templates/news/info.php:18 msgid "Source media" msgstr "Vir novice" -#: templates/news/info.inc:13 templates/news/info.php:13 +#: templates/news/info.php:13 msgid "Source news" msgstr "Izvirna novica" @@ -711,7 +782,7 @@ msgstr "Vir je bil uspešno osvežen." msgid "Source was not deleted." msgstr "Vir ni bil izbrisan." -#: admin/tabs.php:26 lib/Block/sources.php:3 lib/Block/sources.php:21 +#: admin/tabs.php:24 lib/Block/sources.php:3 lib/Block/sources.php:21 msgid "Sources" msgstr "Viri" @@ -719,23 +790,23 @@ msgstr "Viri" msgid "Sources Administration" msgstr "Urejanje virov" -#: add.php:170 +#: add.php:222 msgid "Sponsored" msgstr "Komercialna" -#: lib/Forms/Search.php:27 templates/edit/header.inc:6 +#: templates/edit/header.inc:6 lib/Forms/Search.php:31 msgid "Status" msgstr "Status" -#: lib/News.php:454 +#: lib/News.php:1126 msgid "Tag cloud" msgstr "Tagi novic" -#: add.php:110 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24 +#: add.php:145 lib/Block/tags_cloud.php:3 lib/Block/tags_cloud.php:24 msgid "Tags" msgstr "Tagi" -#: templates/news/blog.inc:7 templates/news/blog.php:7 +#: templates/news/blog.php:7 msgid "Talkbacks to this article:" msgstr "Talkback na to novico:" @@ -747,72 +818,81 @@ msgstr "Hvala" msgid "There are no news to display." msgstr "Ni novic za prikaz." -#: lib/News.php:508 +#: lib/News.php:557 #, php-format msgid "There requested news %s don't exist." msgstr "Izbrana novica ne %s obstaja." -#: news.php:34 +#: news.php:29 msgid "There requested version don't exist." msgstr "Izbrana verzja ne obstaja." -#: add.php:147 templates/news/threads.inc:6 templates/news/threads.php:6 +#: add.php:433 +msgid "There was an error creating gallery: " +msgstr "Prišlo je do napake pri tvorjenju galerije: " + +#: add.php:449 +#, fuzzy +msgid "There was an error with the uploaded image: " +msgstr "Pršlo je do napake pri nalaganju slike: " + +#: add.php:158 templates/news/threads.php:6 #, php-format msgid "Threads in %s" msgstr "Debate v %s" -#: add.php:107 lib/Forms/Search.php:34 templates/edit/header.inc:7 -#: config/prefs.php.dist:30 +#: add.php:143 templates/edit/header.inc:7 lib/Forms/Search.php:43 +#: lib/Block/my_comments.php:56 config/prefs.php.dist:30 msgid "Title" msgstr "Naslov" -#: templates/news/tools.inc:3 templates/news/tools.php:3 +#: templates/news/tools.php:3 msgid "Tools" msgstr "Orodja" -#: templates/news/blog.inc:22 templates/news/blog.php:22 +#: templates/news/blog.php:22 msgid "Trackback this blog on this site." msgstr "Vpišite blog na to novico." -#: lib/News.php:652 +#: lib/News.php:703 #, php-format msgid "URL already trackbacked: %s" msgstr "URL je bil že zapisan: %s" -#: lib/Forms/Search.php:24 templates/edit/row.inc:42 templates/edit/row.php:42 +#: templates/edit/row.php:42 lib/Forms/Search.php:28 msgid "Unconfirmed" msgstr "Nepotrjena" -#: templates/edit/row.inc:27 templates/edit/row.php:27 +#: templates/edit/row.php:27 msgid "Unlock" msgstr "Odkleni" -#: lib/Forms/Search.php:43 +#: lib/Forms/Search.php:52 msgid "Unpublish" msgstr "Odstrani ob" -#: templates/edit/info.inc:17 templates/edit/info.php:17 +#: templates/edit/info.php:17 msgid "Unpublish date" msgstr "Odstrani dne" -#: add.php:481 templates/edit/info.inc:81 templates/edit/info.php:86 +#: add.php:118 add.php:576 templates/edit/info.php:86 msgid "Update" msgstr "Ažuriraj" -#: admin/sources/edit.php:33 templates/sources/index.php:7 +#: templates/sources/index.php:7 admin/sources/edit.php:33 msgid "Url" msgstr "Url" -#: templates/news/blog.inc:16 templates/news/blog.php:16 +#: templates/news/blog.php:16 msgid "Use the following link to trackback from your own site: " msgstr "Uporabite sledeči naslov za trakback z vaše strani: " -#: lib/Forms/Search.php:44 templates/reads/header.inc:6 -#: templates/edit/header.inc:9 +#: templates/reads/header.inc:6 templates/edit/header.inc:9 +#: lib/Forms/Search.php:53 lib/Block/my_comments.php:57 msgid "User" msgstr "Uporabnik" -#: templates/edit/info.inc:89 templates/edit/info.php:94 +#: templates/edit/info.php:94 msgid "View" msgstr "Preglej" @@ -824,7 +904,7 @@ msgstr "Preglej novice" msgid "View items" msgstr "Preglej novice" -#: templates/edit/info.inc:21 templates/edit/info.php:21 +#: templates/edit/info.php:21 msgid "Yes" msgstr "Da" @@ -832,39 +912,38 @@ msgstr "Da" msgid "You are not authorised for this action." msgstr "Niste avtorizirani za ta ukaz." -#: mail.php:47 +#: mail.php:42 msgid "You have no email set." msgstr "Nimate nastavljenega email naslova." -#: edit.php:24 +#: edit.php:18 msgid "You have not editor permission on any category." msgstr "Nimate uredniških pravic do nobene kategorije." -#: edit.php:67 +#: edit.php:60 msgid "activated" msgstr "aktivirana" -#: edit.php:59 +#: edit.php:52 msgid "deactivated" msgstr "deaktivirana" -#: delete.php:55 +#: delete.php:73 msgid "deleted" msgstr "izbrisana" -#: edit.php:75 +#: edit.php:68 msgid "locked" msgstr "zaklenjena" -#: delete.php:57 +#: delete.php:75 msgid "not deleted" msgstr "ni zbrisana" -#: edit.php:116 +#: edit.php:109 msgid "renewed" msgstr "povrnjena" -#: edit.php:83 +#: edit.php:76 msgid "unlocked" msgstr "odklenjena" - diff --git a/news/print.php b/news/print.php index 024ee4129..efde21cf3 100644 --- a/news/print.php +++ b/news/print.php @@ -2,19 +2,14 @@ /** * Print news * - * Copyright 2006 Duck + * $Id: print.php 803 2008-08-27 08:29:20Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: print.php 183 2008-01-06 17:39:50Z duck $ - * - * @author Duck + * @author Duck * @package News */ - -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; $id = Util::getFormData('id'); $version = Util::getFormData('version', false); diff --git a/news/reads.php b/news/reads.php index a9859669f..6425f4f0e 100644 --- a/news/reads.php +++ b/news/reads.php @@ -2,19 +2,14 @@ /** * News reads * - * Copyright 2006 Duck + * $Id: reads.php 803 2008-08-27 08:29:20Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: reads.php 183 2008-01-06 17:39:50Z duck $ - * - * @author Duck + * @author Duck * @package News */ - -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; if (!Auth::isAuthenticated()) { Horde::authenticationFailureRedirect(); diff --git a/news/rss/comments.php b/news/rss/comments.php index 9207288df..636421c18 100644 --- a/news/rss/comments.php +++ b/news/rss/comments.php @@ -1,8 +1,8 @@ get($cache_key, $conf['cache']['default_lifetime']); +$rss = $cache->get($cache_key, $conf['cache']['default_lifetime']); if (!$rss) { $list = News::getLastComments(50); $title = _("Last comments"); - $rss = ' diff --git a/news/rss/index.php b/news/rss/index.php index 7c4d4ee9c..e5b010c54 100644 --- a/news/rss/index.php +++ b/news/rss/index.php @@ -2,7 +2,7 @@ /** * $Id: index.php 183 2008-01-06 17:39:50Z duck $ * - * Copyright 2007-2009 The Horde Project (http://www.horde.org/) + * Copyright 2007 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. diff --git a/news/rss/news.php b/news/rss/news.php index a2a15f473..00bb853be 100755 --- a/news/rss/news.php +++ b/news/rss/news.php @@ -1,8 +1,8 @@ getCategories(false); $title = sprintf(_("Last news"), $registry->get('name', 'horde')); - $read_url = Horde::applicationUrl('news.php', true, -1); $lastnewstime = 0; foreach ($list as $news_id => $news) { - $news_link = Util::addParameter($read_url, 'id', $news_id); + $news_link = News::getUrlFor('news', $news_id); $rssbody .= ' + ' . htmlspecialchars($news['title']) . ' ' . htmlspecialchars($news['user']). ' ' . $news_link . ' @@ -52,7 +52,7 @@ if (empty($rss)) { $lastnewstime = strtotime($news['publish']); } } - + // Wee need the last published news time $rssheader = ' ' . Horde::applicationUrl('index.php', true, -1) . ' ' . htmlspecialchars($registry->get('name')) . ''; - - $rssfooter = ' '; @@ -79,6 +77,5 @@ if (empty($rss)) { $cache->set($cache_key, $rss); } - header('Content-type: text/xml; charset=utf-8'); echo $rss; diff --git a/news/scripts/sql/news.mysql.sql b/news/scripts/sql/news.mysql.sql index 53f375a93..553368908 100644 --- a/news/scripts/sql/news.mysql.sql +++ b/news/scripts/sql/news.mysql.sql @@ -1,46 +1,50 @@ CREATE TABLE news ( id smallint(5) UNSIGNED NOT NULL auto_increment, - sortorder tinyint(2) NOT NULL default '0', - status tinyint(1) UNSIGNED NOT NULL default '0', - view_count smallint(5) UNSIGNED NOT NULL default '0', - publish datetime default NULL, - unpublish datetime default NULL, - submitted datetime NOT NULL default '0000-00-00 00:00:00', - updated timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - user varchar(11) NOT NULL default '', - editor varchar(11) NOT NULL default '', - sourcelink varchar(34) NOT NULL default '', - source varchar(11) default NULL, - category1 smallint(5) UNSIGNED NOT NULL default '0', - category2 smallint(5) UNSIGNED NOT NULL default '0', - comments smallint(5) NOT NULL default '0', - chars smallint(5) UNSIGNED NOT NULL default '0', - attachments tinyint(1) UNSIGNED NOT NULL default '0', - picture int(4) NOT NULL default '0', - gallery int(10) UNSIGNED NOT NULL default '0', - selling varchar(50) default NULL, - trackbacks int(10) UNSIGNED NOT NULL default '0', - form_id smallint(5) UNSIGNED NOT NULL default '0', - form_ttl int(10) UNSIGNED NOT NULL default '0', + sortorder tinyint(2) NOT NULL DEFAULT '0', + status tinyint(1) UNSIGNED NOT NULL DEFAULT '0', + view_count smallint(5) UNSIGNED NOT NULL DEFAULT '0', + publish datetime DEFAULT NULL, + unpublish datetime DEFAULT NULL, + submitted datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + user varchar(11) NOT NULL DEFAULT '', + editor varchar(11) NOT NULL DEFAULT '', + sourcelink varchar(34) NOT NULL DEFAULT '', + source varchar(11) DEFAULT NULL, + category1 smallint(5) UNSIGNED NOT NULL DEFAULT '0', + category2 smallint(5) UNSIGNED NOT NULL DEFAULT '0', + comments smallint(5) NOT NULL DEFAULT '0', + chars smallint(5) UNSIGNED NOT NULL DEFAULT '0', + attachments tinyint(1) UNSIGNED NOT NULL DEFAULT '0', + picture int(4) NOT NULL DEFAULT '0', + gallery int(10) UNSIGNED NOT NULL DEFAULT '0', + selling varchar(50) DEFAULT NULL, + trackbacks int(10) UNSIGNED NOT NULL DEFAULT '0', + form_id smallint(5) UNSIGNED NOT NULL DEFAULT '0', + form_ttl int(10) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (id), KEY datum (publish), KEY sortorder (sortorder), - KEY STATUS (status), + KEY status (status), + KEY user (user), KEY cat (category1) ); -CREATE TABLE news_attachment ( - id int(10) UNSIGNED NOT NULL default '0', - lang varchar(5) NOT NULL, - filename varchar(85) NOT NULL default '', - filesize int(10) UNSIGNED NOT NULL default '0', - KEY news (id,lang) +CREATE TABLE news_files ( + file_id int(10) UNSIGNED NOT NULL DEFAULT '0', + news_id int(10) UNSIGNED NOT NULL DEFAULT '0', + news_lang varchar(5) NOT NULL, + file_name varchar(85) NOT NULL DEFAULT '', + file_size int(10) UNSIGNED NOT NULL DEFAULT '0', + file_type varchar(85) NOT NULL DEFAULT '', + PRIMARY KEY (file_id), + KEY news (news_id, news_lang) ); CREATE TABLE news_body ( - id smallint(5) UNSIGNED NOT NULL default '0', - lang varchar(5) NOT NULL default '0', - title varchar(67) NOT NULL default '', + id smallint(5) UNSIGNED NOT NULL DEFAULT '0', + lang varchar(5) NOT NULL DEFAULT '0', + title varchar(67) NOT NULL DEFAULT '', abbreviation text NOT NULL, content text NOT NULL, picture_comment varchar(255); @@ -51,7 +55,7 @@ CREATE TABLE news_body ( CREATE TABLE news_categories ( category_id int(10) UNSIGNED NOT NULL auto_increment, category_name varchar(50) NOT NULL, - category_description varchar(255) default NULL, + category_description varchar(255) DEFAULT NULL, category_parentid int(10) UNSIGNED NOT NULL, category_form varchar(50) NOT NULL, category_image int(1) UNSIGNED NOT NULL, @@ -86,18 +90,18 @@ CREATE TABLE news_trackback ( ); CREATE TABLE news_user_reads ( - id int(10) UNSIGNED NOT NULL default '0', - user varchar(85) NOT NULL default '', - ip varchar(9) NOT NULL default '', - readdate datetime NOT NULL default '0000-00-00 00:00:00', + id int(10) UNSIGNED NOT NULL DEFAULT '0', + user varchar(85) NOT NULL DEFAULT '', + ip varchar(9) NOT NULL DEFAULT '', + readdate datetime NOT NULL DEFAULT '0000-00-00 00:00:00', KEY id (id) ); CREATE TABLE news_versions ( - id int(10) UNSIGNED NOT NULL default '0', - version float UNSIGNED NOT NULL default '0', - created datetime NOT NULL default '0000-00-00 00:00:00', - user_uid varchar(85) NOT NULL default '', + id int(10) UNSIGNED NOT NULL DEFAULT '0', + version float UNSIGNED NOT NULL DEFAULT '0', + created datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + user_uid varchar(85) NOT NULL DEFAULT '', content text NOT NULL, PRIMARY KEY (id,version) ); diff --git a/news/search.php b/news/search.php index 5a646d6bf..fafa49be0 100644 --- a/news/search.php +++ b/news/search.php @@ -2,26 +2,20 @@ /** * Search * - * Copyright 2006 Duck + * $Id: search.php 889 2008-09-23 09:52:06Z duck $ * - * See the enclosed file LICENSE for license information (BSD). If you - * did not receive this file, see http://cvs.horde.org/co.php/news/LICENSE. + * Copyright Obala d.o.o. (www.obala.si) * - * $Id: search.php 210 2008-01-10 12:41:43Z duck $ - * - * @author Duck + * @author Duck * @package News */ - -define('NEWS_BASE', dirname(__FILE__)); -require_once NEWS_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/lib/base.php'; require_once NEWS_BASE . '/lib/Forms/Search.php'; // Default vars $title = _("Browse"); $page = Util::getGet('news_page', 0); $per_page = $prefs->getValue('per_page'); -$news_url = Horde::applicationUrl('news.php'); $browse_url = Horde::applicationUrl('browse.php'); $cid = Util::getGet('cid'); @@ -53,7 +47,7 @@ $pager->preserve($criteria); // If we have only one row redirect ot it if ($count == 1 && sizeof($cats) < 2 && $page < 1) { - header('Location: '. Util::addParameter($news_url, 'id', $rows[0]['id'], false)); + header('Location: '. News::getUrlFor('news', $rows[0]['id'])); exit; } @@ -70,4 +64,4 @@ foreach ($rows as $row) { } require_once $browse_template_path . '/footer.inc'; -require_once $registry->get('templates', 'horde') . '/common-footer.inc'; +require_once $registry->get('templates', 'horde') . '/common-footer.inc'; \ No newline at end of file diff --git a/news/templates/block/news.php b/news/templates/block/news.php index 6102bd9e0..1fab9dd9f 100644 --- a/news/templates/block/news.php +++ b/news/templates/block/news.php @@ -3,10 +3,10 @@ news as $news_id => $news) { ?>

news_url, 'id', $news['id']), $news['title']); echo '' . $news['title'] . ' - ' . $news['abbreviation'] . '... (' . $news['comments'] . ')
'; ?>

@@ -16,4 +16,4 @@ echo '' . $news['title'] . ' - ' . $news['abbreviation'] .

- + \ No newline at end of file diff --git a/news/templates/block/titles.php b/news/templates/block/titles.php index 64324a446..504b1d54a 100644 --- a/news/templates/block/titles.php +++ b/news/templates/block/titles.php @@ -7,7 +7,7 @@
getValue('date_format'), strtotime($news['publish'])) . ' - '; -echo Horde::link(Util::addParameter($this->news_url, 'id', $news['id']), $news['abbreviation']); +echo Horde::link(News::getUrlFor('news', $news['id']), $news['abbreviation']); echo $news['title'] . ''; ?>
-categories[$category['category_parentid']]['category_name'] . ' - ' . $category['category_parentid']; diff --git a/news/templates/edit/info.php b/news/templates/edit/info.php index bba91a6c4..850502a04 100644 --- a/news/templates/edit/info.php +++ b/news/templates/edit/info.php @@ -1,10 +1,12 @@
- + - +
+ + \n"; @@ -56,11 +58,11 @@ if (!empty($row['selling'])) { // Form if (!empty($row['form'])) { - // + // } if ($row['attachments']) { - echo News::format_attached($id); + echo $news->format_attached($id); } ?> @@ -84,6 +86,7 @@ if (sizeof($versions)>0) { switch ($version['action']) { case 'update': echo _("Update"); + break; default: echo _("Insert"); break; diff --git a/news/templates/edit/row.php b/news/templates/edit/row.php index f63040334..5cf999f76 100644 --- a/news/templates/edit/row.php +++ b/news/templates/edit/row.php @@ -38,14 +38,20 @@ if (Auth::isAdmin() || isset($allowed_cats[$row['category1']]) || isset($allowed dateFormat($row['publish']) ?> diff --git a/news/templates/news/attachments.php b/news/templates/news/attachments.php index 5d04153a1..c2edb97bd 100644 --- a/news/templates/news/attachments.php +++ b/news/templates/news/attachments.php @@ -1,5 +1,5 @@
' . News::format_attached($id); + echo '

' . $news->format_attached($id); } diff --git a/news/templates/news/blog.php b/news/templates/news/blog.php index 5ebfad716..d56160d90 100644 --- a/news/templates/news/blog.php +++ b/news/templates/news/blog.php @@ -22,7 +22,7 @@ if ($registry->hasMethod('blogs/createUrl')) { echo Horde::link($blog_url) . '' . _("Trackback this blog on this site.") . '
'; } -$read_url = Util::addParameter(Horde::applicationUrl('news.php', true), 'id', $id); +$read_url = News::getUrlFor('news', $id); ?>