Ignore:
Timestamp:
Aug 14, 2005, 1:09:54 AM (19 years ago)
Author:
plg
Message:
  • new : maintenance screen in administration. There you can update categories informations (number of images, date of the last added element), update images informations (path, average rate), purge obsolete sessions, purge history.
  • new : ability to have random representative for categories. This configuration parameter is set to false by default.
  • new : ability to set an element as representative of a category without belonging to the category. Thus, administrator can choose representative even for empty categories.
  • improvement : semantically superior design for category edition screen by regrouping fields in fieldsets. The improved screen contains action buttons as in category list screen.
  • new : ability to move a virtual category (ie change its parent category).
  • bug fixed : the sync_users function checks all user children tables (access, cache, group association).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_options.php

    r675 r809  
    7373      break;
    7474    }
     75    case 'representative' :
     76    {
     77      $query = '
     78UPDATE '.CATEGORIES_TABLE.'
     79  SET representative_picture_id = NULL
     80  WHERE id IN ('.implode(',', $_POST['cat_true']).')
     81;';
     82      pwg_query($query);
     83      break;
     84    }
    7585  }
    7686}
     
    109119    {
    110120      set_cat_status($_POST['cat_false'], 'public');
     121      break;
     122    }
     123    case 'representative' :
     124    {
     125      // theoretically, all categories in $_POST['cat_false'] contain at
     126      // least one element, so PhpWebGallery can find a representant.
     127      set_random_representant($_POST['cat_false']);
    111128      break;
    112129    }
     
    179196        )
    180197      );
    181     $template->assign_block_vars('upload', array());
    182198    break;
    183199  }
     
    202218        )
    203219      );
    204     $template->assign_block_vars('comments', array());
    205220    break;
    206221  }
     
    225240        )
    226241      );
    227     $template->assign_block_vars('visible', array());
    228242    break;
    229243  }
     
    248262        )
    249263      );
    250     $template->assign_block_vars('status', array());
     264    break;
     265  }
     266  case 'representative' :
     267  {
     268    $query_true = '
     269SELECT id,name,uppercats,global_rank
     270  FROM '.CATEGORIES_TABLE.'
     271  WHERE representative_picture_id IS NOT NULL
     272;';
     273    $query_false = '
     274SELECT id,name,uppercats,global_rank
     275  FROM '.CATEGORIES_TABLE.'
     276  WHERE nb_images != 0
     277    AND representative_picture_id IS NULL
     278;';
     279    $template->assign_vars(
     280      array(
     281        'L_CAT_TITLE' => l10n('Representative'),
     282        'L_CAT_OPTIONS_TRUE' => l10n('singly represented'),
     283        'L_CAT_OPTIONS_FALSE' => l10n('randomly represented'),
     284        'L_CAT_OPTIONS_INFO' => l10n('')
     285        )
     286      );
    251287    break;
    252288  }
Note: See TracChangeset for help on using the changeset viewer.