page_params and meta_tags administration

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

page_params and meta_tags administration

Post by cmb » Mon May 19, 2014 7:05 pm

Hello Community,

I suggest that we rename _admin.php of page_params and meta_tags to admin.php, and hide both plugins from the plugin menu via $cf['plugins']['hidden'] (if at all) for CMSimple_XH 1.6.3.

Furthermore these files should be revised: the initialisation of $meta_tags, $admin and $action in meta_tags is simply superfluous and the three if statements of page_params could be obviously simplified. At least the following is nonsense (though not a bug):

Code: Select all

    if ($admin <> 'plugin_main') {
        $o .= plugin_admin_common($action, $admin, $plugin);
    }
    if ($admin == 'plugin_main') {
        $o .= plugin_admin_common($action, $admin, $plugin);
    }
Christoph
Last edited by cmb on Mon May 19, 2014 7:10 pm, edited 1 time in total.
Reason: added link
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1651
Joined: Wed Dec 17, 2008 5:08 pm

Re: page_params and meta_tags administration

Post by svasti » Mon May 19, 2014 8:11 pm

Great programming, we need more such examples! :lol:

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: page_params and meta_tags administration

Post by cmb » Mon May 19, 2014 8:41 pm

svasti wrote:Great programming, we need more such examples! :lol:
That is most likely the result of some unfinished or reverted work, which was refactored later, though, not carefully enough. In XH 1.0 it was:

Code: Select all

    if($admin<>'plugin_main'){
        $o .= plugin_admin_common($action,$admin,$plugin);
    }
    if ($admin == 'plugin_main') {
        $acturl = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?&" . $plugin . "&admin=plugin_main&action=plugin_text";
        $o .= plugin_admin_common($action, $admin, $plugin);
    } 
Apparently, $acturl should have served some purpose (and maybe it did in an earlier beta version), but was not used. I've noticed this when working on XH 1.6 and removed the line. But I overlooked the rest. :oops:

However, apparently others make similar mistakes: http://www.badprogramming.com/code/I-do ... t-%22if%22.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: page_params and meta_tags administration

Post by cmb » Thu Aug 14, 2014 6:29 pm

Done (r1346).
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply