aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot.php16
-rw-r--r--include/RedDAV/RedBrowser.php1
-rw-r--r--include/bb2diaspora.php2
-rwxr-xr-xindex.php40
-rw-r--r--mod/page.php22
-rw-r--r--version.inc2
-rw-r--r--view/css/mod_photos.css32
-rw-r--r--view/theme/redbasic/css/style.css18
-rwxr-xr-xview/tpl/photo_view.tpl151
9 files changed, 154 insertions, 130 deletions
diff --git a/boot.php b/boot.php
index 14d0a61a5..abbf48636 100755
--- a/boot.php
+++ b/boot.php
@@ -1880,13 +1880,9 @@ function get_custom_nav(&$a,$navname) {
}
-function construct_page(&$a) {
-
+function load_pdl(&$a) {
require_once('include/comanche.php');
- // in case a page has overloaded a module, see if we already have a layout defined
- // otherwise, if a pdl file exists for this module, use it
-
if(! count($a->layout)) {
$n = 'mod_' . $a->module . '.pdl' ;
$u = comanche_get_channel_id();
@@ -1898,12 +1894,20 @@ function construct_page(&$a) {
comanche_parser($a,$s);
}
- $comanche = ((count($a->layout)) ? true : false);
+}
+
+
+
+function construct_page(&$a) {
+
/**
* Build the page - now that we have all the components
*/
+
+ $comanche = ((count($a->layout)) ? true : false);
+
require_once(theme_include('theme_init.php'));
$installing = false;
diff --git a/include/RedDAV/RedBrowser.php b/include/RedDAV/RedBrowser.php
index 6ec5c978d..21ea76aed 100644
--- a/include/RedDAV/RedBrowser.php
+++ b/include/RedDAV/RedBrowser.php
@@ -259,6 +259,7 @@ class RedBrowser extends DAV\Browser\Plugin {
$html .= $output;
get_app()->page['content'] = $html;
+ load_pdl(get_app());
construct_page(get_app());
}
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 9a87de5b2..665fd4622 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -290,7 +290,7 @@ function bb2diaspora_itemwallwall(&$item) {
// We have to do something similar for wall-to-wall comments. ITEM_WALL|ITEM_ORIGIN indicates that it was posted on this site.
// Regular matrix comments may have one of these bits set, but not both.
- if(($item['mid'] != $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && ($item['item_flags'] & (ITEM_WALL|ITEM_ORIGIN)) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_m']) {
+ if(($item['mid'] != $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (($item['item_flags'] & (ITEM_WALL|ITEM_ORIGIN)) == (ITEM_WALL|ITEM_ORIGIN)) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_m']) {
logger('bb2diaspora_itemwallwall: wall to wall comment',LOGGER_DEBUG);
// post will come across with the owner's identity. Throw a preamble onto the post to indicate the true author.
$item['body'] = "\n\n"
diff --git a/index.php b/index.php
index 6c18cbcb8..3e5207f2b 100755
--- a/index.php
+++ b/index.php
@@ -242,14 +242,6 @@ if(strlen($a->module)) {
}
}
-/**
- * load current theme info
- */
-$theme_info_file = "view/theme/".current_theme()."/php/theme.php";
-if (file_exists($theme_info_file)){
- require_once($theme_info_file);
-}
-
/* initialise content region */
@@ -281,12 +273,44 @@ if($a->module_loaded) {
$a->page['page_title'] = $a->module;
$placeholder = '';
+ /**
+ * No theme has been specified when calling the module_init functions
+ * For this reason, please restrict the use of templates to those which
+ * do not provide any presentation details - as themes will not be able
+ * to over-ride them.
+ */
+
if(function_exists($a->module . '_init')) {
call_hooks($a->module . '_mod_init', $placeholder);
$func = $a->module . '_init';
$func($a);
}
+ /**
+ * Do all theme initialiasion here before calling any additional module functions.
+ * The module_init function may have changed the theme.
+ * Additionally any page with a Comanche template may alter the theme.
+ * So we'll check for those now.
+ */
+
+
+ /**
+ * In case a page has overloaded a module, see if we already have a layout defined
+ * otherwise, if a PDL file exists for this module, use it
+ * The member may have also created a customised PDL that's stored in the config
+ */
+
+ load_pdl($a);
+
+ /**
+ * load current theme info
+ */
+
+ $theme_info_file = "view/theme/".current_theme()."/php/theme.php";
+ if (file_exists($theme_info_file)){
+ require_once($theme_info_file);
+ }
+
if(function_exists(str_replace('-','_',current_theme()) . '_init')) {
$func = str_replace('-','_',current_theme()) . '_init';
$func($a);
diff --git a/mod/page.php b/mod/page.php
index b3f53a227..e8f17ebda 100644
--- a/mod/page.php
+++ b/mod/page.php
@@ -14,13 +14,11 @@ function page_init(&$a) {
if($a->profile['profile_uid'])
head_set_icon($a->profile['thumb']);
-}
-
+ // load the item here in the init function because we need to extract
+ // the page layout and initialise the correct theme.
-function page_content(&$a) {
-
$observer = $a->get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
@@ -97,11 +95,27 @@ function page_content(&$a) {
}
}
+ $a->data['webpage'] = $r;
+
+
+
+}
+
+
+
+
+function page_content(&$a) {
+
+ $r = $a->data['webpage'];
+ if(! $r)
+ return;
// logger('layout: ' . print_r($a->layout,true));
// Use of widgets should be determined by Comanche, but we don't have it on system pages yet, so...
+ // I recommend we now get rid of this bit - it's quite a hack to work around... - mike
+
if ($perms['write_pages']) {
$chan = $a->channel['channel_id'];
$who = $channel_address;
diff --git a/version.inc b/version.inc
index 89d0ecd1c..5a2540b37 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-10-19.833
+2014-10-20.834
diff --git a/view/css/mod_photos.css b/view/css/mod_photos.css
index 90b70b122..571aba57c 100644
--- a/view/css/mod_photos.css
+++ b/view/css/mod_photos.css
@@ -3,6 +3,11 @@
margin-bottom: 25px;
}
+.photo-item-tools-left,
+.photo-item-tools-right {
+ padding: 7px 10px;
+}
+
#photo-photo {
display: table;
margin: 0 auto;
@@ -72,9 +77,6 @@
#photo-edit-link-wrap {
margin-bottom: 15px;
}
-#photo-like-div {
- margin-bottom: 25px;
-}
#photo-edit-caption-end, #photo-edit-tags-end, #photo-edit-albumname-end, #photo-edit-rotate-end {
clear: both;
@@ -84,18 +86,10 @@
margin-bottom: 15px;
}
-#photo-edit-delete-button {
- float: right;
-}
-#photo-edit-edit-wrapper {
- margin-top: 10px;
- margin-bottom: 30px;
-}
-
-#photo-photo-delete-button {
- float: right;
- margin-top: -64px;
+#photo-edit-edit {
+ padding: 7px 10px;
+ margin-bottom: 3px;
}
#photo-edit-end {
@@ -106,16 +100,6 @@
margin-bottom: 15px;
}
-#in-this-photo-text {
- margin-left: 30px;
-}
-
-#in-this-photo {
- margin-left: 60px;
- margin-top: 10px;
- margin-bottom: 20px;
-}
-
#photo-album-edit-submit, #photo-album-edit-drop {
margin-top: 15px;
margin-bottom: 15px;
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index c448c877f..be2eb05ae 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -648,7 +648,7 @@ footer {
list-style: none;
}
-.profile-match-photo img, #photo-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo {
+.profile-match-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo {
border-radius: $radiuspx;
-moz-border-radius: $radiuspx;
box-shadow: $shadowpx $shadowpx $shadowpx 0 #444444;
@@ -704,16 +704,11 @@ footer {
cursor: pointer;
}
-#photo-caption {
- font-size: 110%;
- font-weight: bold;
-}
-
-#in-this-photo-text {
- color: #0080FF;
+#photo-view-wrapper,
+#photo-edit-edit {
+ background-color: $item_colour;
}
-
#side-follow-wrapper {
margin-top: 20px;
}
@@ -2327,8 +2322,9 @@ aside .nav-pills > li > a {
.section-title-wrapper {
padding: 7px 10px;
background-color: $item_colour;
- border-radius: $radiuspx;
- margin-bottom: 10px;
+ border-top-left-radius: $radiuspx;
+ border-top-right-radius: $radiuspx;
+ margin-bottom: 3px;
}
.section-title-wrapper h2 {
diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl
index e7259cec2..ddbce5b0b 100755
--- a/view/tpl/photo_view.tpl
+++ b/view/tpl/photo_view.tpl
@@ -12,9 +12,14 @@
{{/if}}
</div>
<div class="btn-group btn-group-xs pull-right dropdown">
+ {{if $tools}}
+ <a class="btn btn-default" title="{{$tools.profile.1}}" href="{{$tools.profile.0}}"><i class="icon-user"></i></a>
+ {{/if}}
+
{{if $edit}}
<i class="icon-pencil btn btn-default" title="{{$edit.edit}}" onclick="openClose('photo-edit-edit');"></i>
{{/if}}
+
{{if $lock}}
<i class="icon-lock btn btn-default dropdown-toggle" data-toggle="dropdown" title="{{$lock}}" onclick="lockview(event,{{$id}});" ></i><ul id="panel-{{$id}}" class="lockview-panel dropdown-menu"></ul>
{{/if}}
@@ -22,100 +27,96 @@
</div>
<h2>{{if $desc}}{{$desc}}{{elseif $filename}}{{$filename}}{{else}}{{$unknown}}{{/if}}</h2>
+
<div class="clear"></div>
- </div>
-<div id="photo-edit-link-wrap">
-<div class="clear"></div>
+ </div>
+ <div id="photo-edit-edit" style="display: none;">
+ <form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form">
+ <input type="hidden" name="item_id" value="{{$edit.item_id}}">
+ <label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$edit.newalbum}}</label>
+ <input id="photo-edit-albumname" type="text" name="albname" value="{{$edit.album}}" list="dl-albums">
+ {{if $edit.albums}}
+ <datalist id="dl-albums">
+ {{foreach $edit.albums as $al}}
+ {{if $al.text}}
+ <option value="{{$al.text}}">
+ {{/if}}
+ {{/foreach}}
+ </datalist>
+ {{/if}}
+ <div id="photo-edit-albumname-end"></div>
+ <label id="photo-edit-caption-label" for="photo-edit-caption">{{$edit.capt_label}}</label>
+ <input id="photo-edit-caption" type="text" name="desc" value="{{$edit.caption}}">
+ <div id="photo-edit-caption-end"></div>
+ <label id="photo-edit-tags-label" for="photo-edit-newtag" >{{$edit.tag_label}}</label>
+ <input name="newtag" id="photo-edit-newtag" title="{{$edit.help_tags}}" type="text">
+ <div id="photo-edit-tags-end"></div>
+ <div id="photo-edit-rotate-wrapper">
+ <div id="photo-edit-rotate-label">
+ {{$edit.rotatecw}}<br>
+ {{$edit.rotateccw}}
+ </div>
+ <input type="radio" name="rotate" value="1"><br>
+ <input type="radio" name="rotate" value="2">
+ </div>
+ <div id="photo-edit-rotate-end"></div>
+ <div id="settings-default-perms" class="settings-default-perms">
+ <span id="jot-perms-icon" class="{{$edit.lockstate}}"></span>
+ <button class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$edit.permissions}}</button>
+ {{$edit.aclselect}}
+ <div id="settings-default-perms-menu-end"></div>
+ </div>
+ <br/>
+ <div id="settings-default-perms-end"></div>
+ <input id="photo-edit-submit-button" type="submit" name="submit" value="{{$edit.submit}}">
+ <input id="photo-edit-delete-button" type="submit" name="delete" value="{{$edit.delete}}" onclick="return confirmDelete();">
+ <div id="photo-edit-end"></div>
+ </form>
+ </div>
-<div id="photo-edit-edit" style="display: none;">
-<form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form">
-
- <input type="hidden" name="item_id" value="{{$edit.item_id}}">
-
- <label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$edit.newalbum}}</label>
- <input id="photo-edit-albumname" type="text" size="32" name="albname" value="{{$edit.album}}" list="dl-albums">
-{{if $edit.albums}}
- <datalist id="dl-albums">
- {{foreach $edit.albums as $al}}
- {{if $al.text}}
- <option value="{{$al.text}}">
- {{/if}}
- {{/foreach}}
- </datalist>
-{{/if}}
- <div id="photo-edit-albumname-end"></div>
+ <div id="photo-view-wrapper">
- <label id="photo-edit-caption-label" for="photo-edit-caption">{{$edit.capt_label}}</label>
- <input id="photo-edit-caption" type="text" size="84" name="desc" value="{{$edit.caption}}">
- <div id="photo-edit-caption-end"></div>
+ <div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="$.colorbox({href: '{{$photo.href}}'}); return false;"><img style="width: 100%;" src="{{$photo.src}}"></a></div>
+ <div id="photo-photo-end"></div>
- <label id="photo-edit-tags-label" for="photo-edit-newtag" >{{$edit.tag_label}}</label>
- <input name="newtag" id="photo-edit-newtag" size="84" title="{{$edit.help_tags}}" type="text">
+ <div class="photo-item-tools">
+ {{if $tags}}
+ <div class="photo-item-tools-left pull-left">
+ <div id="in-this-photo">
+ <span id="in-this-photo-text">{{$tag_hdr}}</span>
+ {{foreach $tags as $t}}
+ {{$t.0}}{{if $edit}}<span id="tag-remove">&nbsp;<a href="{{$t.1}}"><i class="icon-remove"></i></a>&nbsp;</span>{{/if}}
+ {{/foreach}}
+ </div>
+ </div>
+ {{/if}}
- <div id="photo-edit-tags-end"></div>
- <div id="photo-edit-rotate-wrapper">
- <div id="photo-edit-rotate-label">
- {{$edit.rotatecw}}<br>
- {{$edit.rotateccw}}
+ {{if $likebuttons}}
+ <div class="photo-item-tools-right btn-group pull-right">
+ <i class="icon-thumbs-up-alt item-tool btn btn-default btn-sm" title="{{$likethis}}" onclick="dolike({{$id}},'like'); return false"></i>
+ <i class="icon-thumbs-down-alt item-tool btn btn-default btn-sm" title="{{$nolike}}" onclick="dolike({{$id}},'dislike'); return false"></i>
+ {{$like}}
+ {{$dislike}}
+ </div>
+ <div id="like-rotator-{{$id}}" class="like-rotator pull-right"></div>
+ {{/if}}
+ <div class="clear"></div>
</div>
- <input type="radio" name="rotate" value="1"><br>
- <input type="radio" name="rotate" value="2">
- </div>
- <div id="photo-edit-rotate-end"></div>
-
- <div id="settings-default-perms" class="settings-default-perms">
- <span id="jot-perms-icon" class="{{$edit.lockstate}}"></span>
- <button class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$edit.permissions}}</button>
- {{$edit.aclselect}}
- <div id="settings-default-perms-menu-end"></div>
- </div>
- <br/>
- <div id="settings-default-perms-end"></div>
-
- <input id="photo-edit-submit-button" type="submit" name="submit" value="{{$edit.submit}}">
- <input id="photo-edit-delete-button" type="submit" name="delete" value="{{$edit.delete}}" onclick="return confirmDelete();">
-
- <div id="photo-edit-end"></div>
-</form>
-</div>
-
-{{if $tools}}
-<div>
- <a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
-</div>
-{{/if}}
-
-<div id="photo-view-wrapper">
-<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="$.colorbox({href: '{{$photo.href}}'}); return false;"><img style="width: 100%;" src="{{$photo.src}}"></a></div>
-<div id="photo-photo-end"></div>
-
-{{if $tags}}
-<div id="in-this-photo-text">{{$tag_hdr}}</div>
-{{foreach $tags as $t}}
-<div id="in-this-photo">{{$t.0}}</div>
-{{if $edit}}<div id="tag-remove"><a href="{{$t.1}}">{{$t.2}}</a></div>{{/if}}
-{{/foreach}}
-{{/if}}
-{{if $likebuttons}}
-<div id="photo-like-div">
- {{$likebuttons}}
- {{$like}}
- {{$dislike}}
</div>
-{{/if}}
{{$comments}}
+{{if $commentbox}}
<div class="wall-item-comment-wrapper{{if $comments}} wall-item-comment-wrapper-wc{{/if}}" >
{{$commentbox}}
</div>
+{{/if}}
-</div>
<div class="clear"></div>