]> git.mxchange.org Git - friendica.git/blobdiff - mod/editpost.php
Bugfix: dba::num_rows hadn't checked the object variable
[friendica.git] / mod / editpost.php
index eccd498d154b1dcd6c2762a0d8bdb03ee92b6d92..c0d903d0c3f8fda06541739af9cd7cc9c6eb41b6 100644 (file)
@@ -1,19 +1,21 @@
 <?php
 
+use Friendica\App;
+
 require_once('include/acl_selectors.php');
 
-function editpost_content(&$a) {
+function editpost_content(App $a) {
 
        $o = '';
 
-       if(! local_user()) {
+       if (! local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }
 
        $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
 
-       if(! $post_id) {
+       if (! $post_id) {
                notice( t('Item not found') . EOL);
                return;
        }
@@ -23,19 +25,11 @@ function editpost_content(&$a) {
                intval(local_user())
        );
 
-       if(! count($itm)) {
+       if (! dbm::is_result($itm)) {
                notice( t('Item not found') . EOL);
                return;
        }
 
-/*     $plaintext = false;
-       if( local_user() && intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled(local_user(),'richtext') )
-               $plaintext = true;*/
-       $plaintext = true;
-       if( local_user() && feature_enabled(local_user(),'richtext') )
-               $plaintext = false;
-
-
        $o .= replace_macros(get_markup_template("section_title.tpl"),array(
                '$title' => t('Edit post')
        ));
@@ -43,7 +37,6 @@ function editpost_content(&$a) {
        $tpl = get_markup_template('jot-header.tpl');
        $a->page['htmlhead'] .= replace_macros($tpl, array(
                '$baseurl' => App::get_baseurl(),
-               '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
                '$ispublic' => '&nbsp;', // t('Visible to <strong>everybody</strong>'),
                '$geotag' => $geotag,
                '$nickname' => $a->user['nickname']
@@ -52,7 +45,6 @@ function editpost_content(&$a) {
        $tpl = get_markup_template('jot-end.tpl');
        $a->page['end'] .= replace_macros($tpl, array(
                '$baseurl' => App::get_baseurl(),
-               '$editselect' =>  (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
                '$ispublic' => '&nbsp;', // t('Visible to <strong>everybody</strong>'),
                '$geotag' => $geotag,
                '$nickname' => $a->user['nickname']