This commit is contained in:
friendica 2013-07-14 01:14:03 -07:00
commit 5b73755af7
20 changed files with 87 additions and 38 deletions

View File

@ -2058,13 +2058,14 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
'title' => t('Events and Calendar'),
'id' => 'events-tab',
);
if(feature_enabled(local_user(),'webpages')){
$tabs[] = array(
'label' => t('Wepages'),
'label' => t('Webpages'),
'url' => $a->get_baseurl() . '/webpages/' . $nickname,
'sel' => ((argv(0) == 'webpages') ? 'active' : ''),
'title' => t('Manage Webpages'),
'id' => 'webpages-tab',
);
);}
}
else {
// FIXME

View File

@ -10,6 +10,7 @@ Red Documentation and Resources
* [Connecting to Channels](help/Connecting-to-Channels)
* [Permissions](help/Permissions)
* [Tags and Mentions](help/Tags-and-Mentions)
* [Web Pages](help/Webpages)
* [Remove Account](help/Remove-Account)
**Technical Documentation**

14
doc/Webpages.md Normal file
View File

@ -0,0 +1,14 @@
Creating Webpages
=================
Red enables users to create static webpages. To activate this feature, enable the web pages feature in your Additional Features section.
Once enabled, a new tab will appear on your channel page labelled "Webpages". Clicking this link will take you to the webpage editor. Here you can create a post using either BBCode or the rich text editor.
Pages will be accessible at mydomain/page/username/pagelinktitle
The "page link title" box allows a user to specify the "pagelinktitle" of this URL. If no page link title is set, we will set one for you automatically, using the message ID of the item.
Beneath the page creation box, a list of existing pages will appear with an "edit" link. Clicking this will take you to an editor, similar to that of the post editor, where you can make changes to your webpages.
If you are the admin of a site, you can speficy a channel whose webpages we will use at key points around the site. Presently, the only place this is implemented is the home page. If you specify the channel "admin" and then the channel called "admin" creates a webpage called "home", we will display it's content on your websites home page. We expect this functionality to be extended to other areas in future.

View File

@ -2,6 +2,23 @@
require_once('include/items.php');
require_once('include/conversation.php');
function page_init(&$a) {
// We need this to make sure the channel theme is always loaded.
$which = argv(1);
$profile = 0;
$channel = $a->get_channel();
if((local_user()) && (argc() > 2) && (argv(2) === 'view')) {
$which = $channel['channel_address'];
$profile = argv(1);
}
profile_load($a,$which,$profile);
}
function page_content(&$a) {
@ -41,4 +58,4 @@ function page_content(&$a) {
$o .= prepare_page($r[0]);
return $o;
}
}

View File

@ -34,7 +34,7 @@ require_once ('include/conversation.php');
$x = array(
'webpage' => 1,
'is_owner' => true,
'nickname' => $channel['channel_address'],
'nickname' => $a->profile['channel_address'],
'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',
@ -65,7 +65,11 @@ $r = q("select * from item_id where uid = %d and service = 'WEBPAGE'",
// This isn't pretty, but it works. Until I figure out what to do with the UI, it's Good Enough(TM).
return $o . replace_macros(get_markup_template("webpagelist.tpl"), array(
'$pages' => $pages
'$editlink' => t('Edit'),
'$pages' => $pages,
'$channel' => $a->profile['channel_address'],
'$view' => t('View'),
));

View File

@ -167,4 +167,16 @@ ul.menu-popup .menu-sep {
.my-comment-photo {
border-radius: 5px;
box-shadow: 4px 4px 3px #000;
}
}
div#pagelist-content-wrapper {
width: 80%;
background: #111;
margin-left: auto;
margin-right: auto;
}
div.page-list-item {
margin: 20px;
}

View File

@ -3893,4 +3893,16 @@ width: 200px;
float: left;
margin-right: 25px;
}
*/
*/
div#pagelist-content-wrapper {
width: 80%;
background: #fff;
margin-left: auto;
margin-right: auto;
}
div.page-list-item {
margin: 20px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,14 +1,4 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
{{include file="prettyphoto.tpl"}}
<div class="photo-album-image-wrapper" id="photo-album-image-wrapper-{{$id}}">
<a href="{{$photolink}}" class="photo-album-photo-link" id="photo-album-photo-link-{{$id}}" title="{{$phototitle}}" rel="{{$rel}}">
<img src="{{$imgsrc}}" alt="{{$imgalt}}" title="{{$phototitle}}" class="photo-album-photo lframe resize{{$twist}}" id="photo-album-photo-{{$id}}" />

View File

@ -1,13 +1,4 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
{{include file="prettyphoto.tpl"}}
<div id="live-display"></div>
<h3><a href="{{$album.0}}">{{$album.1}}</a></h3>

6
view/tpl/prettyphoto.tpl Normal file
View File

@ -0,0 +1,6 @@
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>

View File

@ -1,12 +1,13 @@
{{if $pages}}
<div id="pagelist-content-wrapper">
{{foreach $pages as $key => $items}}
<ul class="page-list">
{{foreach $items as $item}}
<li><a href="editwebpage/{{$item.url}}">Edit</a> {{$item.title}}</li>
{{/foreach}}
</ul>
<div class="clear"></div>
</div>
{{/foreach}}
<div id="pagelist-content-wrapper">
{{foreach $pages as $key => $items}}
{{foreach $items as $item}}
<div class="page-list-item"><a href="editwebpage/{{$item.url}}">{{$editlink}}</a> | <a href="page/{{$channel}}/{{$item.title}}">{{$view}}</a> {{$item.title}}</div>
{{/foreach}}
{{/foreach}}
</div>
<div class="clear"></div>
{{/if}}