allow categories to be edited when editing a post
This commit is contained in:
parent
879ac35952
commit
e9ffc46bd1
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
require_once('acl_selectors.php');
|
require_once('acl_selectors.php');
|
||||||
require_once('include/crypto.php');
|
require_once('include/crypto.php');
|
||||||
|
require_once('include/items.php');
|
||||||
|
require_once('include/taxonomy.php');
|
||||||
|
|
||||||
function editpost_content(&$a) {
|
function editpost_content(&$a) {
|
||||||
|
|
||||||
@ -70,6 +72,22 @@ function editpost_content(&$a) {
|
|||||||
//$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
|
//$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(
|
$o .= replace_macros($tpl,array(
|
||||||
'$return_path' => $_SESSION['return_url'],
|
'$return_path' => $_SESSION['return_url'],
|
||||||
'$action' => 'item',
|
'$action' => 'item',
|
||||||
@ -95,7 +113,7 @@ function editpost_content(&$a) {
|
|||||||
'$jotnets' => $jotnets,
|
'$jotnets' => $jotnets,
|
||||||
'$title' => htmlspecialchars($itm[0]['title']),
|
'$title' => htmlspecialchars($itm[0]['title']),
|
||||||
'$placeholdertitle' => t('Set title'),
|
'$placeholdertitle' => t('Set title'),
|
||||||
'$category' => '', // FIXME
|
'$category' => $category,
|
||||||
'$placeholdercategory' => t('Categories (comma-separated list)'),
|
'$placeholdercategory' => t('Categories (comma-separated list)'),
|
||||||
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
|
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
|
||||||
'$lockstate' => $lockstate,
|
'$lockstate' => $lockstate,
|
||||||
@ -105,6 +123,7 @@ function editpost_content(&$a) {
|
|||||||
'$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''),
|
'$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''),
|
||||||
'$jotplugins' => $jotplugins,
|
'$jotplugins' => $jotplugins,
|
||||||
'$sourceapp' => t($a->sourcename),
|
'$sourceapp' => t($a->sourcename),
|
||||||
|
'$catsenabled' => $catsenabled,
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
Reference in New Issue
Block a user