e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
322 stars 214 forks source link

Deprecated Lans - Minor Tweaks #2278

Open MikeyGMT opened 7 years ago

MikeyGMT commented 7 years ago

Hi All, Does anyone object to me making a couple of minor tweaks to Deprecated Lans function?

image

Hence move the Info text to it's own row. Add tr's

        $text .= " 
<tr>
                <td><div class='alert-info alert alert-block'>".e107::getParser()->toHTML(LANG_LAN_140, true)."</div></td> 
</tr>
               <tr>
                <td class='form-inline'>
                    <select name='deprecatedLans[]' multiple style='height:200px'>
                        <option value=''>".LANG_LAN_141."</option>";

Sort the file arrays, hence these new lines - which use asort. I'll indent appropriately on commit.

        $omit = array('languages','\.png','\.gif','handlers');

        $lans = $fl->get_files(e_ADMIN,'.php','standard',0);
asort($lans);

        $fl->setFileFilter(array("^e_"));

        $root = $fl->get_files(e_BASE,'.*?/?.*?\.php',$omit,0);
asort($root);

        //$handlers = $fl->get_files(e_CORE."handlers",'.*?/?.*?\.php',$omit,0);//mikey

        $templates = $fl->get_files(e_CORE."templates",'.*?/?.*?\.php',$omit,0);
asort($templates);      

        $shortcodes = $fl->get_files(e_CORE."shortcodes",'.*?/?.*?\.php',$omit,1);
asort($shortcode);

Thirdly, I want to ask why all files are not searchable via the function? For example Lans are used in Plugins, Handlers etc, and as we need to check if a define is anywhere in the code, it would make sense to be able to search all the files.

Cheers Mikey

MikeyGMT commented 7 years ago

And here

        $selected = ($_POST['deprecatedLanFile'][0] == 'auto') ? "selected='selected'" :"";
        $text .= "<option value='auto' {$selected}>".LANG_LAN_142."</option><optgroup label='".LANG_LAN_143."'>\n";//Auto-Detect
asort($_SESSION['languageTools_lanFileList']);
        foreach($_SESSION['languageTools_lanFileList'] as $val)
MikeyGMT commented 7 years ago

@Moc @CaMer0n - any feedback on this last part? Is there a reason only parts of the code and Lans are accessible from the Deprecated Lans Function ... surely it would be good to include all?

"Thirdly, I want to ask why all files are not searchable via the function? For example Lans are used in Plugins, Handlers etc, and as we need to check if a define is anywhere in the code, it would make sense to be able to search all the files."

Moc commented 7 years ago

Whoops, sorry I thought this was all sorted out now. Reopening.

I think it would be a nice addition to have all files searchable.. I am not using any multilingual sites at the moment, so I am not that much into this discussion. Sorry.