diff options
Diffstat (limited to 'h-source')
-rw-r--r-- | h-source/Application/Controllers/GenericController.php | 2 | ||||
-rw-r--r-- | h-source/Application/Controllers/SpecialController.php | 38 | ||||
-rw-r--r-- | h-source/Application/Include/languages.php | 2 | ||||
-rw-r--r-- | h-source/Application/Models/HardwareModel.php | 7 | ||||
-rw-r--r-- | h-source/Application/Views/My/panel.php | 1 | ||||
-rw-r--r-- | h-source/Application/Views/Special/pages_deleted.php | 4 | ||||
-rw-r--r-- | h-source/Application/Views/if_page_deleted.php | 10 | ||||
-rw-r--r-- | h-source/Application/Views/top_left.php | 5 | ||||
-rw-r--r-- | h-source/Config/Route.php | 1 |
9 files changed, 58 insertions, 12 deletions
diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php index 949f3ae..c80f6d0 100644 --- a/h-source/Application/Controllers/GenericController.php +++ b/h-source/Application/Controllers/GenericController.php @@ -501,7 +501,7 @@ class GenericController extends BaseController $this->append($data); - session_start(); + @session_start(); if ( isset($_SESSION['notebook_inserted']) and strcmp($this->controller,'notebooks') === 0 ) { $viewFilesList = 'suggest_dialog,dialog,page,if_page_deleted,moderator_dialog'; diff --git a/h-source/Application/Controllers/SpecialController.php b/h-source/Application/Controllers/SpecialController.php index 1f13b69..6f17c2c 100644 --- a/h-source/Application/Controllers/SpecialController.php +++ b/h-source/Application/Controllers/SpecialController.php @@ -120,15 +120,23 @@ class SpecialController extends BaseController $this->last($lang = 'en','adminactions'); } - public function deleted($lang = 'en') + protected function pagelist($lang = 'en', $type) { - $this->shift(1); - - $this->s['registered']->check('admin'); - + switch($type) + { + case 'deleted': + $whereArray = array('-deleted'=>'yes','approved'=>'yes'); + $data['titleString'] = 'hidden device pages'; + break; + case 'notapproved': + $whereArray = array('approved'=>'no'); + $data['titleString'] = 'Device pages that have to be approved'; + break; + } + $this->helper('Pages','special/'.$this->action.'/'.$this->lang,'page'); - $this->m['HardwareModel']->clear()->select()->where(array('-deleted'=>'yes'))->orderBy('id_hard desc'); + $this->m['HardwareModel']->clear()->select()->where($whereArray)->orderBy('id_hard desc'); $recordNumber = $this->m['HardwareModel']->rowNumber(); $page = $this->viewArgs['page']; @@ -144,4 +152,22 @@ class SpecialController extends BaseController $this->right(); } + public function deleted($lang = 'en') + { + $this->shift(1); + + $this->s['registered']->check('admin'); + + $this->pagelist($lang,'deleted'); + } + + public function notapproved($lang = 'en') + { + $this->shift(1); + + $this->s['registered']->check('admin'); + + $this->pagelist($lang,'notapproved'); + } + }
\ No newline at end of file diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 812be64..2dd8d1c 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -240,6 +240,8 @@ class Lang /*0202*/"List of hidden device pages" => "Lista di pagine nascoste di dispositivi", /*0203*/"approve the device page" => "approva la pagina del dispositivo", /*0204*/"This device page has not been approved yet" => "La pagina del dispositivo non รจ ancora stata approvata", + /*0205*/"Device pages that have to be approved" => "Pagine di dispositivi da approvare", + /*0206*/"The device page has to be approved by an administrator of the website" => "La pagina del dispositivo deve essere approvata da un amministratore del sito" ), 'es' => array ( diff --git a/h-source/Application/Models/HardwareModel.php b/h-source/Application/Models/HardwareModel.php index 11aea59..d19cfbd 100644 --- a/h-source/Application/Models/HardwareModel.php +++ b/h-source/Application/Models/HardwareModel.php @@ -81,6 +81,13 @@ class HardwareModel extends Model_Map { $this->values['deleted'] = 'no'; } } + else if (isset($this->values['deleted'])) + { + if (strcmp($this->values['deleted'],'no') === 0) + { + $this->values['approved'] = 'yes'; + } + } return parent::update($id); } diff --git a/h-source/Application/Views/My/panel.php b/h-source/Application/Views/My/panel.php index 9c6424a..0f50f36 100644 --- a/h-source/Application/Views/My/panel.php +++ b/h-source/Application/Views/My/panel.php @@ -38,6 +38,7 @@ <ul> <li><a href="<?php echo Url::getRoot('special/adminactions/'.$lang);?>"><?php echo gtext("Actions carried out by administrators");?></a></li> <li><a href="<?php echo Url::getRoot('special/deleted/'.$lang);?>"><?php echo gtext("List of hidden device pages");?></a></li> + <li><a href="<?php echo Url::getRoot('special/notapproved/'.$lang);?>"><?php echo gtext("Device pages that have to be approved");?></a></li> </ul> </div> <?php } ?> diff --git a/h-source/Application/Views/Special/pages_deleted.php b/h-source/Application/Views/Special/pages_deleted.php index d960d26..f0e69d5 100644 --- a/h-source/Application/Views/Special/pages_deleted.php +++ b/h-source/Application/Views/Special/pages_deleted.php @@ -23,11 +23,11 @@ <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."/my/home/$lang/$token";?>"><?php echo gtext('panel');?></a> » <?php echo gtext('hidden device pages');?> + <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/my/home/$lang/$token";?>"><?php echo gtext('panel');?></a> » <?php echo gtext($titleString);?> </div> <div class="contrib_explain_box"> - <?php echo gtext('hidden device pages');?> + <?php echo gtext($titleString);?> </div> <div class="notebooks_viewall"> diff --git a/h-source/Application/Views/if_page_deleted.php b/h-source/Application/Views/if_page_deleted.php index 1e2ab2d..e60eb78 100644 --- a/h-source/Application/Views/if_page_deleted.php +++ b/h-source/Application/Views/if_page_deleted.php @@ -20,7 +20,7 @@ // along with h-source. If not, see <http://www.gnu.org/licenses/>. ?> - <?php if ($isDeleted) { ?> + <?php if ($isDeleted and $isApproved) { ?> <div class="notebooks_viewall"> <div class="revision_alert"> @@ -47,5 +47,13 @@ <?php } ?> </div> </div> + + <?php } else if ($isDeleted and !$isApproved) { ?> + + <div class="notebooks_viewall"> + <div class="revision_alert"> + <?php echo gtext('The device page has to be approved by an administrator of the website'); ?> + </div> + </div> <?php } ?>
\ No newline at end of file diff --git a/h-source/Application/Views/top_left.php b/h-source/Application/Views/top_left.php index 148a863..73e8f80 100644 --- a/h-source/Application/Views/top_left.php +++ b/h-source/Application/Views/top_left.php @@ -39,7 +39,7 @@ <?php } else if ($isDeleted and !$isApproved) { ?> <?php echo gtext("This device page has not been approved yet");?> - <a id="<?php echo $id_hard;?>" class="deviceapprove_device_approved block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png"><?php echo gtext('approve the device page'); ?></a> + <a id="<?php echo $id_hard;?>" class="deviceapprove_device_app block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png"><?php echo gtext('approve the device page'); ?></a> <?php } else { ?> @@ -89,10 +89,11 @@ <?php } ?> </div> + <?php if (!$isDeleted) { ?> <div class="talk_numb_ext"> <a href="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_hard/$token".$this->viewStatus;?>">talk messages: <?php echo $talk_number;?></a> </div> - + <?php } ?> <?php } else if (strcmp($this->action,'catalogue') === 0) { ?> diff --git a/h-source/Config/Route.php b/h-source/Config/Route.php index a03e718..5362ae0 100644 --- a/h-source/Config/Route.php +++ b/h-source/Config/Route.php @@ -163,6 +163,7 @@ class Route 'special,modactions', 'special,adminactions', 'special,deleted', + 'special,notapproved', 'wiki,insert', 'wiki,update', 'wiki,page', |