Changeset 20090


Ignore:
Timestamp:
01/12/13 15:13:08 (7 years ago)
Author:
mistic100
Message:
  • add webservices
  • add mail function
  • add admin list
  • add admin export function
  • try to deal with Gthumb+
  • activate multisize dropdown menu of collection page

TODO : use webservices instead of toggle_image.php

Location:
extensions/UserCollections
Files:
24 added
34 edited
5 moved

Legend:

Unmodified
Added
Removed
  • extensions/UserCollections/include/UserCollection.class.php

    r17519 r20090  
    1212   * @param: array images 
    1313   */ 
    14   function __construct($col_id, $images=array(), $name=null, $active=false, $public=false) 
     14  function __construct($col_id, $images=array(), $name=null, $active=false, $public=false, $user_id=null) 
    1515  { 
    1616    global $user; 
     17     
     18    if (empty($user_id)) { 
     19      $user_id = $user['id']; 
     20    } 
    1721     
    1822    $this->data = array( 
    1923      'id' => 0, 
    20       'user_id' => $user['id'], 
     24      'user_id' => $user_id, 
    2125      'name' => null, 
    2226      'date_creation' => '0000-00-00 00:00:00', 
     
    2832    $this->images = array(); 
    2933     
    30     // access from public id 
     34    // access from public id (access permission is checked line 66) 
    3135    if ( strlen($col_id) == 10 and strpos($col_id, 'uc') === 0 ) 
    3236    { 
     
    8488        pwg_query($query); 
    8589       
     90        // select images of the collection 
    8691        $query = ' 
    8792SELECT image_id 
     
    9196        $this->images = array_from_query($query, 'image_id'); 
    9297         
    93         if ($this->data['nb_images'] != count($this->images)) 
    94         { 
    95           $this->updateParam('nb_images', count($this->images)); 
    96         } 
     98        $this->updateParam('nb_images', count($this->images)); 
    9799      } 
    98100      else 
     
    130132      $this->data['id'] = pwg_db_insert_id(); 
    131133       
    132       $date = pwg_query('SELECT FROM_UNIXTIME(NOW());'); 
     134      $date = pwg_query('SELECT NOW();'); 
    133135      list($this->data['date_creation']) = pwg_db_fetch_row($date); 
    134136       
     
    164166  function updateParam($name, $value) 
    165167  { 
    166     $this->data[$name] = $value; 
    167     pwg_query('UPDATE '.COLLECTIONS_TABLE.' SET '.$name.' = "'.$value.'" WHERE id = '.$this->data['id'].';'); 
     168    if ($value != $this->data[$name]) 
     169    { 
     170      $this->data[$name] = $value; 
     171      pwg_query('UPDATE '.COLLECTIONS_TABLE.' SET '.$name.' = "'.pwg_db_real_escape_string($value).'" WHERE id = '.$this->data['id'].';'); 
     172    } 
    168173  } 
    169174   
     
    246251      ); 
    247252       
     253    $query = ' 
     254UPDATE '.COLLECTION_IMAGES_TABLE.' 
     255  SET add_date = NOW() 
     256  WHERE 
     257    col_id = '.$this->data['id'].' 
     258    AND image_id IN ('.implode(',', $image_ids).') 
     259    AND add_date IS NULL 
     260'; 
     261    pwg_query($query); 
     262       
    248263    $this->updateParam('nb_images', count($this->images)); 
    249264  } 
     
    291306      'ACTIVE' => (bool)$this->data['active'], 
    292307      'PUBLIC' => (bool)$this->data['public'], 
    293       'DATE_CREATION' => format_date($this->data['date_creation'], true), 
     308      'DATE_CREATION' => $this->data['date_creation'], 
    294309      'U_PUBLIC' => USER_COLLEC_PUBLIC . 'view/'.$this->data['public_id'], 
    295310      'IS_TEMP' =>  $this->data['name'] == 'temp', 
     
    298313    return $set; 
    299314  } 
     315   
     316  /** 
     317   * Send the collection by email 
     318   * @param: array 
     319   *          - sender_name 
     320   *          - sender_email 
     321   *          - recipient_email 
     322   *          - recipient_name 
     323   *          - nb_images 
     324   *          - message 
     325   * @return: array errors 
     326   */ 
     327  function sendEmail($comm, $key) 
     328  { 
     329    global $conf, $page, $template; 
     330     
     331    $errors = array(); 
     332     
     333    $comm = array_map('stripslashes', $comm); 
     334 
     335    $comment_action='validate'; 
     336     
     337    // check key 
     338    if (!verify_ephemeral_key(@$key)) 
     339    { 
     340      array_push($errors, l10n('Invalid or expired security key')); 
     341      $comment_action='reject'; 
     342    } 
     343 
     344    // check author 
     345    if (empty($comm['sender_name'])) 
     346    { 
     347      array_push($errors, l10n('Please enter your name')); 
     348      $comment_action='reject'; 
     349    }       
     350    if (empty($comm['recipient_name'])) 
     351    { 
     352      array_push($errors, l10n('Please enter the recipient name')); 
     353      $comment_action='reject'; 
     354    } 
     355     
     356    // check email 
     357    if (empty($comm['sender_email'])) 
     358    { 
     359      array_push($errors, l10n('Please enter your e-mail')); 
     360      $comment_action='reject'; 
     361    } 
     362    else if ( !empty($comm['sender_email']) and !uc_check_email_validity($comm['sender_email']) ) 
     363    { 
     364      array_push($errors, l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)')); 
     365      $comment_action='reject'; 
     366    } 
     367    if (empty($comm['recipient_email'])) 
     368    { 
     369      array_push($errors, l10n('Please enter the recipient e-mail')); 
     370      $comment_action='reject'; 
     371    } 
     372    else if ( !empty($comm['recipient_email']) and !uc_check_email_validity($comm['recipient_email']) ) 
     373    { 
     374      array_push($errors, l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)')); 
     375      $comment_action='reject'; 
     376    } 
     377      
     378    // check content 
     379    if (!empty($comm['message'])) 
     380    { 
     381      $comm['message'] = nl2br($comm['message']); 
     382    } 
     383     
     384    include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 
     385     
     386    if ($comment_action == 'validate') 
     387    { 
     388      // format subject 
     389      $subject = '['.$conf['gallery_title'].'] '.sprintf(l10n('A photo collection by %s'), $comm['sender_name']); 
     390      $subject = encode_mime_header($subject); 
     391             
     392      // format expeditor 
     393      $args['from'] = format_email($comm['sender_name'], $comm['sender_email']); 
     394      $args['to'] = format_email($comm['recipient_name'], $comm['recipient_email']); 
     395       
     396      // hearders 
     397      $headers = 'From: '.$args['from']."\n";   
     398      $headers.= 'MIME-Version: 1.0'."\n"; 
     399      $headers.= 'X-Mailer: Piwigo Mailer'."\n"; 
     400      $headers.= 'Content-Transfer-Encoding: 8bit'."\n"; 
     401      $headers.= 'Content-Type: text/html; charset="'.get_pwg_charset().'";'."\n"; 
     402             
     403      // mail content 
     404      $content = $this->getMailContent($comm); 
     405      $content = wordwrap($content, 70, "\n", true); 
     406       
     407      // send mail 
     408      $result = 
     409        trigger_event('send_mail', 
     410          false, /* Result */ 
     411          trigger_event('send_mail_to', $args['to']), 
     412          trigger_event('send_mail_subject', $subject), 
     413          trigger_event('send_mail_content', $content), 
     414          trigger_event('send_mail_headers', $headers), 
     415          $args 
     416        ); 
     417       
     418      if ($result == false) 
     419      { 
     420        $_SESSION['page_errors'][] = l10n('Error while sending e-mail'); 
     421      } 
     422      else 
     423      { 
     424        $_SESSION['page_infos'][] = l10n('E-mail sent successfully'); 
     425      } 
     426       
     427      redirect(); 
     428    } 
     429     
     430    return $errors; 
     431  } 
     432   
     433  /** 
     434   * get mail content for sendMail() 
     435   */ 
     436  function getMailContent($params) 
     437  { 
     438    global $user, $conf, $template; 
     439     
     440    // switch to guest user 
     441    $user_save = $user; 
     442    $user = build_user($conf['guest_id'], true); 
     443     
     444    // get pictures 
     445    $query = ' 
     446SELECT 
     447    id, 
     448    file, 
     449    name, 
     450    path 
     451  FROM '.IMAGES_TABLE.' AS i 
     452    JOIN '.IMAGE_CATEGORY_TABLE.' AS ci ON ci.image_id = i.id 
     453  WHERE id IN ('.implode(',', $this->images).') 
     454    '.get_sql_condition_FandF(array( 
     455                'forbidden_categories' => 'category_id', 
     456                'forbidden_images' => 'id' 
     457                ), 
     458              'AND' 
     459              ).' 
     460  GROUP BY i.id 
     461  ORDER BY '.DB_RANDOM_FUNCTION.'() 
     462  LIMIT '.$params['nb_images'].' 
     463;'; 
     464    $pictures = hash_from_query($query, 'id'); 
     465     
     466    // switch back to current user 
     467    $user = $user_save; 
     468    unset($user_save); 
     469   
     470    // picture sinfos 
     471    set_make_full_url(); 
     472    $tpl_vars = array(); 
     473    foreach ($pictures as $row) 
     474    { 
     475      $name = render_element_name($row); 
     476       
     477      $tpl_vars[] = array( 
     478        'TN_ALT' => htmlspecialchars(strip_tags($name)), 
     479        'NAME' => $name, 
     480        'URL' => make_picture_url(array('image_id' => $row['id'])), 
     481        'THUMB' => DerivativeImage::url(IMG_SQUARE, $row), 
     482        ); 
     483    } 
     484     
     485    // template 
     486    $mail_css = file_get_contents(dirname(__FILE__).'/../template/mail.css'); 
     487     
     488    $template->assign(array( 
     489      'GALLERY_URL' => get_gallery_home_url(), 
     490      'PHPWG_URL' => PHPWG_URL, 
     491      'UC_MAIL_CSS' => str_replace("\n", null, $mail_css), 
     492      'MAIL_TITLE' => $this->getParam('name').' ('.sprintf(l10n('by %s'), $params['sender_name']).')', 
     493      'COL_URL' => USER_COLLEC_PUBLIC . 'view/'.$this->data['public_id'], 
     494      'PARAMS' => $params, 
     495      'derivative_params' => ImageStdParams::get_by_type(IMG_SQUARE), 
     496      'thumbnails' => $tpl_vars, 
     497      )); 
     498       
     499    $template->set_filename('uc_mail', dirname(__FILE__).'/../template/mail.tpl'); 
     500    $content = $template->parse('uc_mail', true); 
     501   
     502    unset_make_full_url(); 
     503     
     504    return $content; 
     505  } 
     506 
     507  /** 
     508   * generate a listing of the collection 
     509   */ 
     510  function serialize($params) 
     511  {       
     512    $content = null; 
     513      
     514    // get images infos 
     515    $query = ' 
     516SELECT 
     517    id, 
     518    file, 
     519    name, 
     520    path 
     521  FROM '.IMAGES_TABLE.' 
     522  WHERE id IN('.implode(',', $this->images).') 
     523  ORDER BY id 
     524;'; 
     525    $pictures = hash_from_query($query, 'id'); 
     526     
     527    if (count($pictures)) 
     528    { 
     529      // generate csv 
     530      set_make_full_url(); 
     531      $root_url = get_root_url(); 
     532       
     533      $fp = fopen('php://temp', 'r+'); 
     534      foreach ($pictures as $row) 
     535      { 
     536        $element = array(); 
     537        foreach ($params as $field) 
     538        { 
     539          switch ($field) 
     540          { 
     541          case 'id': 
     542            $element[] = $row['id']; break; 
     543          case 'file': 
     544            $element[] = $row['file']; break; 
     545          case 'name': 
     546            $element[] = render_element_name($row); break; 
     547          case 'url': 
     548            $element[] = make_picture_url(array('image_id'=>$row['id'], 'image_file'=>$row['file'])); break; 
     549          case 'path': 
     550            $element[] = $root_url.ltrim($row['path'], './'); break; 
     551          } 
     552        } 
     553        if (!empty($element)) 
     554        { 
     555          fputcsv($fp, $element); 
     556        } 
     557      } 
     558       
     559      rewind($fp); 
     560      $content = stream_get_contents($fp); 
     561      fclose($fp); 
     562       
     563      unset_make_full_url(); 
     564    } 
     565     
     566    return $content; 
     567  } 
    300568} 
    301569 
  • extensions/UserCollections/include/collections.inc.php

    r19843 r20090  
    159159    $self_url = USER_COLLEC_PUBLIC . 'edit/'.$page['col_id']; 
    160160    $template->assign(array( 
     161      'user_collections' => $conf['user_collections'], 
    161162      'USER_COLLEC_PATH' => USER_COLLEC_PATH, 
    162163      'F_ACTION' => $self_url, 
     
    184185        else 
    185186        { 
    186           $UserCollection->updateParam('name', $_POST['name']); 
     187          $UserCollection->updateParam('name', stripslashes($_POST['name'])); 
     188        } 
     189        if (!$conf['user_collections']['allow_public']) 
     190        { 
     191          $_POST['public'] = '0'; 
    187192        } 
    188193        $UserCollection->updateParam('public', $_POST['public']); 
     194      } 
     195       
     196      // send mail 
     197      if ( $conf['user_collections']['allow_public'] and $conf['user_collections']['allow_mails'] ) 
     198      { 
     199        $contact = array( 
     200            'sender_name' => $user['username'], 
     201            'sender_email' => $user['email'], 
     202            'recipient_name' => null, 
     203            'recipient_email' => null, 
     204            'nb_images' => 4, 
     205            'message' => null, 
     206            ); 
     207             
     208        if ( isset($_POST['send_mail']) and (bool)$UserCollection->getParam('public') ) 
     209        { 
     210          $contact = array( 
     211            'sender_email' => trim($_POST['sender_email']), 
     212            'sender_name' => trim($_POST['sender_name']), 
     213            'recipient_email' => trim($_POST['recipient_email']), 
     214            'recipient_name' => trim($_POST['recipient_name']), 
     215            'nb_images' => $_POST['nb_images'], 
     216            'message' => $_POST['message'], 
     217            ); 
     218             
     219          $errors = $UserCollection->sendEmail($contact, @$_POST['key']); 
     220          if (count($errors)) 
     221          { 
     222            $template->assign('uc_mail_errors', $errors); 
     223          } 
     224        } 
     225         
     226        $contact['KEY'] = get_ephemeral_key(3); 
     227        $template->assign('contact', $contact); 
    189228      } 
    190229       
     
    202241      } 
    203242       
    204       // special template 
    205       add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_in_collection', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2); // +10 to overload GThumb+ 
     243      // add links for colorbox 
     244      add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_in_collection', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
     245       
     246      // add remove item links 
    206247      $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_prefilter'); 
    207248       
    208249      // collection content 
    209250      $col = $UserCollection->getCollectionInfo(); 
     251      $col['DATE_CREATION'] = format_date($col['DATE_CREATION'], true); 
    210252      $col['U_CLEAR'] = $self_url.'&action=clear'; 
    211253      $col['U_DELETE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$page['col_id'])); 
    212254      $template->assign('collection', $col); 
    213        
    214255      $page['items'] = $UserCollection->getImages(); 
    215256       
    216       // navigation bar 
    217       $page['start'] = isset($_GET['start']) ? $_GET['start'] : 0; 
    218       if (count($page['items']) > $page['nb_image_page']) 
    219       { 
    220         $page['navigation_bar'] = create_navigation_bar( 
    221           $self_url, 
    222           count($page['items']), 
    223           $page['start'], 
    224           $page['nb_image_page'], 
    225           false 
    226           ); 
    227         $template->assign('navbar', $page['navigation_bar']); 
    228       } 
    229        
    230       // display 
    231       include(PHPWG_ROOT_PATH . 'include/category_default.inc.php'); 
     257      // toolbar buttons 
     258      $buttons = null; 
     259      if ($conf['user_collections']['allow_public'] and $conf['user_collections']['allow_mails']) 
     260      { 
     261        $buttons.= '<li><a class="mail_colorbox_open" href="#mail_form" title="'.l10n('Send this collection my mail').'" class="pwg-state-default pwg-button" rel="nofollow" '.(!$col['PUBLIC']?'onClick="alert(\''.l10n('The collection must be public in order to send it').'\');return false;"':null).'> 
     262          <span class="pwg-icon user-collections-delete-icon" style="background:url(\'' . get_root_url().USER_COLLEC_PATH . 'template/resources/mail.png\') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">'.l10n('Send').'</span> 
     263        </a></li>'; 
     264      } 
     265      $buttons.= ' 
     266        <li><a href="'. $col['U_CLEAR'] .'" title="'.l10n('Clear this collection').'" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm(\''.l10n('Are you sure?').'\');"> 
     267          <span class="pwg-icon user-collections-delete-icon" style="background:url(\'' . get_root_url().USER_COLLEC_PATH . 'template/resources/bin.png\') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">'.l10n('Clear').'</span> 
     268        </a></li> 
     269        <li><a href="'. $col['U_DELETE'] .'" title="'.l10n('Delete this collection').'" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm(\''.l10n('Are you sure?').'\');"> 
     270          <span class="pwg-icon user-collections-delete-icon" style="background:url(\'' . get_root_url().USER_COLLEC_PATH . 'template/resources/delete.png\') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">'.l10n('Delete').'</span> 
     271        </a></li>'; 
     272      $template->concat('COLLECTION_ACTIONS', $buttons); 
     273       
     274      // thumbnails 
     275      define('USER_COLLEC_REMOVE_GTHUMB', true); 
     276      include(USER_COLLEC_PATH . '/include/display_thumbnails.inc.php'); 
    232277       
    233278      $template->concat('TITLE', $conf['level_separator'].$UserCollection->getParam('name')); 
     
    245290  { 
    246291    // security 
    247     if ( empty($page['col_id']) or strlen($page['col_id']) != 10 or strpos($page['col_id'], 'uc') === false ) 
     292    if ( empty($page['col_id']) or strlen($page['col_id']) != 10 or strpos($page['col_id'], 'uc') === false or !$conf['user_collections']['allow_public'] ) 
    248293    { 
    249294      $_SESSION['page_errors'][] = l10n('Invalid collection'); 
     
    257302    try { 
    258303      $UserCollection = new UserCollection($page['col_id']); 
    259        
    260       // special template 
    261       add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_in_collection', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2); // +10 to overload GThumb+ 
    262        
    263       // collection content 
    264304      $page['items'] = $UserCollection->getImages(); 
    265305       
    266       // navigation bar 
    267       $page['start'] = isset($_GET['start']) ? $_GET['start'] : 0; 
    268       if (count($page['items']) > $page['nb_image_page']) 
    269       { 
    270         $page['navigation_bar'] = create_navigation_bar( 
    271           $self_url, 
    272           count($page['items']), 
    273           $page['start'], 
    274           $page['nb_image_page'], 
    275           false 
    276           ); 
    277         $template->assign('navbar', $page['navigation_bar']); 
    278       } 
    279        
    280       // display 
    281       include(PHPWG_ROOT_PATH . 'include/category_default.inc.php'); 
    282        
     306      // thumbnails 
     307      include(USER_COLLEC_PATH . '/include/display_thumbnails.inc.php'); 
     308       
     309      // add username in title 
    283310      include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    284311      $template->concat('TITLE',  
     
    295322  } 
    296323} 
     324 
    297325 
    298326$template->assign(array( 
  • extensions/UserCollections/include/events.inc.php

    r17657 r20090  
    33 
    44# this file contains all functions directly called by the triggers # 
     5 
     6/* compatibility fix with Gthumb+ */ 
     7function user_collections_save_pagination() 
     8{ 
     9  global $user, $page, $uc_nb_image_page_save; 
     10    
     11  $uc_nb_image_page_save['user'] = $user['nb_image_page']; 
     12  $uc_nb_image_page_save['page'] = $page['nb_image_page']; 
     13} 
    514 
    615 
     
    122131{strip}<a class="addCollection" href="{$collection_toggle_url}{$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow"> 
    123132{if $COL_ID or $thumbnail.COLLECTION_SELECTED} 
    124 {\'Remove from collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}"> 
     133{\'Remove from collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/image_delete.png" title="{\'Remove from collection\'|@translate}"> 
    125134{else} 
    126 {\'Add to collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}"> 
     135{\'Add to collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/image_add.png" title="{\'Add to collection\'|@translate}"> 
    127136{/if} 
    128137</a>{/strip}'; 
  • extensions/UserCollections/include/functions.inc.php

    r16688 r20090  
    3232} 
    3333 
     34function uc_check_email_validity($mail_address) 
     35{ 
     36  if (function_exists('email_check_format')) 
     37  { 
     38    return email_check_format($mail_address); // Piwigo 2.5 
     39  } 
     40  else if (version_compare(PHP_VERSION, '5.2.0') >= 0) 
     41  { 
     42    return filter_var($mail_address, FILTER_VALIDATE_EMAIL)!==false; 
     43  } 
     44  else 
     45  { 
     46    $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase 
     47    $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 
     48    $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 
     49 
     50    return (bool)preg_match($regex, $mail_address); 
     51  } 
     52} 
     53 
    3454?> 
  • extensions/UserCollections/include/install.inc.php

    r17657 r20090  
    55{ 
    66  global $conf, $prefixeTable; 
     7   
     8  if (empty($conf['user_collections'])) 
     9  { 
     10    $default_config = serialize(array( 
     11      'allow_mails' => true, 
     12      'allow_public' => true, 
     13      )); 
     14       
     15    conf_update_param('user_collections', $default_config); 
     16    $conf['user_collections'] = $default_config; 
     17  } 
    718   
    819  // create tables 
     
    2637  `col_id` mediumint(8) NOT NULL, 
    2738  `image_id` mediumint(8) NOT NULL, 
     39  `add_date` DATETIME NULL, 
    2840  UNIQUE KEY `UNIQUE` (`col_id`,`image_id`) 
    2941) DEFAULT CHARSET=utf8 
    3042;'; 
    3143  pwg_query($query); 
     44   
     45  $result = pwg_query('SHOW COLUMNS FROM `'.$prefixeTable.'collection_images` LIKE "add_date";'); 
     46  if (!pwg_db_num_rows($result)) 
     47  { 
     48    pwg_query('ALTER TABLE `'.$prefixeTable.'collection_images` ADD `add_date` DATETIME NULL;'); 
     49  } 
    3250} 
    3351 
  • extensions/UserCollections/language/ca_ES/plugin.lang.php

    r18857 r20090  
    2929$lang['%d more...'] = '%d més...'; 
    3030$lang['Add to collection'] = 'Afegeix a la col·lecció'; 
    31 $lang['Clear collection'] = 'Esborra'; 
     31$lang['Clear'] = 'Esborra'; 
    3232$lang['Collection'] = 'Col·lecció'; 
    3333$lang['Collection name:'] = 'Nom de la col·lecció'; 
  • extensions/UserCollections/language/cs_CZ/plugin.lang.php

    r16722 r20090  
    2323$lang['%d more...'] = '%d více...'; 
    2424$lang['Add to collection'] = 'Přidat do sbírky'; 
    25 $lang['Clear collection'] = 'Vyčistit'; 
     25$lang['Clear'] = 'Vyčistit'; 
    2626$lang['Collection name:'] = 'Jméno sbírky'; 
    2727$lang['Collection'] = 'Sbírka'; 
  • extensions/UserCollections/language/da_DK/plugin.lang.php

    r18091 r20090  
    3030$lang['%d more...'] = '%d mere ...'; 
    3131$lang['Add to collection'] = 'Tilføj til samling'; 
    32 $lang['Clear collection'] = 'Ryd'; 
     32$lang['Clear'] = 'Ryd'; 
    3333$lang['Collection'] = 'Samling'; 
    3434$lang['Collection name:'] = 'Navn på samling:'; 
  • extensions/UserCollections/language/de_DE/plugin.lang.php

    r16714 r20090  
    2222// +-----------------------------------------------------------------------+ 
    2323$lang['Add to collection'] = 'Sammlung hinzufügen'; 
    24 $lang['Clear collection'] = 'Löschen'; 
     24$lang['Clear'] = 'Löschen'; 
    2525$lang['Collection name:'] = 'Name der Sammlung:'; 
    2626$lang['Collection'] = 'Sammlung'; 
  • extensions/UserCollections/language/el_GR/plugin.lang.php

    r16742 r20090  
    2222// +-----------------------------------------------------------------------+ 
    2323$lang['Add to collection'] = 'Προσθήκη στη συλλογή'; 
    24 $lang['Clear collection'] = 'Καθαρίζω'; 
     24$lang['Clear'] = 'Καθαρίζω'; 
    2525$lang['Collection name:'] = 'Όνομα Συλλογής'; 
    2626$lang['Collection'] = 'Συλλογή'; 
  • extensions/UserCollections/language/en_UK/plugin.lang.php

    r16698 r20090  
    2020$lang['Remove from collection'] = 'Remove from collection'; 
    2121$lang['Add to collection'] = 'Add to collection'; 
    22 $lang['Clear collection'] = 'Clear'; 
     22$lang['Clear'] = 'Clear'; 
    2323$lang['You have %d collection'] = 'You have %d collection'; 
    2424$lang['You have no collection'] = 'You have no collection'; 
     
    2828$lang['%d more...'] = '%d more...'; 
    2929 
     30$lang['Allow users to set their collections as public'] = 'Allow users to set their collections as public'; 
     31$lang['Allow users to send their public collections by mail'] = 'Allow users to send their public collections by mail'; 
     32$lang['Fields'] = 'Fields'; 
     33$lang['Active'] = 'Active'; 
     34$lang['Inactive'] = 'Inactive'; 
     35$lang['Generate'] = 'Generate'; 
     36$lang['Download CSV file'] = 'Download CSV file'; 
     37$lang['Output'] = 'Output'; 
     38$lang['Number of images'] = 'Number of images'; 
     39$lang['Edit this collection'] = 'Edit this collection'; 
     40$lang['Export image list'] = 'Export image list'; 
     41$lang['Delete this collection'] = 'Delete this collection'; 
     42$lang['Send this collection my mail'] = 'Send this collection my mail'; 
     43$lang['Clear this collection'] = 'Clear this collection'; 
     44$lang['Please enter your name'] = 'Please enter your name'; 
     45$lang['Please enter the recipient name'] = 'Please enter the recipient name'; 
     46$lang['Please enter your e-mail'] = 'Please enter your e-mail'; 
     47$lang['Please enter the recipient e-mail'] = 'Please enter the recipient e-mail'; 
     48$lang['A photo collection by %s'] = 'A photo collection by %s'; 
     49$lang['Error while sending e-mail'] = 'Error while sending e-mail'; 
     50$lang['E-mail sent successfully'] = 'E-mail sent successfully'; 
     51$lang['The collection must be public in order to send it'] = 'The collection must be public in order to send it'; 
     52$lang['Your name'] = 'Your name'; 
     53$lang['Your e-mail'] = 'Your e-mail'; 
     54$lang['Recipient name'] = 'Recipient name'; 
     55$lang['Recipient e-mail'] = 'Recipient e-mail'; 
     56$lang['Message (optional)'] = 'Message (optional)'; 
     57$lang['Hello <b>%s</b>, %s sent you a photos collection from <a href="%s">%s</a>'] = 'Hello <b>%s</b>, %s sent you a photos collection from <a href="%s">%s</a>'; 
     58$lang['Click here to view the complete collection'] = 'Click here to view the complete collection'; 
     59 
    3060?> 
  • extensions/UserCollections/language/es_ES/plugin.lang.php

    r16758 r20090  
    2323$lang['%d more...'] = '%d más...'; 
    2424$lang['Add to collection'] = 'Añadir a la colección'; 
    25 $lang['Clear collection'] = 'Limpiar'; 
     25$lang['Clear'] = 'Limpiar'; 
    2626$lang['Collection name:'] = 'Nombre de la colección'; 
    2727$lang['Collection'] = 'Colección'; 
  • extensions/UserCollections/language/fa_IR/plugin.lang.php

    r17696 r20090  
    2323$lang['%d more...'] = '%d بیشتر ...'; 
    2424$lang['Add to collection'] = 'افزودن به مجموعه'; 
    25 $lang['Clear collection'] = 'پاک کردن'; 
     25$lang['Clear'] = 'پاک کردن'; 
    2626$lang['Collection'] = 'مجموعه'; 
    2727$lang['Collection name:'] = 'نام مجموعه:'; 
  • extensions/UserCollections/language/fr_FR/plugin.lang.php

    r17914 r20090  
    2020$lang['Remove from collection'] = 'Supprimer de la collection'; 
    2121$lang['Add to collection'] = 'Ajouter à la collection'; 
    22 $lang['Clear collection'] = 'Vider'; 
     22$lang['Clear'] = 'Vider'; 
    2323$lang['You have %d collection'] = 'Vous avez %d collection'; 
    2424$lang['You have no collection'] = 'Vous n\'avez aucune collection'; 
     
    2828$lang['%d more...'] = 'et %d autres...'; 
    2929 
     30$lang['Allow users to set their collections as public'] = 'Les utilisateurs peuvent rendre leurs collections publiques'; 
     31$lang['Allow users to send their public collections by mail'] = 'Les utilisateurs peuvent envoyer leurs collections publiques par mail'; 
     32$lang['Fields'] = 'Champs'; 
     33$lang['Active'] = 'Actifs'; 
     34$lang['Inactive'] = 'Inactifs'; 
     35$lang['Generate'] = 'Générer'; 
     36$lang['Download CSV file'] = 'Télécharger le fichier CSV'; 
     37$lang['Output'] = 'Aperçu'; 
     38$lang['Number of images'] = 'Nombre d\'images'; 
     39$lang['Edit this collection'] = 'Editer celle collection'; 
     40$lang['Export image list'] = 'Exporter la liste d\'images'; 
     41$lang['Delete this collection'] = 'Supprimer la collection'; 
     42$lang['Send this collection my mail'] = 'Envoyer cette collection par mail'; 
     43$lang['Clear this collection'] = 'Vider cette collection'; 
     44$lang['Please enter your name'] = 'Veuillez entrer votre nom'; 
     45$lang['Please enter the recipient name'] = 'Veuillez entrer le nom du destinataire'; 
     46$lang['Please enter your e-mail'] = 'Veuillez entrer votre e-mail'; 
     47$lang['Please enter the recipient e-mail'] = 'Veuillez entrer l\'e-mail du destinataire'; 
     48$lang['A photo collection by %s'] = 'Une collection photo de %s'; 
     49$lang['Error while sending e-mail'] = 'Erreur lors de l\'envoi de l\'e-mail'; 
     50$lang['E-mail sent successfully'] = 'E-mail envoyé avec succès'; 
     51$lang['The collection must be public in order to send it'] = 'La collection doit être publique pour l\'envoyer'; 
     52$lang['Your name'] = 'Votre nom'; 
     53$lang['Your e-mail'] = 'Votre e-mail'; 
     54$lang['Recipient name'] = 'Nom du destinataire'; 
     55$lang['Recipient e-mail'] = 'E-mail du destinataire'; 
     56$lang['Message (optional)'] = 'Message (optionel)'; 
     57$lang['Hello <b>%s</b>, %s sent you a photos collection from <a href="%s">%s</a>'] = 'Bonjour <b>%s</b>, %s vous a envoyé une collection de photos depuis <a href="%s">%s</a>'; 
     58$lang['Click here to view the complete collection'] = 'Cliquez ici pour voir la collection complète'; 
     59 
    3060?> 
  • extensions/UserCollections/language/hu_HU/plugin.lang.php

    r17329 r20090  
    2222// +-----------------------------------------------------------------------+ 
    2323$lang['Add to collection'] = 'Gyűjteménybe'; 
    24 $lang['Clear collection'] = 'Kiürítés'; 
     24$lang['Clear'] = 'Kiürítés'; 
    2525$lang['Collection name:'] = 'Gyűjtemény neve:'; 
    2626$lang['Collection'] = 'Gyűjtemény'; 
  • extensions/UserCollections/language/it_IT/plugin.lang.php

    r16963 r20090  
    2323$lang['%d more...'] = '%d di più...'; 
    2424$lang['Add to collection'] = 'Aggiungi ad una raccolta'; 
    25 $lang['Clear collection'] = 'Cancella'; 
     25$lang['Clear'] = 'Cancella'; 
    2626$lang['Collection name:'] = 'Nome della collezione:'; 
    2727$lang['Collection'] = 'Collezione'; 
  • extensions/UserCollections/language/lv_LV/plugin.lang.php

    r16783 r20090  
    2222// +-----------------------------------------------------------------------+ 
    2323$lang['Add to collection'] = 'Pievienot kolekcijai'; 
    24 $lang['Clear collection'] = 'Tīrs'; 
     24$lang['Clear'] = 'Tīrs'; 
    2525$lang['Collection name:'] = 'Kolekcijas nosaukums:'; 
    2626$lang['Collection'] = 'Kolekcija'; 
  • extensions/UserCollections/language/nl_NL/plugin.lang.php

    r16792 r20090  
    2222// +-----------------------------------------------------------------------+ 
    2323$lang['Add to collection'] = 'Aan verzameling toevoegen'; 
    24 $lang['Clear collection'] = 'Leegmaken'; 
     24$lang['Clear'] = 'Leegmaken'; 
    2525$lang['Collection name:'] = 'Naam van verzameling'; 
    2626$lang['Collection'] = 'Verzameling'; 
  • extensions/UserCollections/language/pl_PL/plugin.lang.php

    r16770 r20090  
    2323$lang['%d more...'] = '%d więcej...'; 
    2424$lang['Add to collection'] = 'Dodaj do kolekcji'; 
    25 $lang['Clear collection'] = 'Wyczyść'; 
     25$lang['Clear'] = 'Wyczyść'; 
    2626$lang['Collection name:'] = 'Nazwa kolekcji'; 
    2727$lang['Collection'] = 'Kolekcja'; 
  • extensions/UserCollections/language/pt_BR/plugin.lang.php

    r19097 r20090  
    3030mais %d...'; 
    3131$lang['Add to collection'] = 'Adicione a coleção'; 
    32 $lang['Clear collection'] = 'Limpar'; 
     32$lang['Clear'] = 'Limpar'; 
    3333$lang['Collection'] = 'Coleção'; 
    3434$lang['Collection name:'] = 'Nome da coleção:'; 
  • extensions/UserCollections/language/pt_PT/plugin.lang.php

    r17396 r20090  
    2929$lang['%d more...'] = '%d mais'; 
    3030$lang['Add to collection'] = 'acrescentar à colecção'; 
    31 $lang['Clear collection'] = 'Limpar'; 
     31$lang['Clear'] = 'Limpar'; 
    3232$lang['Collection'] = 'Colecção'; 
    3333$lang['Collection name:'] = 'Nome da colecção'; 
  • extensions/UserCollections/language/ru_RU/plugin.lang.php

    r16771 r20090  
    2222// +-----------------------------------------------------------------------+ 
    2323$lang['Add to collection'] = 'Добавить в коллекцию'; 
    24 $lang['Clear collection'] = 'Очистить'; 
     24$lang['Clear'] = 'Очистить'; 
    2525$lang['Collection name:'] = 'Название коллекции:'; 
    2626$lang['Collection'] = 'Коллекция'; 
  • extensions/UserCollections/language/sk_SK/plugin.lang.php

    r16772 r20090  
    2222// +-----------------------------------------------------------------------+ 
    2323$lang['Add to collection'] = 'Pridať do kolekcie'; 
    24 $lang['Clear collection'] = 'Vyčistiť'; 
     24$lang['Clear'] = 'Vyčistiť'; 
    2525$lang['Collection name:'] = 'Názov kolekcie:'; 
    2626$lang['Collection'] = 'Kolekcia'; 
  • extensions/UserCollections/language/th_TH/plugin.lang.php

    r19246 r20090  
    2222// +-----------------------------------------------------------------------+ 
    2323$lang['%d more...'] = '%d เพิ่มเติม...'; 
    24 $lang['Clear collection'] = 'ล้าง'; 
     24$lang['Clear'] = 'ล้าง'; 
    2525$lang['Copied'] = 'คัดลอก'; 
    2626$lang['Public collection'] = 'สาธารณะ'; 
  • extensions/UserCollections/language/tr_TR/plugin.lang.php

    r16701 r20090  
    2222// +-----------------------------------------------------------------------+ 
    2323$lang['Add to collection'] = 'Koleksiyona ekle'; 
    24 $lang['Clear collection'] = 'Temizle'; 
     24$lang['Clear'] = 'Temizle'; 
    2525$lang['Collection name:'] = 'Koleksiyon adı:'; 
    2626$lang['Collections'] = 'Koleksiyon'; 
  • extensions/UserCollections/language/uk_UA/plugin.lang.php

    r17934 r20090  
    3030$lang['set active'] = 'встановити активним'; 
    3131$lang['Add to collection'] = 'Додати до колекції'; 
    32 $lang['Clear collection'] = 'Очистити'; 
     32$lang['Clear'] = 'Очистити'; 
    3333$lang['Collection'] = 'Колекція'; 
    3434$lang['Collection name:'] = 'Ім\'я колекції:'; 
  • extensions/UserCollections/language/zh_CN/plugin.lang.php

    r17664 r20090  
    4444$lang['Collection name:'] = '精选集名称:'; 
    4545$lang['Collection'] = '精选集'; 
    46 $lang['Clear collection'] = '清除'; 
     46$lang['Clear'] = '清除'; 
    4747$lang['Add to collection'] = '添加到精选集'; 
    4848$lang['%d more...'] = '%d 更多...'; 
  • extensions/UserCollections/main.inc.php

    r19843 r20090  
    1313global $conf, $prefixeTable; 
    1414 
    15 define('USER_COLLEC_PATH',       PHPWG_PLUGINS_PATH . 'UserCollections/'); 
     15defined('USER_COLLEC_ID') or define('USER_COLLEC_ID', basename(dirname(__FILE__))); 
     16define('USER_COLLEC_PATH',       PHPWG_PLUGINS_PATH . USER_COLLEC_ID . '/'); 
    1617define('COLLECTIONS_TABLE',      $prefixeTable.'collections'); 
    1718define('COLLECTION_IMAGES_TABLE',$prefixeTable.'collection_images'); 
    18 define('USER_COLLEC_ADMIN',      get_root_url() . 'admin.php?page=plugin-UserCollections'); 
     19define('USER_COLLEC_ADMIN',      get_root_url() . 'admin.php?page=plugin-' . USER_COLLEC_ID); 
    1920define('USER_COLLEC_PUBLIC',     get_absolute_root_url() . make_index_url(array('section' => 'collections')) . '/'); 
    2021define('USER_COLLEC_VERSION',    'auto'); 
    2122 
    22  
    2323add_event_handler('init', 'user_collections_init'); 
    2424 
    25 add_event_handler('loc_end_section_init', 'user_collections_section_init'); 
    26 add_event_handler('loc_end_index', 'user_collections_page', EVENT_HANDLER_PRIORITY_NEUTRAL-10); 
     25add_event_handler('ws_add_methods', 'user_collections_ws_add_methods'); 
    2726 
    28 add_event_handler('loc_end_index', 'user_collections_index_actions'); 
    29 add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_list', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
     27if (defined('IN_ADMIN')) 
     28{ 
     29  add_event_handler('get_admin_plugin_menu_links', 'user_collections_admin_menu'); 
     30} 
     31else 
     32{ 
     33  // collections page 
     34  add_event_handler('loc_begin_index', 'user_collections_save_pagination', EVENT_HANDLER_PRIORITY_NEUTRAL-10); 
     35  add_event_handler('loc_end_section_init', 'user_collections_section_init'); 
     36  add_event_handler('loc_end_index', 'user_collections_page', EVENT_HANDLER_PRIORITY_NEUTRAL-10); 
    3037 
    31 add_event_handler('loc_end_picture', 'user_collections_picture_page'); 
     38  // thumbnails actions 
     39  add_event_handler('loc_end_index', 'user_collections_index_actions'); 
     40  add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_list', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
    3241 
    33 add_event_handler('blockmanager_register_blocks', 'user_collections_add_menublock'); 
    34 add_event_handler('blockmanager_apply', 'user_collections_applymenu'); 
     42  // picture action 
     43  add_event_handler('loc_end_picture', 'user_collections_picture_page'); 
    3544 
     45  // menu 
     46  add_event_handler('blockmanager_register_blocks', 'user_collections_add_menublock'); 
     47  add_event_handler('blockmanager_apply', 'user_collections_applymenu'); 
     48} 
     49 
     50require(USER_COLLEC_PATH . 'include/ws_functions.inc.php'); 
    3651require(USER_COLLEC_PATH . 'include/functions.inc.php'); 
    3752require(USER_COLLEC_PATH . 'include/UserCollection.class.php'); 
     
    4459function user_collections_init() 
    4560{ 
    46   global $pwg_loaded_plugins; 
     61  global $pwg_loaded_plugins, $conf; 
    4762   
    4863  if ( 
    4964    USER_COLLEC_VERSION == 'auto' or 
    50     $pwg_loaded_plugins['UserCollections']['version'] == 'auto' or 
    51     version_compare($pwg_loaded_plugins['UserCollections']['version'], USER_COLLEC_VERSION, '<') 
     65    $pwg_loaded_plugins[USER_COLLEC_ID]['version'] == 'auto' or 
     66    version_compare($pwg_loaded_plugins[USER_COLLEC_ID]['version'], USER_COLLEC_VERSION, '<') 
    5267  ) 
    5368  { 
     
    5570    user_collections_install(); 
    5671     
    57     if ( $pwg_loaded_plugins['UserCollections']['version'] != 'auto' and USER_COLLEC_VERSION != 'auto' ) 
     72    if ( $pwg_loaded_plugins[USER_COLLEC_ID]['version'] != 'auto' and USER_COLLEC_VERSION != 'auto' ) 
    5873    { 
    5974      $query = ' 
    6075UPDATE '. PLUGINS_TABLE .' 
    6176SET version = "'. USER_COLLEC_VERSION .'" 
    62 WHERE id = "UserCollections"'; 
     77WHERE id = "'. USER_COLLEC_ID .'"'; 
    6378      pwg_query($query); 
    6479       
    65       $pwg_loaded_plugins['UserCollections']['version'] = USER_COLLEC_VERSION; 
     80      $pwg_loaded_plugins[USER_COLLEC_ID]['version'] = USER_COLLEC_VERSION; 
    6681       
    6782      if (defined('IN_ADMIN')) 
     
    7388   
    7489  load_language('plugin.lang', USER_COLLEC_PATH); 
     90   
     91  $conf['user_collections'] = unserialize($conf['user_collections']); 
     92} 
     93 
     94/** 
     95 * admin plugins menu 
     96 */ 
     97function user_collections_admin_menu($menu)  
     98{ 
     99  array_push($menu, array( 
     100    'NAME' => 'User Collections', 
     101    'URL' => USER_COLLEC_ADMIN, 
     102  )); 
     103  return $menu; 
    75104} 
    76105 
  • extensions/UserCollections/maintain.inc.php

    r17657 r20090  
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
    33 
    4 include_once(PHPWG_PLUGINS_PATH . 'UserCollections/include/install.inc.php'); 
     4defined('USER_COLLEC_ID') or define('USER_COLLEC_ID', basename(dirname(__FILE__))); 
     5include_once(PHPWG_PLUGINS_PATH . USER_COLLEC_ID . '/include/install.inc.php'); 
    56 
    67function plugin_install()  
  • extensions/UserCollections/template/edit.tpl

    r19843 r20090  
    11{combine_css path=$USER_COLLEC_PATH|@cat:"template/style.css"} 
    2 {combine_script id='jquery.zclip' path=$USER_COLLEC_PATH|@cat:"template/jquery.zclip.min.js"} 
     2{combine_script id='jquery.zclip' path=$USER_COLLEC_PATH|@cat:"template/resources/jquery.zclip.min.js"} 
    33{combine_script id='jquery.tipTip' path='themes/default/js/plugins/jquery.tipTip.minified.js'} 
    44 
     5{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} 
     6{combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"} 
     7 
    58{footer_script require='jquery'} 
    6 function bindZclip() {ldelim} 
    7   jQuery("#publicURL .button").zclip({ldelim} 
    8     path:'{$ROOT_URL}{$USER_COLLEC_PATH}template/ZeroClipboard.swf', 
    9     copy:$("#publicURL .url").html(), 
    10     afterCopy: function() {ldelim} 
    11       $('.confirm').remove(); 
    12       $("#publicURL .url").select(); 
    13       $('<span class="confirm" style="display:none;">{'Copied'|@translate}</span>').appendTo("#publicURL") 
    14         .fadeIn(400).delay(1000).fadeOut(400, function(){ldelim} $(this).remove(); }); 
    15     } 
     9{if $user_collections.allow_public} 
     10  function bindZclip() {ldelim} 
     11    jQuery("#publicURL .button").zclip({ldelim} 
     12      path:'{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/ZeroClipboard.swf', 
     13      copy:$("#publicURL .url").html(), 
     14      afterCopy: function() {ldelim} 
     15        $('.confirm').remove(); 
     16        $("#publicURL .url").select(); 
     17        $('<span class="confirm" style="display:none;">{'Copied'|@translate}</span>').appendTo("#publicURL") 
     18          .fadeIn(400).delay(1000).fadeOut(400, function(){ldelim} $(this).remove(); }); 
     19      } 
     20    }); 
     21    $("#publicURL .url").click(function() {ldelim} 
     22      $(this).select(); 
     23    }); 
     24  } 
     25 
     26  jQuery("input[name='public']").change(function() {ldelim} 
     27    jQuery("#publicURL").fadeToggle("fast"); 
     28    bindZclip(); 
    1629  }); 
    17   $("#publicURL .url").click(function() {ldelim} 
    18     $(this).select(); 
     30  jQuery("#publicURL .button").tipTip({ldelim} 
     31    delay: 0, 
     32    defaultPosition: 'right' 
    1933  }); 
    20 } 
     34  {if $collection.PUBLIC}bindZclip();{/if} 
     35{/if} 
    2136 
    22 jQuery("input[name='public']").change(function() {ldelim} 
    23   jQuery("#publicURL").fadeToggle("fast"); 
    24   bindZclip(); 
    25 }); 
    26 jQuery("#publicURL .button").tipTip({ldelim} 
    27   delay: 0, 
    28   defaultPosition: 'right' 
    29 }); 
    30  
    31 jQuery("#actions input").click(function() {ldelim} 
    32   if (confirm("{'Are you sure?'|@translate}")) {ldelim} 
    33     document.location.href = jQuery(this).data("href"); 
    34   } 
    35   return false; 
    36 }); 
    37 {if $collection.PUBLIC}bindZclip();{/if} 
     37{if $collection.PUBLIC && $user_collections.allow_mails} 
     38  $(window).load(function(){ldelim} 
     39    $(".mail_colorbox_open").colorbox({ldelim} 
     40      {if isset($uc_mail_errors)}open: true, transition:"none",{/if} 
     41      inline:true 
     42    }); 
     43    $(".mail_colorbox_close").click(function() {ldelim} 
     44      $(".mail_colorbox_open").colorbox.close(); 
     45      return false; 
     46    }) 
     47  }); 
     48  $("#mail_form").css('background-color', $("#the_page #content").css('background-color')); 
     49{/if} 
    3850{/footer_script} 
    3951 
     
    5668 
    5769{if $collection} 
     70{* <!-- edit collection -->*} 
    5871<form action="{$F_ACTION}" method="post"> 
    5972<fieldset id="colProperties"> 
     
    6174   
    6275  <p class="title"><label for="name">{'Name'|@translate}</label></p> 
    63   <p><input type="text" name="name" id="name" value="{$collection.NAME}" size="60"></p> 
     76  <p><input type="text" name="name" id="name" value="{$collection.NAME|escape:html}" size="60"></p> 
     77{if $user_collections.allow_public} 
    6478  <p class="title">{'Public collection'|@translate}</p> 
    6579  <p> 
     
    6882    <span id="publicURL" {if not $collection.PUBLIC}style="display:none;"{/if}><span class="button" title="{'Copy to clipboard'|@translate}">&nbsp;</span><input type="text" class="url" value="{$collection.U_PUBLIC}" size="{$collection.U_PUBLIC|strlen}"></span> 
    6983  </p> 
     84{/if} 
    7085  <p> 
    7186    <input type="submit" name="save_col" value="{'Save'|@translate}"> 
     
    7590</form> 
    7691 
     92{* <!-- send collection by mail -->*} 
     93{if $user_collections.allow_public && $user_collections.allow_mails} 
     94<div style="display:none;"> 
     95  <form id="mail_form" action="{$F_ACTION}" method="post"> 
     96  {if isset($uc_mail_errors)} 
     97    {assign var=errors value=$uc_mail_errors} 
     98    {include file='infos_errors.tpl'} 
     99  {/if} 
    77100 
    78 <form id="actions" style="text-align:center;"> 
    79 <input type="submit" data-href="{$collection.U_CLEAR}" value="{'Clear collection'|@translate}"> 
    80 <input type="submit" data-href="{$collection.U_DELETE}" value="{'Delete'|@translate}"> 
    81 </form> 
     101    <table> 
     102      <tr> 
     103        <td class="title"><label for="sender_name">{'Your name'|@translate}</label></td> 
     104        <td> 
     105          <input type="text" name="sender_name" id="sender_name" size="40" value="{$contact.sender_name}"> 
     106        </td> 
     107      </tr> 
     108      <tr> 
     109        <td class="title"><label for="sender_email">{'Your e-mail'|@translate}</label></td> 
     110        <td> 
     111          <input type="text" name="sender_email" id="sender_email" size="40" value="{$contact.sender_email}"> 
     112        </td> 
     113      </tr> 
     114      <tr> 
     115        <td class="title"><label for="recipient_name">{'Recipient name'|@translate}</label></td> 
     116        <td> 
     117          <input type="text" name="recipient_name" id="recipient_name" size="40" value="{$contact.recipient_name}"> 
     118        </td> 
     119      </tr> 
     120      <tr> 
     121        <td class="title"><label for="recipient_email">{'Recipient e-mail'|@translate}</label></td> 
     122        <td> 
     123          <input type="text" name="recipient_email" id="recipient_email" size="40" value="{$contact.recipient_email}"> 
     124        </td> 
     125      </tr> 
     126      <tr> 
     127        <td class="title"><label for="nb_images">{'Number of images'|@translate}</label></td> 
     128        <td> 
     129          <select name="nb_images"> 
     130            <option value="2" {if $contact.nb_images==2}selected="selected"{/if}>2</option> 
     131            <option value="4" {if $contact.nb_images==4}selected="selected"{/if}>4</option> 
     132            <option value="8" {if $contact.nb_images==8}selected="selected"{/if}>8</option> 
     133          </select> 
     134        </td> 
     135      </tr> 
     136      <tr> 
     137        <td class="title"><label for="message">{'Message (optional)'|@translate}</label></td> 
     138        <td><textarea name="message" id="message" rows="6" style="width:350px;">{$contact.message}</textarea></td> 
     139      </tr> 
     140      <tr> 
     141        <td class="title">&nbsp;</td> 
     142        <td> 
     143          <input class="submit" type="submit" name="send_mail" value="{'Send'|@translate}"> 
     144          <a class="mail_colorbox_close" href="#">{'Cancel'|@translate}</a> 
     145          <input type="hidden" name="key" value="{$contact.KEY}" /> 
     146        </td> 
     147      </tr> 
     148    </table> 
     149  </form> 
     150</div> 
     151{/if} 
    82152 
    83  
     153{* <!-- collection content -->*} 
    84154{if $collection.NB_IMAGES > 0} 
    85155<ul class="thumbnails" id="thumbnails"> 
  • extensions/UserCollections/template/style.css

    r17914 r20090  
    2929  #publicURL .button { 
    3030    display:inline-block; 
    31     background:#e7e7e7 url('link.png') center center no-repeat; 
     31    background:#e7e7e7 url('resources/link.png') center center no-repeat; 
    3232    width:25px; 
    3333    height:20px; 
     
    7373    } 
    7474   
     75/* SEND BY MAIL */ 
     76#mail_form { 
     77  width:540px; 
     78  padding:10px; 
     79} 
     80  #mail_form table td { 
     81    padding-bottom:5px; 
     82    text-align:left; 
     83  } 
     84  #mail_form table td.title { 
     85    font-weight:bold; 
     86    text-align:right !important; 
     87    padding-top:3px; 
     88    vertical-align:top; 
     89    width:120px; 
     90  } 
     91  #mail_form input[type="text"], #mail_form textarea, #mail_form select { 
     92    border-radius:2px; 
     93    padding:3px; 
     94  } 
    7595   
    7696/* TipTip CSS - Version 1.2 */ 
  • extensions/UserCollections/template/themes/default.tpl

    r17493 r20090  
    44 
    55<div class="titrePage"> 
     6        <ul class="categoryActions"> 
     7  {if !empty($image_derivatives)} 
     8                <li>{strip}<a id="derivativeSwitchLink" title="{'Photo sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> 
     9                        <span class="pwg-icon pwg-icon-sizes">&nbsp;</span><span class="pwg-button-text">{'Photo sizes'|@translate}</span> 
     10                </a> 
     11                <div id="derivativeSwitchBox" class="switchBox"> 
     12                        <div class="switchBoxTitle">{'Photo sizes'|@translate}</div> 
     13                        {foreach from=$image_derivatives item=image_derivative name=loop}{if !$smarty.foreach.loop.first}<br>{/if} 
     14                        {if $image_derivative.SELECTED} 
     15                        <span>&#x2714; </span>{$image_derivative.DISPLAY} 
     16                        {else} 
     17                        <span style="visibility:hidden">&#x2714; </span><a href="{$image_derivative.URL}" rel="nofollow">{$image_derivative.DISPLAY}</a> 
     18                        {/if} 
     19                        {/foreach} 
     20                </div> 
     21                {footer_script require='jquery'}{literal} 
     22    jQuery("#derivativeSwitchLink").click(function() { 
     23      var elt = jQuery("#derivativeSwitchBox"); 
     24      elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5)) 
     25        .css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true)) 
     26        .toggle(); 
     27    }); 
     28    jQuery("#derivativeSwitchBox").on("mouseleave", function() { 
     29      jQuery(this).hide(); 
     30    }); 
     31                {/literal}{/footer_script} 
     32                {/strip}</li> 
     33  {/if} 
     34 
    635  {if !empty($COLLECTION_ACTIONS)} 
    7         <ul class="categoryActions"> 
    836    {$COLLECTION_ACTIONS} 
     37  {/if} 
    938        </ul> 
    10   {/if} 
    1139 
    1240  <h2>{$TITLE}</h2> 
  • extensions/UserCollections/template/thumbnails.tpl

    r16688 r20090  
    11{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} 
    22{combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"} 
     3 
    34{footer_script} 
    45jQuery("a.preview-box").colorbox({ldelim} 
  • extensions/UserCollections/template/thumbnails_css_js.tpl

    r17178 r20090  
    1717  }).done(function(msg) {ldelim} 
    1818    if (msg == "true") {ldelim} 
    19       $trigger.html('{'Remove from collection'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_delete.png" title="{'Remove from collection'|@translate}">'); 
     19      $trigger.html('{'Remove from collection'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/image_delete.png" title="{'Remove from collection'|@translate}">'); 
    2020      jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) +1); 
    2121    } else if (msg == "false") {ldelim} 
     
    2424      if (typeof batchdown_count != 'undefined') batchdown_count-=1; 
    2525    {else} 
    26       $trigger.html('{'Add to collection'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_add.png" title="{'Add to collection'|@translate}">'); 
     26      $trigger.html('{'Add to collection'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/image_add.png" title="{'Add to collection'|@translate}">'); 
    2727    {/if} 
    2828      jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) -1); 
Note: See TracChangeset for help on using the changeset viewer.