aboutsummaryrefslogtreecommitdiffstats
path: root/include/page_widgets.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-04-29 18:28:05 -0700
committerfriendica <info@friendica.com>2014-04-29 18:28:05 -0700
commit31fd284b3c99595a11e3a1401409f5ca2a5d5cfd (patch)
tree3087c59fd22dd0655f960c9a370412dc207f78ba /include/page_widgets.php
parent5c8c555461335e4bd836acff66c10ad303af8335 (diff)
downloadvolse-hubzilla-31fd284b3c99595a11e3a1401409f5ca2a5d5cfd.tar.gz
volse-hubzilla-31fd284b3c99595a11e3a1401409f5ca2a5d5cfd.tar.bz2
volse-hubzilla-31fd284b3c99595a11e3a1401409f5ca2a5d5cfd.zip
clean up the webpage list a bit
Diffstat (limited to 'include/page_widgets.php')
-rw-r--r--include/page_widgets.php54
1 files changed, 32 insertions, 22 deletions
diff --git a/include/page_widgets.php b/include/page_widgets.php
index d70281afc..49d1439be 100644
--- a/include/page_widgets.php
+++ b/include/page_widgets.php
@@ -3,37 +3,47 @@
// A basic toolbar for observers with write_pages permissions
function writepages_widget ($who,$which){
return replace_macros(get_markup_template('write_pages.tpl'), array(
- '$new' => t('New Page'),
- '$newurl' => "webpages/$who",
- '$edit' => t('Edit'),
- '$editurl' => "editwebpage/$who/$which"
- ));
+ '$new' => t('New Page'),
+ '$newurl' => "webpages/$who",
+ '$edit' => t('Edit'),
+ '$editurl' => "editwebpage/$who/$which"
+ ));
}
-// Chan is channel_id, $who is channel_address - we'll need to pass observer later too.
-function pagelist_widget ($chan,$who){
- $r = q("select * from item_id where uid = %d and service = 'WEBPAGE' order by sid asc",
- intval($chan)
+// Chan is channel_id, $which is channel_address - we'll need to pass observer later too.
+function pagelist_widget ($owner,$which){
+
+ $r = q("select * from item_id left join item on item_id.iid = item.id where item_id.uid = %d and service = 'WEBPAGE' order by item.created desc",
+ intval($owner)
);
- $pages = null;
-// TODO - only list public pages. Doesn't matter for now, since we don't have ACL anyway.
-
- if($r) {
- $pages = array();
- foreach($r as $rr) {
- $pages[$rr['iid']][] = array('url' => $rr['iid'],'title' => $rr['sid']);
- }
+
+ $pages = null;
+
+ if($r) {
+ $pages = array();
+ foreach($r as $rr) {
+ $pages[$rr['iid']][] = array('url' => $rr['iid'],'pagetitle' => $rr['sid'],'title' => $rr['title'],'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']),'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']));
}
+ }
- return replace_macros(get_markup_template('webpagelist.tpl'), array(
+ //Build the base URL for edit links
+ $url = z_root() . "/editwebpage/" . $which;
+ // 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(
'$baseurl' => $url,
- '$edit' => '',
+ '$edit' => t('Edit'),
'$pages' => $pages,
- '$channel' => $who,
- '$preview' => '',
- '$widget' => 1,
+ '$channel' => $which,
+ '$view' => t('View'),
+ '$preview' => t('Preview'),
+ '$actions_txt' => t('Actions'),
+ '$pagelink_txt' => t('Page Link'),
+ '$title_txt' => t('Title'),
+ '$created_txt' => t('Created'),
+ '$edited_txt' => t('Edited')
+
));
}