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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/themes.class.php

    r23821 r25018  
    7878        if (isset($missing_parent))
    7979        {
    80           array_push(
    81             $errors,
    82             sprintf(
    83               l10n('Impossible to activate this theme, the parent theme is missing: %s'),
    84               $missing_parent
    85               )
     80          $errors[] = l10n(
     81            'Impossible to activate this theme, the parent theme is missing: %s',
     82            $missing_parent
    8683            );
    8784
     
    9491            and $conf['mobile_theme'] != $theme_id)
    9592        {
    96           array_push($errors, l10n('You can activate only one mobile theme.'));
     93          $errors[] = l10n('You can activate only one mobile theme.');
    9794          break;
    9895        }
     
    135132        if (count($this->db_themes_by_id) <= 1)
    136133        {
    137           array_push(
    138             $errors,
    139             l10n('Impossible to deactivate this theme, you need at least one theme.')
    140             );
     134          $errors[] = l10n('Impossible to deactivate this theme, you need at least one theme.');
    141135          break;
    142136        }
     
    191185        if (!empty($crt_db_theme))
    192186        {
    193           array_push($errors, 'CANNOT DELETE - THEME IS INSTALLED');
     187          $errors[] = 'CANNOT DELETE - THEME IS INSTALLED';
    194188          break;
    195189        }
     
    203197        if (count($children) > 0)
    204198        {
    205           array_push(
    206             $errors,
    207             sprintf(
    208               l10n('Impossible to delete this theme. Other themes depends on it: %s'),
    209               implode(', ', $children)
    210               )
     199          $errors[] = l10n(
     200            'Impossible to delete this theme. Other themes depends on it: %s',
     201            implode(', ', $children)
    211202            );
    212203          break;
     
    263254      if (isset($test_child['parent']) and $test_child['parent'] == $theme_id)
    264255      {
    265         array_push($children, $test_child['name']);
     256        $children[] = $test_child['name'];
    266257      }
    267258    }
     
    323314    while ($row = pwg_db_fetch_assoc($result))
    324315    {
    325       array_push($themes, $row);
     316      $themes[] = $row;
    326317    }
    327318    return $themes;
     
    629620                and !empty($old_files))
    630621              {
    631                 array_push($old_files, 'obsolete.list');
     622                $old_files[] = 'obsolete.list';
    632623                foreach($old_files as $old_file)
    633624                {
Note: See TracChangeset for help on using the changeset viewer.