Changeset 25018 for trunk/plugins


Ignore:
Timestamp:
Oct 19, 2013, 7:43:04 PM (11 years ago)
Author:
mistic100
Message:

remove all array_push (50% slower than []) + some changes missing for feature:2978

Location:
trunk/plugins/LocalFilesEditor
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/LocalFilesEditor/admin.php

    r25005 r25018  
    5757{
    5858  $content_file = file_get_contents(get_bak_file($edited_file));
    59   array_push($page['infos'],
    60     l10n('locfiledit_bak_loaded1'),
    61     l10n('locfiledit_bak_loaded2'));
     59  $page['infos'][] = l10n('locfiledit_bak_loaded1'),
     60  $page['infos'][] = l10n('locfiledit_bak_loaded2');
    6261}
    6362
     
    7170  if (!is_webmaster())
    7271  {
    73     array_push($page['errors'], l10n('locfiledit_webmaster_only'));
     72    $page['errors'][] = l10n('locfiledit_webmaster_only');
    7473  }
    7574  else
     
    8281    if ($content_file === false)
    8382    {
    84       array_push($page['errors'], l10n('locfiledit_syntax_error'));
     83      $page['errors'][] = l10n('locfiledit_syntax_error');
    8584    }
    8685    else
     
    9392      {
    9493        @copy($edited_file, get_bak_file($edited_file));
    95         array_push($page['infos'], l10n('locfiledit_saved_bak', substr(get_bak_file($edited_file), 2)));
     94        $page['infos'][] = l10n('locfiledit_saved_bak', substr(get_bak_file($edited_file), 2));
    9695      }
    9796     
     
    105104      else
    106105      {
    107         array_push($page['errors'], l10n('locfiledit_cant_save'));
     106        $page['errors'][] = l10n('locfiledit_cant_save');
    108107      }
    109108    }
  • trunk/plugins/LocalFilesEditor/include/css.inc.php

    r20714 r25018  
    6565foreach ($db_themes as $db_theme)
    6666{
    67   array_push($db_theme_ids, $db_theme['id']);
     67  $db_theme_ids[] = $db_theme['id'];
    6868}
    6969
     
    8686    else
    8787    {
    88       array_push($active_themes, $fs_theme);
     88      $active_themes[] = $fs_theme;
    8989    }
    9090  }
    9191  else
    9292  {
    93     array_push($inactive_themes, $fs_theme);
     93    $inactive_themes[] = $fs_theme;
    9494  }
    9595}
  • trunk/plugins/LocalFilesEditor/include/tpl.inc.php

    r20714 r25018  
    4040  if (empty($filename))
    4141  {
    42     array_push($page['errors'], l10n('locfiledit_empty_filename'));
     42    $page['errors'][] = l10n('locfiledit_empty_filename');
    4343  }
    4444  if (get_extension($filename) != 'tpl')
     
    4848  if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $filename))
    4949  {
    50     array_push($page['errors'], l10n('locfiledit_filename_error'));
     50    $page['errors'][] = l10n('locfiledit_filename_error');
    5151  }
    5252  if (is_numeric($_POST['tpl_model']) and $_POST['tpl_model'] != '0')
    5353  {
    54     array_push($page['errors'], l10n('locfiledit_model_error'));
     54    $page['errors'][] = l10n('locfiledit_model_error');
    5555  }
    5656  if (file_exists($_POST['tpl_parent'] . '/' . $filename))
    5757  {
    58     array_push($page['errors'], l10n('locfiledit_file_already_exists'));
     58    $page['errors'][] = l10n('locfiledit_file_already_exists');
    5959  }
    6060  if (!empty($page['errors']))
  • trunk/plugins/LocalFilesEditor/main.inc.php

    r24926 r25018  
    3636function localfiles_admin_menu($menu)
    3737{
    38   array_push(
    39     $menu,
    40     array(
    41       'NAME' => 'LocalFiles Editor',
    42       'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))
    43       )
     38  $menu[] = array(
     39    'NAME' => 'LocalFiles Editor',
     40    'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))
    4441    );
    4542 
Note: See TracChangeset for help on using the changeset viewer.