aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-03 18:48:40 -0700
committerfriendica <info@friendica.com>2013-09-03 18:48:40 -0700
commit50d4206e9fa0713655d4737ebdeb404afac4984e (patch)
tree478fedb172c14c2216d74b1b9beab4aca2f45766
parentc6df954fc00e4fdc7e2888e7dc3fe3a7c8f930e4 (diff)
parenta0562e0e48ca60ead4aa1be7746e94b92828edca (diff)
downloadvolse-hubzilla-50d4206e9fa0713655d4737ebdeb404afac4984e.tar.gz
volse-hubzilla-50d4206e9fa0713655d4737ebdeb404afac4984e.tar.bz2
volse-hubzilla-50d4206e9fa0713655d4737ebdeb404afac4984e.zip
Merge https://github.com/friendica/red into zpull
-rw-r--r--mod/editpost.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/mod/editpost.php b/mod/editpost.php
index 583bae9eb..8d510ce05 100644
--- a/mod/editpost.php
+++ b/mod/editpost.php
@@ -2,6 +2,8 @@
require_once('acl_selectors.php');
require_once('include/crypto.php');
+require_once('include/items.php');
+require_once('include/taxonomy.php');
function editpost_content(&$a) {
@@ -70,6 +72,22 @@ function editpost_content(&$a) {
//$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
+ $category = '';
+ $catsenabled = ((feature_enabled(local_user(),'categories')) ? 'categories' : '');
+
+ if ($catsenabled){
+ $itm = fetch_post_tags($itm);
+
+ $cats = get_terms_oftype($itm[0]['term'], TERM_CATEGORY);
+
+ foreach ($cats as $cat) {
+ if (strlen($category))
+ $category .= ', ';
+ $category .= $cat['term'];
+ }
+
+ }
+
$o .= replace_macros($tpl,array(
'$return_path' => $_SESSION['return_url'],
'$action' => 'item',
@@ -95,7 +113,7 @@ function editpost_content(&$a) {
'$jotnets' => $jotnets,
'$title' => htmlspecialchars($itm[0]['title']),
'$placeholdertitle' => t('Set title'),
- '$category' => '', // FIXME
+ '$category' => $category,
'$placeholdercategory' => t('Categories (comma-separated list)'),
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,
@@ -105,6 +123,7 @@ function editpost_content(&$a) {
'$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''),
'$jotplugins' => $jotplugins,
'$sourceapp' => t($a->sourcename),
+ '$catsenabled' => $catsenabled,
));
return $o;