aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Wiki.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-06-25 06:27:14 -0500
committerAndrew Manning <tamanning@zoho.com>2016-06-25 06:27:14 -0500
commit780f83a118146cf67509574ac88024c2cb03cf3a (patch)
treedcedab6ad34eb5a76967eea17a69cf4c5fbac9a5 /Zotlabs/Module/Wiki.php
parentf48b12ff52c4fda85c09c1cc476f7cf4c0cfb649 (diff)
downloadvolse-hubzilla-780f83a118146cf67509574ac88024c2cb03cf3a.tar.gz
volse-hubzilla-780f83a118146cf67509574ac88024c2cb03cf3a.tar.bz2
volse-hubzilla-780f83a118146cf67509574ac88024c2cb03cf3a.zip
Post generation about new wiki is optional, default is NOT to post. Fixed bug in wiki creation. Added embed image dialog and album browser.
Diffstat (limited to 'Zotlabs/Module/Wiki.php')
-rw-r--r--Zotlabs/Module/Wiki.php31
1 files changed, 14 insertions, 17 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index bef831de8..1c3add38f 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -145,7 +145,7 @@ class Wiki extends \Zotlabs\Web\Controller {
'$cancel' => t('Cancel')
)
);
-
+
$o .= replace_macros(get_markup_template('wiki.tpl'),array(
'$wikiheaderName' => $wikiheaderName,
'$wikiheaderPage' => $wikiheaderPage,
@@ -170,7 +170,17 @@ class Wiki extends \Zotlabs\Web\Controller {
'$pageHistory' => $pageHistory['history'],
'$wikiModal' => $wikiModal,
'$wikiModalID' => $wikiModalID,
- '$commit' => 'HEAD'
+ '$commit' => 'HEAD',
+ '$embedPhotos' => t('Embed image from photo albums'),
+ '$embedPhotosModalTitle' => t('Embed an image from your albums'),
+ '$embedPhotosModalCancel' => t('Cancel'),
+ '$embedPhotosModalOK' => t('OK'),
+ '$modalchooseimages' => t('Choose images to embed'),
+ '$modalchoosealbum' => t('Choose an album'),
+ '$modaldiffalbum' => t('Choose a different album...'),
+ '$modalerrorlist' => t('Error getting album list'),
+ '$modalerrorlink' => t('Error getting photo link'),
+ '$modalerroralbum' => t('Error getting album'),
));
head_add_js('library/ace/ace.js'); // Ace Code Editor
return $o;
@@ -202,6 +212,7 @@ class Wiki extends \Zotlabs\Web\Controller {
}
$wiki = array();
// Generate new wiki info from input name
+ $wiki['postVisible'] = ((intval($_POST['postVisible']) === 0) ? 0 : 1);
$wiki['rawName'] = $_POST['wikiName'];
$wiki['htmlName'] = escape_tags($_POST['wikiName']);
$wiki['urlName'] = urlencode($_POST['wikiName']);
@@ -235,20 +246,7 @@ class Wiki extends \Zotlabs\Web\Controller {
if (local_channel() !== intval($channel['channel_id'])) {
logger('Wiki delete permission denied.' . EOL);
json_return_and_die(array('message' => 'Wiki delete permission denied.', 'success' => false));
- } else {
- /*
- $channel = get_channel_by_nick($nick);
- $observer_hash = get_observer_hash();
- // Figure out who the page owner is.
- $perms = get_all_perms(intval($channel['channel_id']), $observer_hash);
- // TODO: Create a new permission setting for wiki analogous to webpages. Until
- // then, use webpage permissions
- if (!$perms['write_pages']) {
- logger('Wiki delete permission denied.' . EOL);
- json_return_and_die(array('success' => false));
- }
- */
- }
+ }
$resource_id = $_POST['resource_id'];
$deleted = wiki_delete_wiki($resource_id);
if ($deleted['success']) {
@@ -482,7 +480,6 @@ class Wiki extends \Zotlabs\Web\Controller {
}
}
$renamed = wiki_rename_page(array('resource_id' => $resource_id, 'pageUrlName' => $pageUrlName, 'pageNewName' => $pageNewName));
- logger('$renamed: ' . json_encode($renamed));
if($renamed['success']) {
$ob = \App::get_observer();
$commit = wiki_git_commit(array(