aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-03 19:55:26 -0700
committerfriendica <info@friendica.com>2013-09-03 19:55:26 -0700
commitab1c9dc9c9ecc1f382b6c7512b014c11f08b6e5e (patch)
treed6b1b30ab6191156ff0e5150332612a2cf788dbe
parent50d4206e9fa0713655d4737ebdeb404afac4984e (diff)
downloadvolse-hubzilla-ab1c9dc9c9ecc1f382b6c7512b014c11f08b6e5e.tar.gz
volse-hubzilla-ab1c9dc9c9ecc1f382b6c7512b014c11f08b6e5e.tar.bz2
volse-hubzilla-ab1c9dc9c9ecc1f382b6c7512b014c11f08b6e5e.zip
add design tool menu to appropriate pages
-rwxr-xr-xinclude/text.php18
-rw-r--r--mod/blocks.php19
-rw-r--r--mod/editwebpage.php2
-rw-r--r--mod/layouts.php16
-rw-r--r--mod/menu.php3
-rw-r--r--mod/mitem.php2
-rw-r--r--mod/webpages.php5
7 files changed, 63 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php
index 004efc08d..ac82e4429 100755
--- a/include/text.php
+++ b/include/text.php
@@ -1826,4 +1826,20 @@ function json_decode_plus($s) {
$x = json_decode(str_replace(array('\\"','\\\\'),array('"','\\'),$s),true);
return $x;
-} \ No newline at end of file
+}
+
+
+function design_tools() {
+// FIXME - this should be a template
+
+ $o = '<div class="widget design-tools">';
+ $o .= '<h3>' . t('Design') . '</h3>';
+ $o .= '<a href="blocks">' . t('Blocks') . '</a>' . EOL;
+ $o .= '<a href="menu">' . t('Menus') . '</a>' . EOL;
+ $o .= '<a href="layout">' . t('Layouts') . '</a>' . EOL;
+ $o .= '<a href="webpages">' . t('Pages') . '</a>' . EOL;
+ $o .= '</div>';
+ return $o;
+
+}
+
diff --git a/mod/blocks.php b/mod/blocks.php
index 29117eae8..170d37256 100644
--- a/mod/blocks.php
+++ b/mod/blocks.php
@@ -2,6 +2,8 @@
function blocks_content(&$a) {
+
+
if(argc() > 1)
$which = argv(1);
else {
@@ -21,6 +23,16 @@ function blocks_content(&$a) {
$owner = intval($r[0]['channel_id']);
}
+ // Block design features from visitors
+
+ if((! local_user()) || (local_user() != $owner)) {
+ notice( t('Permission denied.') . EOL);
+ return;
+ }
+
+
+
+
// Get the observer, check their permissions
$observer = $a->get_observer();
@@ -33,6 +45,12 @@ function blocks_content(&$a) {
return;
}
+ if(local_user() && local_user() == $owner) {
+ $a->set_widget('design',design_tools());
+ }
+
+
+
// Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages
// Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels.
require_once ('include/conversation.php');
@@ -43,6 +61,7 @@ require_once ('include/conversation.php');
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'bang' => (($group || $cid) ? '!' : ''),
'visitor' => 'block',
+ 'mimetype' => 'choose',
'profile_uid' => intval($owner),
);
diff --git a/mod/editwebpage.php b/mod/editwebpage.php
index d49a006c9..6ce5a9493 100644
--- a/mod/editwebpage.php
+++ b/mod/editwebpage.php
@@ -78,7 +78,7 @@ function editwebpage_content(&$a) {
if($layout)
$layoutselect = '<input type="hidden" name="layout_mid" value="' . $layout . '" />';
else
- $layoutselect = layout_select($x['profile_uid']);
+ $layoutselect = layout_select($itm[0]['uid']);
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
diff --git a/mod/layouts.php b/mod/layouts.php
index 78d142c47..cd6e61f88 100644
--- a/mod/layouts.php
+++ b/mod/layouts.php
@@ -21,6 +21,16 @@ function layouts_content(&$a) {
$owner = intval($r[0]['channel_id']);
}
+ // Block design features from visitors
+
+ if((! local_user()) || (local_user() != $owner)) {
+ notice( t('Permission denied.') . EOL);
+ return;
+ }
+
+
+
+
// Get the observer, check their permissions
$observer = $a->get_observer();
@@ -33,6 +43,12 @@ function layouts_content(&$a) {
return;
}
+ if(local_user() && local_user() == $owner) {
+ $a->set_widget('design',design_tools());
+ }
+
+
+
// Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages
// Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels.
require_once ('include/conversation.php');
diff --git a/mod/menu.php b/mod/menu.php
index c3302544e..1ec3c7996 100644
--- a/mod/menu.php
+++ b/mod/menu.php
@@ -42,6 +42,9 @@ function menu_content(&$a) {
}
+ $a->set_widget('design',design_tools());
+
+
if(argc() == 1) {
// list menus
$x = menu_list(local_user());
diff --git a/mod/mitem.php b/mod/mitem.php
index 2b890d5a1..ee690907e 100644
--- a/mod/mitem.php
+++ b/mod/mitem.php
@@ -98,6 +98,8 @@ function mitem_content(&$a) {
return '';
}
+ $a->set_widget('design',design_tools());
+
$m = menu_fetch($a->data['menu']['menu_name'],local_user(), get_observer_hash());
$a->set_widget('menu_preview',menu_render($m));
diff --git a/mod/webpages.php b/mod/webpages.php
index d87bd4a86..04c2e07c5 100644
--- a/mod/webpages.php
+++ b/mod/webpages.php
@@ -41,6 +41,11 @@ function webpages_content(&$a) {
return;
}
+ if(local_user() && local_user() == $owner) {
+ $a->set_widget('design',design_tools());
+ }
+
+
$mimetype = get_config('system','page_mimetype');
if(! $mimetype)
$mimetype = 'choose';