cleanup editpost

This commit is contained in:
friendica 2012-12-21 04:08:48 -08:00
parent 7daf2cf7db
commit 8d71fe91f6
4 changed files with 15 additions and 26 deletions

View File

@ -103,7 +103,7 @@ PRIMARY KEY ( `site_url` )
function update_r1005() { function update_r1005() {
q("drop table guid"); q("drop table guid");
q("drop table `notify-threads`); q("drop table `notify-threads`");
return UPDATE_SUCCESS; return UPDATE_SUCCESS;
} }

View File

@ -11,7 +11,7 @@ function editpost_content(&$a) {
return; return;
} }
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); $post_id = ((argc() > 1) ? intval(argv(1)) : 0);
if(! $post_id) { if(! $post_id) {
notice( t('Item not found') . EOL); notice( t('Item not found') . EOL);
@ -32,12 +32,12 @@ function editpost_content(&$a) {
if(feature_enabled(local_user(),'richtext')) if(feature_enabled(local_user(),'richtext'))
$plaintext = false; $plaintext = false;
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit post')
));
$o .= '<h2>' . t('Edit post') . '</h2>';
$tpl = get_markup_template('jot-header.tpl'); $a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array(
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$ispublic' => '&nbsp;', // t('Visible to <strong>everybody</strong>'), '$ispublic' => '&nbsp;', // t('Visible to <strong>everybody</strong>'),
@ -48,19 +48,13 @@ function editpost_content(&$a) {
$tpl = get_markup_template("jot.tpl"); $tpl = get_markup_template("jot.tpl");
if(($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))))
$lockstate = 'lock';
else
$lockstate = 'unlock';
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
$jotplugins = ''; $jotplugins = '';
$jotnets = ''; $jotnets = '';
call_hooks('jot_tool', $jotplugins); call_hooks('jot_tool', $jotplugins);
call_hooks('jot_networks', $jotnets); call_hooks('jot_networks', $jotnets);
$channel = $a->get_channel();
//$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); //$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
@ -83,7 +77,7 @@ function editpost_content(&$a) {
'$content' => undo_post_tagging($itm[0]['body']), '$content' => undo_post_tagging($itm[0]['body']),
'$post_id' => $post_id, '$post_id' => $post_id,
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
'$defloc' => $a->user['default-location'], '$defloc' => $channel['channel_location'],
'$visitor' => 'none', '$visitor' => 'none',
'$pvisit' => 'none', '$pvisit' => 'none',
'$public' => t('Public post'), '$public' => t('Public post'),
@ -94,10 +88,10 @@ function editpost_content(&$a) {
'$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,
'$acl' => '', // populate_acl((($group) ? $group_acl : $a->user), $celeb), '$acl' => '',
'$bang' => (($group) ? '!' : ''), '$bang' => '',
'$profile_uid' => $_SESSION['uid'], '$profile_uid' => 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),
)); ));

View File

@ -1,13 +1,7 @@
<?php <?php
function login_content(&$a) { function login_content(&$a) {
if(x($_SESSION,'theme'))
unset($_SESSION['theme']);
if(x($_SESSION,'mobile-theme'))
unset($_SESSION['mobile-theme']);
if(local_user()) if(local_user())
goaway(z_root()); goaway(z_root());
return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true); return login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? false : true);
} }

1
view/tpl/edpost_head.tpl Normal file
View File

@ -0,0 +1 @@
<h2>$title</h2>