diff options
Diffstat (limited to 'h-source/Application/Views')
-rw-r--r-- | h-source/Application/Views/Last/modifications.php | 2 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/form.php | 10 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/history.php | 2 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/modifications.php | 45 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/page.php | 36 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/pages.php | 45 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/talk.php | 163 | ||||
-rw-r--r-- | h-source/Application/Views/header.php | 1 | ||||
-rw-r--r-- | h-source/Application/Views/right.php | 9 |
9 files changed, 225 insertions, 88 deletions
diff --git a/h-source/Application/Views/Last/modifications.php b/h-source/Application/Views/Last/modifications.php index 8683615..1caca34 100644 --- a/h-source/Application/Views/Last/modifications.php +++ b/h-source/Application/Views/Last/modifications.php @@ -33,7 +33,7 @@ <div class="notebooks_viewall"> <ul class="page_history"> <?php foreach ($table as $row) { ?> - <li class="page_history_item"><?php echo gtext('the model');?> <a href="<?php echo Go::toHardwarePage($row['history']['id']);?>"><?php echo $hw->getTheModelName($row['history']['id']);?></a> <?php echo gtext('has been '.$translations[$row['history']['action']].' by');?> <?php echo getLinkToUser($u->getUser($row['history']['created_by']))?> <?php echo gtext('at');?> <?php echo smartDate($row['history']['creation_date']);?></li> + <li class="page_history_item"><?php echo gtext('the model');?> <a href="<?php echo Go::toHardwarePage($row['history']['id']);?>"><?php echo $hw->getTheModelName($row['history']['id']);?></a> <?php echo gtext('has been '.$translations[$row['history']['action']].' by');?> <?php echo $u->getLinkToUserFromId($row['history']['created_by'])?> <?php echo gtext('at');?> <?php echo smartDate($row['history']['creation_date']);?></li> <?php } ?> </ul> </div> diff --git a/h-source/Application/Views/Wiki/form.php b/h-source/Application/Views/Wiki/form.php index 0a448dd..b3f7578 100644 --- a/h-source/Application/Views/Wiki/form.php +++ b/h-source/Application/Views/Wiki/form.php @@ -35,7 +35,7 @@ <?php if ( strcmp($this->action,'insert') === 0 ) { ?> <div class="position_tree_box"> - <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang";?>">Wiki</a> » <?php echo gtext('Insert'); ?> + <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang/Main-Page";?>">Wiki</a> » <?php echo gtext('Insert'); ?> </div> <div class="notebook_view_title"> @@ -43,13 +43,13 @@ </div> <div class="notebook_insert_link"> - <a title="Back to the wiki main page" href="<?php echo $this->baseUrl."/".$this->controller."/page/$lang/";?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> + <a title="Back to the wiki main page" href="<?php echo $this->baseUrl."/".$this->controller."/page/$lang/Main-Page";?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> </div> <?php } else if ( strcmp($this->action,'update') === 0 ) { ?> <div class="position_tree_box"> - <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang";?>">Wiki</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang/".encodeUrl($tree_name);?>"><?php echo $tree_name;?></a> » <?php echo gtext('Update'); ?> + <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang/Main-Page";?>">Wiki</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang/".encodeUrl($tree_name);?>"><?php echo $tree_name;?></a> » <?php echo gtext('Update'); ?> </div> <div class="notebook_view_title"> @@ -76,12 +76,12 @@ <div class="edit_form"> <div class="form_entry"> - <div class="entry_label"><?php echo gtext("title");?>:</div> + <div class="entry_label"><?php echo gtext("the title");?>:</div> <?php echo Html_Form::input('title',$values['title'],'input_entry');?> </div> <div class="form_entry"> - <div class="entry_label"><?php echo gtext("text of the wiki page");?>:<br /><a href="<?php echo $this->baseUrl."/help/index/$lang#wiki-syntax";?>"><?php echo gtext("discover all the wiki tags");?></a></div> + <div class="entry_label"><?php echo gtext("the text of the wiki page");?>:<br /><a href="<?php echo $this->baseUrl."/help/index/$lang#wiki-syntax";?>"><?php echo gtext("discover all the wiki tags");?></a></div> <?php echo Html_Form::textarea('page',$values['page'],'textarea_entry','bb_code');?> </div> diff --git a/h-source/Application/Views/Wiki/history.php b/h-source/Application/Views/Wiki/history.php index 5e5c041..ec394f4 100644 --- a/h-source/Application/Views/Wiki/history.php +++ b/h-source/Application/Views/Wiki/history.php @@ -53,7 +53,7 @@ (<a href="<?php echo $this->baseUrl."/".$this->controller."/differences/$lang/$id/".$rev['wiki_revisions']['id_rev'].$this->viewStatus;?>">diff</a>) <?php } ?> - <?php if ($islogged === 'yes') { ?> + <?php if ($islogged === 'yes' and !$isBlocked) { ?> (<a href="<?php echo $this->baseUrl.'/'.$this->controller.'/climb/'.$lang.'/'.$rev['wiki_revisions']['id_rev'].$this->viewStatus;?>"><?php echo gtext('Make current'); ?></a>) <?php } ?> diff --git a/h-source/Application/Views/Wiki/modifications.php b/h-source/Application/Views/Wiki/modifications.php new file mode 100644 index 0000000..71e50c9 --- /dev/null +++ b/h-source/Application/Views/Wiki/modifications.php @@ -0,0 +1,45 @@ +<?php if (!defined('EG')) die('Direct access not allowed!'); ?> + +<?php +// h-source, a web software to build a community of people that want to share their hardware information. +// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt) +// +// This file is part of h-source +// +// h-source is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// h-source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with h-source. If not, see <http://www.gnu.org/licenses/>. +?> + + <div id="left"> + + <div class="position_tree_box"> + <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang/Main-Page";?>">Wiki</a> » <?php echo gtext('Wiki modifications');?> + </div> + + <div class="contrib_explain_box"> + <?php echo gtext('List of the wiki modifications carried out by users');?> + </div> + + <div class="notebooks_viewall"> + <ul class="page_history"> + <?php foreach ($table as $row) { ?> + <li class="page_history_item"><?php echo gtext('the text of the wiki page');?> <a href="<?php echo $wiki->toWikiPage($row['history']['id']);?>"><?php echo $wiki->getTheModelName($row['history']['id']);?></a> <?php echo gtext('has been '.$translations[$row['history']['action']].' by');?> <?php echo $u->getLinkToUserFromId($row['history']['created_by'])?> <?php echo gtext('at');?> <?php echo smartDate($row['history']['creation_date']);?></li> + <?php } ?> + </ul> + </div> + + <div class="history_page_list"> + <?php echo gtext("page list");?>: <?php echo $pageList;?> + </div> + + </div> diff --git a/h-source/Application/Views/Wiki/page.php b/h-source/Application/Views/Wiki/page.php index c690771..d386704 100644 --- a/h-source/Application/Views/Wiki/page.php +++ b/h-source/Application/Views/Wiki/page.php @@ -29,8 +29,35 @@ <div class="position_tree_box"> <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang/Main-Page";?>">Wiki</a> » <?php echo $tree_name;?> </div> - + + <?php if ($isadmin) { ?> + <div class="moderator_box"> + <?php if ($isBlocked) { ?> + <?php echo gtext('This wiki page has been blocked'); ?> + + <a id="<?php echo $id_wiki;?>" class="pageunblock_page block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/unlock.png"><?php echo gtext('unblock the wiki page'); ?></a> + + <?php } else { ?> + + <a id="<?php echo $id_wiki;?>" class="pageblock_page block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/lock.png"><?php echo gtext('block the wiki page'); ?></a> + + <?php } ?> + + <!--view details--> + <div class="show_hidden_box_ext"> + <div class="md_type">page</div> + <a id="<?php echo $id_wiki;?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> + <div class="moderation_details_box"></div> + </div> + + </div> + <?php } ?> + <div class="notebook_insert_link"> + <div class="view_page_back_button"> + <a title="Insert a new wiki page" href="<?php echo $this->baseUrl."/".$this->controller."/insert/$lang";?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/new-60.png"></a> + </div> + <div class="view_page_history_button"> <a title="talk page" href="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_wiki";?>"><img class="top_left_note_image" src="<?php echo $this->baseUrl;?>/Public/Img/talk-60.png"></a> </div> @@ -39,7 +66,7 @@ <a title="history page" href="<?php echo $this->baseUrl."/".$this->controller."/history/$lang/$id_wiki";?>"><img class="top_left_note_image" src="<?php echo $this->baseUrl;?>/Public/Img/history-60.png"></a> </div> - <?php if (strcmp($isDeleted,'no') === 0) { ?> + <?php if (strcmp($isDeleted,'no') === 0 and !$isBlocked) { ?> <div class="view_page_update_button"> <form action="<?php echo $this->baseUrl."/".$this->controller."/update/$lang";?>" method="POST"> <input title="edit page" class="update_submit_class" type="image" src="<?php echo $this->baseUrl;?>/Public/Img/edit-60.png" value="xedit"> @@ -79,7 +106,7 @@ <?php } ?> - <?php if ( strcmp($isDeleted,'no') === 0 or $ismoderator) { ?> + <?php if ( strcmp($isDeleted,'no') === 0) { ?> <!--if revision--> <?php if (strcmp($this->action,'revision') === 0) { ?> @@ -91,6 +118,9 @@ <?php foreach ($table as $page) { ?> <div class="wiki_page_title"> <?php echo $page[$tableName]['title']?> + <?php if ($isBlocked) { ?> + <span class="blocked_notice"><?php echo gtext('This wiki page has been blocked'); ?></span> + <?php } ?> </div> <div class="wiki_page_content"> <?php echo decodeWikiText($page[$tableName]['page'])?> diff --git a/h-source/Application/Views/Wiki/pages.php b/h-source/Application/Views/Wiki/pages.php new file mode 100644 index 0000000..f944f36 --- /dev/null +++ b/h-source/Application/Views/Wiki/pages.php @@ -0,0 +1,45 @@ +<?php if (!defined('EG')) die('Direct access not allowed!'); ?> + +<?php +// h-source, a web software to build a community of people that want to share their hardware information. +// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt) +// +// This file is part of h-source +// +// h-source is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// h-source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with h-source. If not, see <http://www.gnu.org/licenses/>. +?> + + <div id="left"> + + <div class="position_tree_box"> + <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang/Main-Page";?>">Wiki</a> » <?php echo gtext('list of pages');?> + </div> + + <div class="contrib_explain_box"> + <?php echo gtext('List of wiki pages');?> + </div> + + <div class="notebooks_viewall"> + <ul class="page_history"> + <?php foreach ($table as $row) { ?> + <li class="page_history_item"><a href="<?php echo $wiki->toWikiPage($row['wiki']['id_wiki']);?>"><?php echo $row['wiki']['title'];?></a></li> + <?php } ?> + </ul> + </div> + + <div class="history_page_list"> + <?php echo gtext("page list");?>: <?php echo $pageList;?> + </div> + + </div> diff --git a/h-source/Application/Views/Wiki/talk.php b/h-source/Application/Views/Wiki/talk.php index 9835f04..724b273 100644 --- a/h-source/Application/Views/Wiki/talk.php +++ b/h-source/Application/Views/Wiki/talk.php @@ -43,120 +43,127 @@ <div class="notebook_insert_link"> <a title="Back to the page <?php echo $tree_name;?>" href="<?php echo $this->baseUrl."/".$this->controller."/page/$lang/".encodeUrl($tree_name);?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> </div> + + <?php if (!$isBlocked) { ?> - <div class="wiki_external_box"> + <div class="wiki_external_box"> - <?php foreach ($table as $message) { ?> + <?php foreach ($table as $message) { ?> - <?php if (strcmp($message['wiki_talk']['deleted'],'no') === 0) { ?> + <?php if (strcmp($message['wiki_talk']['deleted'],'no') === 0) { ?> - <a name="wiki-talk-<?php echo $message['wiki_talk']['id_talk'];?>"></a> - <div class="talk_message_item"> + <a name="wiki-talk-<?php echo $message['wiki_talk']['id_talk'];?>"></a> + <div class="talk_message_item"> - <div class="talk_message_item_title_date"> - <?php if ($ismoderator) { ?> - <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hide_wiki_talk hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_cancel.png">hide</a> - <?php } ?> - - <div class="talk_message_item_title"> - <?php echo $message['wiki_talk']['title'];?> + <div class="talk_message_item_title_date"> + <?php if ($ismoderator) { ?> + <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hide_wiki_talk hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_cancel.png">hide</a> + <?php } ?> + + <div class="talk_message_item_title"> + <?php echo $message['wiki_talk']['title'];?> + </div> + + <div class="talk_message_item_date"> + by <?php echo getLinkToUser($u->getUser($message['wiki_talk']['created_by']));?>, <?php echo smartDate($message['wiki_talk']['creation_date']);?> + </div> </div> - <div class="talk_message_item_date"> - by <?php echo getLinkToUser($u->getUser($message['wiki_talk']['created_by']));?>, <?php echo smartDate($message['wiki_talk']['creation_date']);?> + <div class="talk_message_item_content"> + <?php echo decodeWikiText($message['wiki_talk']['message']);?> </div> - </div> - <div class="talk_message_item_content"> - <?php echo decodeWikiText($message['wiki_talk']['message']);?> - </div> + <?php if ($ismoderator) { ?> + <!--view details--> + <div class="show_hidden_box_ext"> + <div class="md_type">wiki_talk</div> + <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> + <div class="moderation_details_box"></div> + </div> + <?php } ?> - <?php if ($ismoderator) { ?> - <!--view details--> - <div class="show_hidden_box_ext"> - <div class="md_type">wiki_talk</div> - <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> - <div class="moderation_details_box"></div> </div> - <?php } ?> - - </div> - - <?php } else { ?> - - <?php if ($ismoderator) { ?> - <a name="wiki-talk-<?php echo $message['wiki_talk']['id_talk'];?>"></a> - <div class="talk_message_item_hidden"> - this message has been deleted - - <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="show_wiki_talk hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png">make visible</a> - <!--view details--> - <div class="show_hidden_box_ext"> - <div class="md_type">wiki_talk</div> + <?php } else { ?> - <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> - - <div class="details_of_hidden_message"> - <div class="details_of_hidden_message_inner"> - <div class="talk_message_item_date"> - submitted by <?php echo getLinkToUser($u->getUser($message['wiki_talk']['created_by']));?>, <?php echo smartDate($message['wiki_talk']['creation_date']);?> - </div> - <div class="message_view_description_hidden"> - <?php echo decodeWikiText($message['wiki_talk']['message']);?> + <?php if ($ismoderator) { ?> + <a name="wiki-talk-<?php echo $message['wiki_talk']['id_talk'];?>"></a> + <div class="talk_message_item_hidden"> + this message has been deleted + + <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="show_wiki_talk hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png">make visible</a> + + <!--view details--> + <div class="show_hidden_box_ext"> + <div class="md_type">wiki_talk</div> + + <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> + + <div class="details_of_hidden_message"> + <div class="details_of_hidden_message_inner"> + <div class="talk_message_item_date"> + submitted by <?php echo getLinkToUser($u->getUser($message['wiki_talk']['created_by']));?>, <?php echo smartDate($message['wiki_talk']['creation_date']);?> + </div> + <div class="message_view_description_hidden"> + <?php echo decodeWikiText($message['wiki_talk']['message']);?> + </div> </div> + <div class="moderation_details_box"></div> </div> - <div class="moderation_details_box"></div> </div> - </div> - </div> + </div> + <?php } ?> + <?php } ?> <?php } ?> + </div> - <?php } ?> - </div> + <?php if ($islogged === 'yes') { ?> - <?php if ($islogged === 'yes') { ?> + <div class="talk_form_external_box"> + <div class="talk_login_notice"> + <a name="form">Add a message</a> + </div> - <div class="talk_form_external_box"> - <div class="talk_login_notice"> - <a name="form">Add a message</a> - </div> + <?php echo $notice;?> - <?php echo $notice;?> + <div class="notebooks_insert_form"> + <form action="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_wiki";?>#form" method="POST"> - <div class="notebooks_insert_form"> - <form action="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_wiki";?>#form" method="POST"> + <div class="edit_form"> - <div class="edit_form"> + <div class="form_entry"> + <div class="entry_label">Title:</div> + <?php echo Html_Form::input('title',$values['title'],'talk_input_entry');?> + </div> - <div class="form_entry"> - <div class="entry_label">Title:</div> - <?php echo Html_Form::input('title',$values['title'],'talk_input_entry');?> - </div> + <div class="form_entry"> + <div class="entry_label">Message:</div> + <?php echo Html_Form::textarea('message',$values['message'],'talk_textarea_entry','bb_code');?> + </div> + + <input type="submit" name="insertAction" value="Save"> - <div class="form_entry"> - <div class="entry_label">Message:</div> - <?php echo Html_Form::textarea('message',$values['message'],'talk_textarea_entry','bb_code');?> </div> - <input type="submit" name="insertAction" value="Save"> + </form> + </div> + </div> - </div> + <?php } else { ?> - </form> + <div class="talk_login_notice"> + <a name="form"><?php echo gtext("You have to");?> <a href="<?php echo $this->baseUrl."/users/login/$lang?redirect=".$currPos.$queryString;?>">login</a> <?php echo gtext("in order to add a message");?></a> </div> - </div> - <?php } else { ?> + <?php } ?> - <div class="talk_login_notice"> - <a name="form"><?php echo gtext("You have to");?> <a href="<?php echo $this->baseUrl."/users/login/$lang?redirect=".$currPos.$queryString;?>">login</a> <?php echo gtext("in order to add a message");?></a> + <?php } else { ?> + <div class="wiki_external_box"> + <?php echo gtext('This wiki page has been blocked'); ?> </div> - <?php } ?> - </div>
\ No newline at end of file diff --git a/h-source/Application/Views/header.php b/h-source/Application/Views/header.php index 625ebae..e86006b 100644 --- a/h-source/Application/Views/header.php +++ b/h-source/Application/Views/header.php @@ -23,6 +23,7 @@ <?php $u = new UsersModel(); $hw = new HardwareModel(); +$wiki = new WikiModel(); $translations = array('insert'=>'inserted','update'=>'updated'); $currPos = $querySanitized ? $this->controller."/".$this->action : 'home/index'; ?> diff --git a/h-source/Application/Views/right.php b/h-source/Application/Views/right.php index 3bde69e..89f3d85 100644 --- a/h-source/Application/Views/right.php +++ b/h-source/Application/Views/right.php @@ -90,6 +90,15 @@ <a href="<?php echo $this->baseUrl."/download/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/download.png"></a> </div> + <?php if ( strcmp($this->controller,'wiki') === 0 ) { ?> + <div class="wiki_control_box"> + <ul> + <li><a href="<?php echo $this->baseUrl."/wiki/pages/$lang";?>"><?php echo gtext('list of pages'); ?></a></li> + <li><a href="<?php echo $this->baseUrl."/wiki/modifications/$lang";?>"><?php echo gtext('last modifications'); ?></a></li> + </ul> + </div> + <?php } ?> + <?php if ( strcmp($this->controller,'wiki') !== 0 ) { ?> <div class="last_modifications"> <div class="last_modifications_title"> |