Ignore:
Timestamp:
Nov 23, 2013, 5:47:04 PM (11 years ago)
Author:
mistic100
Message:

quick edit for album
add language files
force default language for the toolbar
fix $_GET collision
orange save button
fix popup background color

Location:
extensions/AdminTools/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdminTools/include/MultiView.class.php

    r25619 r25655  
    11<?php
    2 defined('ADMINTOOLS_ID') or die('Hacking attempt!');
     2defined('ADMINTOOLS_PATH') or die('Hacking attempt!');
    33
    44/**
     
    129129
    130130      // view_as
    131       if (isset($_GET['view_as']))
    132       {
    133         $this->data['view_as'] = (int)$_GET['view_as'];
     131      if (isset($_GET['ato_view_as']))
     132      {
     133        $this->data['view_as'] = (int)$_GET['ato_view_as'];
    134134      }
    135135      if ($this->data['view_as'] != $user['id'])
     
    141141
    142142      // theme
    143       if (isset($_GET['theme']))
    144       {
    145         $this->data['theme'] = $_GET['theme'];
     143      if (isset($_GET['ato_theme']))
     144      {
     145        $this->data['theme'] = $_GET['ato_theme'];
    146146      }
    147147      $user['theme'] = $this->data['theme'];
    148148
    149149      // lang
    150       if (isset($_GET['lang']))
    151       {
    152         $this->data['lang'] = $_GET['lang'];
     150      if (isset($_GET['ato_lang']))
     151      {
     152        $this->data['lang'] = $_GET['ato_lang'];
    153153      }
    154154      $user['language'] = $this->data['lang'];
    155155
    156156      // show_queries
    157       if (isset($_GET['show_queries']))
    158       {
    159         $this->data['show_queries'] = (bool)$_GET['show_queries'];
     157      if (isset($_GET['ato_show_queries']))
     158      {
     159        $this->data['show_queries'] = (bool)$_GET['ato_show_queries'];
    160160      }
    161161      $conf['show_queries'] = $this->data['show_queries'];
    162162
    163163      // debug_l10n
    164       if (isset($_GET['debug_l10n']))
    165       {
    166         $this->data['debug_l10n'] = (bool)$_GET['debug_l10n'];
     164      if (isset($_GET['ato_debug_l10n']))
     165      {
     166        $this->data['debug_l10n'] = (bool)$_GET['ato_debug_l10n'];
    167167      }
    168168      $conf['debug_l10n'] = $this->data['debug_l10n'];
    169169
    170170      // debug_template
    171       if (isset($_GET['debug_template']))
    172       {
    173         $this->data['debug_template'] = (bool)$_GET['debug_template'];
     171      if (isset($_GET['ato_debug_template']))
     172      {
     173        $this->data['debug_template'] = (bool)$_GET['ato_debug_template'];
    174174      }
    175175      $conf['debug_template'] = $this->data['debug_template'];
    176176
    177177      // template_combine_files
    178       if (isset($_GET['template_combine_files']))
    179       {
    180         $this->data['template_combine_files'] = (bool)$_GET['template_combine_files'];
     178      if (isset($_GET['ato_template_combine_files']))
     179      {
     180        $this->data['template_combine_files'] = (bool)$_GET['ato_template_combine_files'];
    181181      }
    182182      $conf['template_combine_files'] = $this->data['template_combine_files'];
    183183
    184184      // no_history
    185       if (isset($_GET['no_history']))
    186       {
    187         $this->data['no_history'] = (bool)$_GET['no_history'];
     185      if (isset($_GET['ato_no_history']))
     186      {
     187        $this->data['no_history'] = (bool)$_GET['ato_no_history'];
    188188      }
    189189      if ($this->data['no_history'])
     
    201201  public function init()
    202202  {
    203     if (isset($_GET['purge_template']))
     203    if (isset($_GET['ato_purge_template']))
    204204    {
    205205      global $template;
  • extensions/AdminTools/include/events.inc.php

    r25654 r25655  
    22defined('ADMINTOOLS_PATH') or die('Hacking attempt!');
    33
     4/**
     5 * Add main toolbar to current page
     6 * @trigger loc_after_page_header
     7 */
    48function admintools_add_public_controller()
    59{
     
    2428    );
    2529
     30  if (!is_admin())
     31  {
     32    load_language('admin.lang');
     33  }
     34
     35  switch_lang_to(get_default_language());
     36
    2637  // TODO : param to allow owner modification
    2738  if (script_basename() == 'picture')
     
    8697
    8798    $tpl_vars['QUICK_EDIT'] = array(
    88       'file' => $picture['current']['file'],
     99      'img' => $picture['current']['derivatives']['square'],
    89100      'name' => $picture['current']['name'],
    90101      'comment' => $picture['current']['comment'],
     
    118129        );
    119130    }
     131
     132    $query = 'SELECT * FROM '.IMAGES_TABLE.' WHERE id = '. $page['category']['representative_picture_id'] .';';
     133    $image_infos = pwg_db_fetch_assoc(pwg_query($query));
     134
     135    $tpl_vars['QUICK_EDIT'] = array(
     136      'img' => DerivativeImage::get_one(IMG_SQUARE, $image_infos),
     137      'name' => $page['category']['name'],
     138      'comment' => $page['category']['comment'],
     139      );
    120140  }
    121141
     
    134154  include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
    135155  $themes = new themes();
    136   foreach (array_keys($themes->fs_themes) as $theme)
    137   {
    138     $tpl_vars['THEMES'][$theme] = $theme;
     156  foreach (array_keys($themes->db_themes_by_id) as $theme)
     157  {
     158    if (!empty($theme))
     159    {
     160      $tpl_vars['THEMES'][$theme] = $theme;
     161    }
    139162  }
    140163
     
    153176  $template->set_filename('ato', realpath(ADMINTOOLS_PATH . 'template/public_controller.tpl'));
    154177  $template->parse('ato');
    155 }
    156 
     178
     179  switch_lang_back();
     180}
     181
     182/**
     183 * Disable privacy level switchbox
     184 */
    157185function admintools_remove_privacy($content)
    158186{
     
    162190}
    163191
     192/**
     193 * Save picture form
     194 * @trigger loc_begin_picture
     195 */
    164196function admintools_save_picture()
    165197{
     
    225257  }
    226258}
     259
     260/**
     261 * Save category form
     262 * @trigger loc_begin_index
     263 */
     264function admintools_save_category()
     265{
     266  global $page, $conf;
     267 
     268  if (@$_POST['action'] == 'quick_edit')
     269  {
     270    $data = array(
     271      'name' => $_POST['name'],
     272      );
     273
     274    if ($conf['allow_html_descriptions'])
     275    {
     276      $data['comment'] = @$_POST['comment'];
     277    }
     278    else
     279    {
     280      $data['comment'] = strip_tags(@$_POST['comment']);
     281    }
     282
     283    single_update(
     284      CATEGORIES_TABLE,
     285      $data,
     286      array('id' => $page['category']['id'])
     287      );
     288     
     289    redirect(duplicate_index_url());
     290  }
     291}
Note: See TracChangeset for help on using the changeset viewer.