aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models/WikiModel.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-02-15 17:06:09 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-02-15 17:06:09 +0000
commit4a27b517fc52dde60e5c1837860e4785317490a6 (patch)
tree73b91c5d212f1bb67eb83fea9694cf8d1a360846 /h-source/Application/Models/WikiModel.php
parentd85570c9946aef61d8d935d9f50169215338d665 (diff)
improved wiki
Diffstat (limited to 'h-source/Application/Models/WikiModel.php')
-rw-r--r--h-source/Application/Models/WikiModel.php38
1 files changed, 37 insertions, 1 deletions
diff --git a/h-source/Application/Models/WikiModel.php b/h-source/Application/Models/WikiModel.php
index 0a00bfb..6cdc632 100644
--- a/h-source/Application/Models/WikiModel.php
+++ b/h-source/Application/Models/WikiModel.php
@@ -37,7 +37,9 @@ class WikiModel extends Model_Map {
'username' => 'regusers',
'id_user' => 'regusers',
'has_confirmed' => 'regusers',
- 'deleted' => 'regusers'
+ 'deleted' => 'regusers',
+ '-deleted' => 'wiki',
+ '-blocked' => 'wiki',
);
$this->printAssError = "no";
@@ -70,6 +72,11 @@ class WikiModel extends Model_Map {
parent::__construct();
}
+ public function pUpdate($id)
+ {
+ return parent::update($id);
+ }
+
public function insert()
{
$this->values['created_by'] = (int)$this->id_user;
@@ -254,6 +261,35 @@ class WikiModel extends Model_Map {
return false;
}
+ public function isDeleted($id)
+ {
+ $clean['id'] = (int)$id;
+ $res = $this->select('wiki.deleted')->where(array('id_wiki'=>$clean['id']))->send();
+ if ( count($res) > 0 )
+ {
+ return $res[0]['wiki']['deleted'];
+ }
+ return 'no';
+ }
+
+ public function isBlocked($id)
+ {
+ $clean['id'] = (int)$id;
+ $res = $this->select('blocked')->where(array('id_wiki'=>$clean['id']))->send();
+ if ( count($res) > 0 )
+ {
+ return strcmp($res[0]['wiki']['blocked'],'no') === 0 ? false : true;
+ }
+ return false;
+ }
+
+ public function toWikiPage($id)
+ {
+ $clean['id'] = (int)$id;
+ $title = $this->getTheModelName($clean['id']);
+ return "http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($title);
+ }
+
public function getDiffArray($oldArray, $newArray)
{
return getDiffArray($this->diffFields, $oldArray, $newArray);