From: <al...@us...> - 2008-10-26 19:44:20
|
Revision: 762 http://sciret.svn.sourceforge.net/sciret/?rev=762&view=rev Author: alpeb Date: 2008-10-26 19:44:17 +0000 (Sun, 26 Oct 2008) Log Message: ----------- removed the 'Add Article' and 'Add Bookmark' menu items. Replaced by buttons below the categories that'll add a new article/bookmark for the current category Modified Paths: -------------- trunk/templates/MainView.tpl trunk/templates/header.tpl trunk/views/EditArticle.php trunk/views/EditBookmark.php trunk/views/MainView.php trunk/views/View.php Modified: trunk/templates/MainView.tpl =================================================================== --- trunk/templates/MainView.tpl 2008-10-24 00:21:54 UTC (rev 761) +++ trunk/templates/MainView.tpl 2008-10-26 19:44:17 UTC (rev 762) @@ -67,15 +67,24 @@ </table> </td> </tr> - <!-- BEGIN addCategoryButton_block --> <tr> <td align="right"> + <!-- BEGIN addArticleButton_block --> <span class="button_green"> + <a href="{addArticleLink}">[l]Add Article[/l]</a> + </span> + <!-- END addArticleButton_block --> + <!-- BEGIN addBookmarkButton_block --> + <span class="button_green"> + <a href="{addBookmarkLink}">[l]Add Bookmark[/l]</a> + </span> + <!-- END addBookmarkButton_block --> + <!-- BEGIN addCategoryButton_block --> + <span class="button_green"> <a href="{addCategoryLink}">{addCategoryLabel}</a> </span> + <!-- END addCategoryButton_block --> </td> - </tr> - <!-- END addCategoryButton_block --> </table> </td> Modified: trunk/templates/header.tpl =================================================================== --- trunk/templates/header.tpl 2008-10-24 00:21:54 UTC (rev 761) +++ trunk/templates/header.tpl 2008-10-26 19:44:17 UTC (rev 762) @@ -48,12 +48,6 @@ <div id="menu"> <a href="{homeHref}">[l]Home[/l]</a> - <!-- BEGIN addArticleLink_block --> - <a href="{addArticleHref}">[l]Add Article[/l]</a> - <!-- END addArticleLink_block --> - <!-- BEGIN addBookmarkLink_block --> - <a href="{addBookmarkHref}">[l]Add Bookmark[/l]</a> - <!-- END addBookmarkLink_block --> <!-- BEGIN manageUsersLink_block --> <a href="{manageUsersHref}">[l]Manage Users[/l]</a> <!-- END manageUsersLink_block --> Modified: trunk/views/EditArticle.php =================================================================== --- trunk/views/EditArticle.php 2008-10-24 00:21:54 UTC (rev 761) +++ trunk/views/EditArticle.php 2008-10-26 19:44:17 UTC (rev 762) @@ -17,6 +17,7 @@ function dispatch() { $questionId = isset($_GET['qId'])? (int)$_GET['qId'] : 0; $articleId = isset($_GET['id'])? (int)$_GET['id'] : 0; + $catId = isset($_GET['catId'])? (int)$_GET['catId'] : 0; $selectedCategory = 0; $this->tpl->set_file('edit_article', 'EditArticle.tpl'); @@ -110,6 +111,8 @@ $this->tpl->set_var('editArticleTitle', ''); $this->tpl->set_var('usage_id', ''); + + $selectedCategory = $catId; } $this->tpl->parse('saveAsDraftButton', 'saveAsDraftButton_block'); Modified: trunk/views/EditBookmark.php =================================================================== --- trunk/views/EditBookmark.php 2008-10-24 00:21:54 UTC (rev 761) +++ trunk/views/EditBookmark.php 2008-10-26 19:44:17 UTC (rev 762) @@ -16,6 +16,7 @@ function dispatch() { $bookmarkId = isset($_GET['id'])? (int)$_GET['id'] : 0; + $catId = isset($_GET['catId'])? (int)$_GET['catId'] : 0; $selectedCategory = 0; $this->tpl->set_file('edit_bookmark', 'EditBookmark.tpl'); @@ -73,6 +74,8 @@ $this->tpl->parse('addBookmarkTitle', 'addBookmarkTitle_block'); $this->tpl->set_var('editBookmarkTitle', ''); $this->tpl->parse('saveAsDraftButton', 'saveAsDraftButton_block'); + + $selectedCategory = $catId; } $categoryGateway = new CategoryGateway; Modified: trunk/views/MainView.php =================================================================== --- trunk/views/MainView.php 2008-10-24 00:21:54 UTC (rev 761) +++ trunk/views/MainView.php 2008-10-26 19:44:17 UTC (rev 762) @@ -97,6 +97,8 @@ $this->tpl->set_block('main', 'hideCategory_block', 'hideCategory'); $this->tpl->set_block('main', 'showHiddenCategories_block', 'showHiddenCategories'); $this->tpl->set_block('main', 'addCategoryButton_block', 'addCategoryButton'); + $this->tpl->set_block('main', 'addArticleButton_block', 'addArticleButton'); + $this->tpl->set_block('main', 'addBookmarkButton_block', 'addBookmarkButton'); $this->tpl->set_block('main', 'requestCat_block', 'requestCat'); $this->tpl->set_block('articles_block', 'status_block', 'status'); $this->tpl->set_block('articles_block', 'question_block', 'question'); @@ -172,6 +174,12 @@ 'showCatAgainLink' => Library::getLink(array( 'action' => 'ShowCategory', 'catId' => $catId)), + 'addArticleLink' => Library::getLink(array( + 'view' => 'EditArticle', + 'catId' => $catId)), + 'addBookmarkLink' => Library::getLink(array( + 'view' => 'EditBookmark', + 'catId' => $catId)), )); if ($catId != 0) { @@ -315,6 +323,14 @@ $this->tpl->set_var('showHiddenCategories', ''); } + if (!$this->user->isAnonymous()) { + $this->tpl->parse('addArticleButton', 'addArticleButton_block'); + $this->tpl->parse('addBookmarkButton', 'addBookmarkButton_block'); + } else { + $this->tpl->set_var('addArticleButton', ''); + $this->tpl->set_var('addBookmarkButton', ''); + } + if (!$this->user->isAdmin()) { $this->tpl->set_var('requestCatLink', Library::getLink(array('view' => 'RequestCategory', 'catId' => $catId))); Modified: trunk/views/View.php =================================================================== --- trunk/views/View.php 2008-10-24 00:21:54 UTC (rev 761) +++ trunk/views/View.php 2008-10-26 19:44:17 UTC (rev 762) @@ -133,22 +133,6 @@ 'addQuestionHref' => Library::getLink(array('view' => 'AddQuestion')), )); - $this->tpl->set_block('header', 'addArticleLink_block', 'addArticleLink'); - if (!$this->user->isAnonymous()) { - $this->tpl->set_var('addArticleHref', Library::getLink(array('view' => 'EditArticle'))); - $this->tpl->parse('addArticleLink', 'addArticleLink_block'); - } else { - $this->tpl->set_var('addArticleLink', ''); - } - - $this->tpl->set_block('header', 'addBookmarkLink_block', 'addBookmarkLink'); - if (!$this->user->isAnonymous()) { - $this->tpl->set_var('addBookmarkHref', Library::getLink(array('view' => 'EditBookmark'))); - $this->tpl->parse('addBookmarkLink', 'addBookmarkLink_block'); - } else { - $this->tpl->set_var('addBookmarkLink', ''); - } - $this->tpl->set_block('header', 'manageUsersLink_block', 'manageUsersLink'); if ($this->user->isAdmin()) { $this->tpl->set_var('manageUsersHref', Library::getLink(array('view' => 'ManageUsers'))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |