aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/NativeWikiPage.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-01-26 10:46:44 +0100
committerMario Vavti <mario@mariovavti.com>2017-01-26 10:46:44 +0100
commit02e8058c5069506952e4c9979b7dfe02b5dc5480 (patch)
tree50352e4468b4b0eccef1a5889e067ccba60facb3 /Zotlabs/Lib/NativeWikiPage.php
parent93057fae8c7ea264b4fd76878475b594c067e26b (diff)
downloadvolse-hubzilla-02e8058c5069506952e4c9979b7dfe02b5dc5480.tar.gz
volse-hubzilla-02e8058c5069506952e4c9979b7dfe02b5dc5480.tar.bz2
volse-hubzilla-02e8058c5069506952e4c9979b7dfe02b5dc5480.zip
fix renaming of wiki pages
Diffstat (limited to 'Zotlabs/Lib/NativeWikiPage.php')
-rw-r--r--Zotlabs/Lib/NativeWikiPage.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php
index 85a1e8bed..3cc69f120 100644
--- a/Zotlabs/Lib/NativeWikiPage.php
+++ b/Zotlabs/Lib/NativeWikiPage.php
@@ -77,6 +77,7 @@ class NativeWikiPage {
}
static public function rename_page($arr) {
+
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$pageNewName = ((array_key_exists('pageNewName',$arr)) ? $arr['pageNewName'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
@@ -94,7 +95,7 @@ class NativeWikiPage {
intval($channel_id),
dbesc($pageNewName)
);
-
+
if($ic) {
return [ 'success' => false, 'message' => t('Destination name already exists') ];
}
@@ -107,7 +108,7 @@ class NativeWikiPage {
intval($channel_id),
dbesc($pageUrlName)
);
-
+
if($ic) {
foreach($ic as $c) {
set_iconfig($c['item_id'],'nwikipage','pagetitle',$pageNewName);
@@ -213,7 +214,7 @@ class NativeWikiPage {
intval($channel_id),
dbesc($pageUrlName)
);
-
+
if($ic) {
foreach($ic as $c) {
if($ids)
@@ -224,11 +225,13 @@ class NativeWikiPage {
$sql_extra = item_permissions_sql($channel_id,$observer_hash);
if($revision == (-1))
- $sql_extra .= " order by revision desc ";
- elseif($revision)
- $sql_extra .= " and revision = " . intval($revision) . " ";
+ $sql_extra .= " order by revision desc ";
+ elseif($revision)
+ $sql_extra .= " and revision = " . intval($revision) . " ";
$r = null;
+
+
if($ids) {
$r = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s' and uid = %d and id in ( $ids ) $sql_extra limit 1",
dbesc($resource_id),
@@ -487,6 +490,7 @@ class NativeWikiPage {
return array('message' => t('Error reading wiki'), 'success' => false);
}
+
$page = self::load_page($arr);
if($page) {