Changeset 2325
- Timestamp:
- May 2, 2008, 11:56:21 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r2299 r2325 52 52 'rate_anonymous', 53 53 'email_admin_on_new_user', 54 'email_admin_on_picture_uploaded',55 54 ); 56 55 … … 59 58 'history_admin', 60 59 'history_guest' 60 ); 61 62 $upload_checkboxes = array( 63 'upload_link_everytime', 64 'email_admin_on_picture_uploaded', 61 65 ); 62 66 … … 106 110 } 107 111 foreach( $comments_checkboxes as $checkbox) 112 { 113 $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; 114 } 115 break; 116 } 117 case 'upload' : 118 { 119 foreach( $upload_checkboxes as $checkbox) 108 120 { 109 121 $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; … … 161 173 $tabsheet->add('history', l10n('conf_history_title'), $conf_link.'history'); 162 174 $tabsheet->add('comments', l10n('conf_comments_title'), $conf_link.'comments'); 175 $tabsheet->add('upload', l10n('conf_upload_title'), $conf_link.'upload'); 163 176 $tabsheet->add('default', l10n('conf_display'), $conf_link.'default'); 164 177 // TabSheet selection … … 188 201 )); 189 202 190 foreach ($main_checkboxes as $checkbox)203 foreach ($main_checkboxes as $checkbox) 191 204 { 192 205 $template->append( … … 203 216 { 204 217 //Necessary for merge_block_vars 205 foreach ($history_checkboxes as $checkbox)218 foreach ($history_checkboxes as $checkbox) 206 219 { 207 220 $template->append( … … 223 236 )); 224 237 225 foreach ($comments_checkboxes as $checkbox)238 foreach ($comments_checkboxes as $checkbox) 226 239 { 227 240 $template->append( … … 235 248 break; 236 249 } 250 case 'upload' : 251 { 252 $template->assign( 253 'upload', 254 array( 255 'upload_user_access_options'=> get_user_access_level_html_options(ACCESS_GUEST), 256 'upload_user_access_options_selected' => array($conf['upload_user_access']) 257 ) 258 ); 259 //Necessary for merge_block_vars 260 foreach ($upload_checkboxes as $checkbox) 261 { 262 $template->append( 263 'upload', 264 array( 265 $checkbox => $conf[$checkbox] 266 ), 267 true 268 ); 269 } 270 break; 271 } 237 272 case 'default' : 238 273 { -
trunk/admin/include/functions.php
r2324 r2325 1838 1838 return $query; 1839 1839 } 1840 1841 /** 1842 * Returns array use on template with html_options method 1843 * @param Min and Max access to use 1844 * @return array of user access level 1845 */ 1846 function get_user_access_level_html_options($MinLevelAccess = ACCESS_FREE, $MaxLevelAccess = ACCESS_CLOSED) 1847 { 1848 $tpl_options = array(); 1849 for ($level = $MinLevelAccess; $level <= $MaxLevelAccess; $level++) 1850 { 1851 $tpl_options[$level] = l10n(sprintf('ACCESS_%d', $level)); 1852 } 1853 return $tpl_options; 1854 } 1855 1840 1856 ?> -
trunk/identification.php
r2299 r2325 29 29 // | Check Access and exit when user status is not ok | 30 30 // +-----------------------------------------------------------------------+ 31 check_status(ACCESS_ NONE);31 check_status(ACCESS_FREE); 32 32 33 33 //-------------------------------------------------------------- identification -
trunk/include/constants.php
r2299 r2325 37 37 38 38 // Access codes 39 define('ACCESS_ NONE', 0);39 define('ACCESS_FREE', 0); 40 40 define('ACCESS_GUEST', 1); 41 41 define('ACCESS_CLASSIC', 2); 42 42 define('ACCESS_ADMINISTRATOR', 3); 43 43 define('ACCESS_WEBMASTER', 4); 44 define('ACCESS_CLOSED', 5); 44 45 45 46 // Table names -
trunk/include/functions_category.inc.php
r2299 r2325 453 453 } 454 454 455 /** 456 * returns the link of upload menu 457 * 458 * @param null 459 * @return string or null 460 */ 461 function get_upload_menu_link() 462 { 463 global $conf, $page, $user; 464 465 $show_link = false; 466 $arg_link = null; 467 468 if (is_autorize_status($conf['upload_user_access'])) 469 { 470 if (isset($page['category']) and $page['category']['uploadable'] ) 471 { 472 // upload a picture in the category 473 $show_link = true; 474 $arg_link = 'cat='.$page['category']['id']; 475 } 476 else 477 if ($conf['upload_link_everytime']) 478 { 479 // upload a picture in the category 480 $query = ' 481 SELECT 482 1 483 FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' 484 ON id = cat_id and user_id = '.$user['id'].' 485 WHERE 486 uploadable = \'true\' 487 '.get_sql_condition_FandF 488 ( 489 array 490 ( 491 'visible_categories' => 'id', 492 ), 493 'AND' 494 ).' 495 LIMIT 1'; 496 497 $show_link = mysql_num_rows(pwg_query($query)) <> 0; 498 } 499 } 500 if ($show_link) 501 { 502 return get_root_url().'upload.php'.(empty($arg_link) ? '' : '?'.$arg_link); 503 } 504 else 505 { 506 return; 507 } 508 } 509 455 510 ?> -
trunk/include/functions_user.inc.php
r2324 r2325 1089 1089 1090 1090 /* 1091 * Return access_type definition of u user1091 * Return access_type definition of user 1092 1092 * Test does with user status 1093 1093 * @return bool … … 1102 1102 { 1103 1103 $access_type_status = 1104 ($conf['guest_access'] ? ACCESS_GUEST : ACCESS_ NONE);1104 ($conf['guest_access'] ? ACCESS_GUEST : ACCESS_FREE); 1105 1105 break; 1106 1106 } … … 1127 1127 default: 1128 1128 { 1129 $access_type_status = ACCESS_ NONE;1129 $access_type_status = ACCESS_FREE; 1130 1130 break; 1131 1131 } -
trunk/include/menubar.inc.php
r2299 r2325 40 40 'U_CATEGORIES' => make_index_url(array('section' => 'categories')), 41 41 'U_LOST_PASSWORD' => get_root_url().'password.php', 42 'U_UPLOAD' => get_upload_menu_link() 42 43 ) 43 44 ); … … 305 306 ); 306 307 307 if (isset($page['category']) and $page['category']['uploadable'] )308 { // upload a picture in the category309 $url = get_root_url().'upload.php?cat='.$page['category']['id'];310 $template->assign('U_UPLOAD', $url);311 }312 313 308 trigger_action('loc_end_menubar'); 314 309 $template->assign_var_from_handle('MENUBAR', 'menubar'); 310 315 311 ?> -
trunk/install/config.sql
r2208 r2325 26 26 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('obligatory_user_mail_address','false','Mail address is obligatory for users'); 27 27 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('c13y_ignore',null,'List of ignored anomalies'); 28 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_link_everytime','false','Show upload link every time'); 29 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_user_access',2 /*ACCESS_CLASSIC*/,'User access level to upload'); -
trunk/language/en_UK/admin.lang.php
r2305 r2325 635 635 // --------- Starting below: New or revised $lang ---- from Butterfly (1.8) 636 636 $lang['Purge compiled templates'] = 'Purge compiled templates'; 637 /* TODO */ $lang['Caddie is currently empty'] = 'Caddie is currently empty'; 637 $lang['Caddie is currently empty'] = 'Caddie is currently empty'; 638 $lang['conf_upload_title'] = 'Upload'; 639 $lang['Show upload link every time'] = 'Show upload link every time'; 640 $lang['User access level to upload'] = 'User access level to upload'; 641 $lang['ACCESS_0'] = 'Free access'; 642 $lang['ACCESS_1'] = 'Access to all'; 643 $lang['ACCESS_2'] = 'Access to subscribed'; 644 $lang['ACCESS_3'] = 'Access to administrators'; 645 $lang['ACCESS_4'] = 'Access to webmasters'; 646 $lang['ACCESS_5'] = 'No access'; 647 638 648 ?> -
trunk/language/en_UK/common.lang.php
r2299 r2325 307 307 $lang['update_rate'] = 'Update your rating'; 308 308 $lang['update_wrong_dirname'] = 'wrong filename'; 309 $lang['upload_advise'] = 'Choose an image to place in the category : ';310 309 $lang['upload_advise_filesize'] = 'the filesize of the picture must not exceed : '; 311 310 $lang['upload_advise_filetype'] = 'the picture must be to the fileformat jpg, gif or png'; … … 365 364 $lang['See elements linked to this tag only'] = 'See images linked to this tag only'; 366 365 $lang['elements posted during the last %d days'] = 'images posted during the last %d days'; 366 $lang['Choose an image'] = 'Choose an image'; 367 367 368 ?> -
trunk/language/en_UK/help/configuration.html
r2048 r2325 34 34 35 35 <li><strong>Email admins when a new user registers</strong>: Administrators will be received mail for each registration.</li> 36 37 <li><strong>Email adminis when a picture is uploaded</strong>: Administrators will be received mail for each picture uploaded by a user.</li>38 36 39 37 </ul> … … 77 75 User comments validation takes place in the screen <span class="pwgScreen">Administration, Pictures, Comments</span>.</li> 78 76 77 </ul> 78 79 <!--TODO --><h3>Upload</h3> 80 <ul> 81 <!--TODO --> <li><strong>Show upload link every time</strong>: If exists uploadeable categories, add link will be show for each categoy.</li> 82 <!--TODO --> <li><strong>User access level to upload</strong>: Allows to restrict upload by users</li> 83 <li><strong>Email adminis when a picture is uploaded</strong>: Administrators will be received mail for each picture uploaded by a user.</li> 79 84 </ul> 80 85 -
trunk/language/es_ES/admin.lang.php
r2305 r2325 640 640 // --------- Starting below: New or revised $lang ---- from Butterfly (1.8) 641 641 $lang['Purge compiled templates'] = 'Purgar el templates compilado'; 642 $lang['Caddie is currently empty'] = 'Caddie is currently empty'; 642 /* TODO */ $lang['Caddie is currently empty'] = 'Caddie is currently empty'; 643 /* TODO */ $lang['conf_upload_title'] = 'Upload'; 644 /* TODO */ $lang['Show upload link every time'] = 'Show upload link every time'; 645 /* TODO */ $lang['User access level to upload'] = 'User access level to upload'; 646 /* TODO */ $lang['ACCESS_0'] = 'Free access'; 647 /* TODO */ $lang['ACCESS_1'] = 'Access to all'; 648 /* TODO */ $lang['ACCESS_2'] = 'Access to subscribed'; 649 /* TODO */ $lang['ACCESS_3'] = 'Access to administrators'; 650 /* TODO */ $lang['ACCESS_4'] = 'Access to webmasters'; 651 /* TODO */ $lang['ACCESS_5'] = 'No access'; 652 643 653 ?> -
trunk/language/es_ES/common.lang.php
r2300 r2325 307 307 $lang['update_rate'] = 'Actualizar nota'; 308 308 $lang['update_wrong_dirname'] = 'Mal nombre de repertorio'; 309 $lang['upload_advise'] = 'Elegir una imagen para agregar en esta categoría : ';310 309 $lang['upload_advise_filesize'] = 'El peso de la imagen debe sobrepasar : '; 311 310 $lang['upload_advise_filetype'] = 'El tamaño de la imagen debe ser jpg, png ou gif'; … … 365 364 $lang['See elements linked to this tag only'] = 'Ver las imágenes relacionadas únicamente a este tag'; 366 365 $lang['elements posted during the last %d days'] = 'esta imagen tiene menos de %d dias'; 366 $lang['Choose an image'] = 'Elegir una imagen'; 367 367 368 ?> -
trunk/language/es_ES/help/configuration.html
r2145 r2325 24 24 25 25 <li><strong>Permitir el registro de los utilizadores</strong>: La inscripción es libre para ellos todos.</li> 26 27 <li><strong>Notificar a los administradores cuando una imagen es cargada</strong>: Los administradores recibirán un courriel a cada imagen puesto en disposición por un utilizador.</li>28 26 29 27 </ul> … … 63 61 </ul> 64 62 63 <!--TODO --><h3>Upload</h3> 64 <ul> 65 <!--TODO --> <li><strong>Show upload link every time</strong>: If exists uploadeable categories, add link will be show for each categoy.</li> 66 <!--TODO --> <li><strong>User access level to upload</strong>: Allows to restrict upload by users</li> 67 <li><strong>Notificar a los administradores cuando una imagen es cargada</strong>: Los administradores recibirán un courriel a cada imagen puesto en disposición por un utilizador.</li> 68 </ul> 69 65 70 <h3>Fijación por defecto</h3> 66 71 <p>Modificar las opciones de fijación por defecto: para los visitadores no conectados. Una vez conectado, estas opciones son sobrecargadas por las del utilizador, a las que puede modificar en la pantalla <span -
trunk/language/fr_FR/admin.lang.php
r2320 r2325 636 636 $lang['Purge compiled templates'] = 'Purger les templates compilés'; 637 637 $lang['Caddie is currently empty'] = 'Le panier est actuellement vide.'; 638 $lang['conf_upload_title'] = 'Téléchargement'; 639 $lang['Show upload link every time'] = 'Afficher le lien d\'ajout d\'image tout le temps'; 640 $lang['User access level to upload'] = 'Niveau d\'accès utilisateur pour télécharger'; 641 $lang['ACCESS_0'] = 'Accès libre'; 642 $lang['ACCESS_1'] = 'Accès à tous'; 643 $lang['ACCESS_2'] = 'Accès aux inscrits'; 644 $lang['ACCESS_3'] = 'Accès aux administrateurs'; 645 $lang['ACCESS_4'] = 'Accès aux webmestres'; 646 $lang['ACCESS_5'] = 'Pas d\'accès'; 647 638 648 ?> -
trunk/language/fr_FR/common.lang.php
r2299 r2325 307 307 $lang['update_rate'] = 'Mettre à jour votre note'; 308 308 $lang['update_wrong_dirname'] = 'mauvais nom de répertoire'; 309 $lang['upload_advise'] = 'Choisir une image à ajouter dans cette catégorie : ';310 309 $lang['upload_advise_filesize'] = 'le poids de l\'image ne doit dépasser : '; 311 310 $lang['upload_advise_filetype'] = 'le format de l\'image doit être jpg, png ou gif'; … … 365 364 $lang['See elements linked to this tag only'] = 'Voir les images liées uniquement à ce tag'; 366 365 $lang['elements posted during the last %d days'] = 'images ajoutées au cours de %d derniers jours'; 366 $lang['Choose an image'] = 'Choisir une image à ajouter'; 367 367 368 ?> -
trunk/language/fr_FR/help/configuration.html
r2130 r2325 34 34 35 35 <li><strong>Notifier les administrateurs lors de l'inscription d'un utilisateur</strong>: Les administrateurs recevront un courriel à chaque inscription.</li> 36 37 <li><strong>Notifier les administrateurs quand une image est téléchargée</strong>: Les administrateurs recevront un courriel à chaque image mis à disposition par un utilisateur.</li>38 36 39 37 </ul> … … 77 75 La validation des commentaires utilisateurs a lieu dans l'écran <span class="pwgScreen">Administration, Images, Commentaires</span>.</li> 78 76 77 </ul> 78 79 <h3>Téléchargement</h3> 80 <ul> 81 <li><strong>Afficher le lien d'ajout d'image tout le temps</strong>: S'il existe des catégories permettant le téléchargement, le lien d'ajout d'image sera affiché quelque soit la catégorie.</li> 82 <li><strong>Niveau d'accès utilisateur pour télécharger</strong>: Permet de restreindre l'ajout à certains utilisateurs</li> 83 <li><strong>Notifier les administrateurs quand une image est téléchargée</strong>: Les administrateurs recevront un courriel à chaque image mis à disposition par un utilisateur.</li> 79 84 </ul> 80 85 -
trunk/language/nl_NL/admin.lang.php
r2305 r2325 644 644 /* TODO */ $lang['Purge compiled templates'] = 'Purge compiled templates'; 645 645 /* TODO */ $lang['Caddie is currently empty'] = 'Caddie is currently empty'; 646 /* TODO */ $lang['conf_upload_title'] = 'Upload'; 647 /* TODO */ $lang['Show upload link every time'] = 'Show upload link every time'; 648 /* TODO */ $lang['User access level to upload'] = 'User access level to upload'; 649 /* TODO */ $lang['ACCESS_0'] = 'Free access'; 650 /* TODO */ $lang['ACCESS_1'] = 'Access to all'; 651 /* TODO */ $lang['ACCESS_2'] = 'Access to subscribed'; 652 /* TODO */ $lang['ACCESS_3'] = 'Access to administrators'; 653 /* TODO */ $lang['ACCESS_4'] = 'Access to webmasters'; 654 /* TODO */ $lang['ACCESS_5'] = 'No access'; 655 646 656 ?> -
trunk/language/nl_NL/common.lang.php
r2299 r2325 307 307 $lang['update_rate'] = 'Werk je beoordeling bij'; 308 308 $lang['update_wrong_dirname'] = 'verkeerde bestandsnaam'; 309 $lang['upload_advise'] = 'Kies een afbeelding om in een categorie te plaatsen : ';310 309 $lang['upload_advise_filesize'] = 'het bestandsformaat mag niet te groot zijn : '; 311 310 $lang['upload_advise_filetype'] = 'de afbeelding moet een extensie hebbben die eindigt op jpg, gif of png'; … … 365 364 $lang['See elements linked to this tag only'] = 'Toon afbeelding gelinkt met deze tag'; 366 365 $lang['elements posted during the last %d days'] = 'afbeelding binnen de %d dagen'; 366 $lang['Choose an image'] = 'Kies een afbeelding om'; 367 367 368 ?> -
trunk/language/nl_NL/help/configuration.html
r2171 r2325 27 27 28 28 <li><strong>Email admins wanneer een nieuwe gebruiker zich registreerd</strong>: Administrators ontvangen een mailtje bij elke registratie.</li> 29 30 <li><strong>Email admins wanneer een afbeelding is ge-upload</strong>: Administrators ontvangen een mailtje voor elke ge-uploade bestand door gebruikers.</li>31 29 32 30 </ul> … … 65 63 </ul> 66 64 65 <!--TODO --><h3>Upload</h3> 66 <ul> 67 <!--TODO --> <li><strong>Show upload link every time</strong>: If exists uploadeable categories, add link will be show for each categoy.</li> 68 <!--TODO --> <li><strong>User access level to upload</strong>: Allows to restrict upload by users</li> 69 <li><strong>Email admins wanneer een afbeelding is ge-upload</strong>: Administrators ontvangen een mailtje voor elke ge-uploade bestand door gebruikers.</li> 70 </ul> 71 67 72 <h3>Standaard weergave</h3> 68 73 -
trunk/nbm.php
r2299 r2325 26 26 define('PHPWG_ROOT_PATH','./'); 27 27 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 28 check_status(ACCESS_ NONE);28 check_status(ACCESS_FREE); 29 29 include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php'); 30 30 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); -
trunk/password.php
r2299 r2325 33 33 // | Check Access and exit when user status is not ok | 34 34 // +-----------------------------------------------------------------------+ 35 check_status(ACCESS_ NONE);35 check_status(ACCESS_FREE); 36 36 37 37 // +-----------------------------------------------------------------------+ -
trunk/register.php
r2299 r2325 29 29 // | Check Access and exit when user status is not ok | 30 30 // +-----------------------------------------------------------------------+ 31 check_status(ACCESS_ NONE);31 check_status(ACCESS_FREE); 32 32 33 33 //----------------------------------------------------------- user registration -
trunk/search_rules.php
r2299 r2325 40 40 define('PHPWG_ROOT_PATH','./'); 41 41 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 42 check_status(ACCESS_ NONE);42 check_status(ACCESS_FREE); 43 43 include_once( PHPWG_ROOT_PATH.'include/functions_search.inc.php' ); 44 44 -
trunk/template/yoga/admin/configuration.tpl
r2249 r2325 80 80 </label> 81 81 </li> 82 83 <li>84 <label>85 <span class="property">{'Email administrators when a picture is uploaded'|@translate}</span>86 <input type="checkbox" name="email_admin_on_picture_uploaded" {if ($main.email_admin_on_picture_uploaded)}checked="checked"{/if} />87 </label>88 </li>89 82 </ul> 90 83 </fieldset> … … 153 146 {/if} 154 147 148 {if isset($upload)} 149 <fieldset id="uploadConf"> 150 <ul> 151 <li> 152 <label><span class="property">{'Show upload link every time'|@translate}</span> 153 <input type="checkbox" name="upload_link_everytime" {if ($upload.upload_link_everytime)}checked="checked"{/if} /></label> 154 </li> 155 <li> 156 <label><span class="property">{'User access level to upload'|@translate}</span> 157 {html_options name="upload_user_access" options=$upload.upload_user_access_options selected=$upload.upload_user_access_options_selected} 158 </li> 159 <li> 160 <label> 161 <span class="property">{'Email administrators when a picture is uploaded'|@translate}</span> 162 <input type="checkbox" name="email_admin_on_picture_uploaded" {if ($upload.email_admin_on_picture_uploaded)}checked="checked"{/if} /> 163 </label> 164 </li> 165 </ul> 166 </fieldset> 167 {/if} 168 155 169 {if isset($default)} 156 170 {$PROFILE_CONTENT} -
trunk/template/yoga/admin/default-layout.css
r2285 r2325 100 100 FIELDSET#mainConfCheck SPAN.property, 101 101 FIELDSET#historyConf SPAN.property, 102 FIELDSET#commentsConf SPAN.property { 102 FIELDSET#commentsConf SPAN.property, 103 FIELDSET#uploadConf SPAN.property { 103 104 float: right; 104 105 text-align: left; … … 106 107 FIELDSET#mainConfCheck INPUT, 107 108 FIELDSET#historyConf INPUT, 108 FIELDSET#commentsConf INPUT { 109 FIELDSET#commentsConf INPUT, 110 FIELDSET#uploadConf INPUT { 109 111 float: none; 110 112 } … … 122 124 } 123 125 FIELDSET#mainConfCheck INPUT, 124 FIELDSET#historyConf INPUT { 126 FIELDSET#historyConf INPUT, 127 FIELDSET#commentsConf INPUT, 128 FIELDSET#uploadConf SELECT, 129 FIELDSET#uploadConf INPUT { 125 130 margin-left: 5%; 126 131 } … … 129 134 width: 85%; 130 135 } 131 FIELDSET#commentsConf INPUT { 132 margin-left: 5%; 136 137 FIELDSET#uploadConf SPAN.property { 138 width: 75%; 133 139 } 134 140 -
trunk/template/yoga/admin/picture_modify.tpl
r2294 r2325 116 116 </tr> 117 117 118 119 120 121 122 123 124 125 118 <tr> 119 <td><strong>{'Minimum privacy level'|@translate}</strong></td> 120 <td> 121 <select name="level" size="1"> 122 {html_options options=$level_options selected=$level_options_selected} 123 </select> 124 </td> 125 </tr> 126 126 127 127 </table> -
trunk/template/yoga/menubar.tpl
r2288 r2325 4 4 {if not empty($links)} 5 5 <dl id="mbLinks"> 6 7 8 9 10 11 12 13 14 15 16 17 18 19 6 <dt>{'Links'|@translate}</dt> 7 <dd> 8 <ul> 9 {foreach from=$links item=link} 10 <li> 11 <a href="{$link.URL}" 12 {if isset($link.new_window) }onclick="window.open(this.href, '{$link.new_window.NAME|@escape:'javascript'}','{$link.new_window.FEATURES|@escape:'javascript'}'); return false;"{/if} 13 > 14 {$link.LABEL} 15 </a> 16 </li> 17 {/foreach}{*links*} 18 </ul> 19 </dd> 20 20 </dl> 21 21 {/if}{*links*} … … 29 29 30 30 <dl id="mbCategories"> 31 32 33 31 <dt><a href="{$U_CATEGORIES}">{'Categories'|@translate}</a></dt> 32 <dd> 33 {$MENU_CATEGORIES_CONTENT} 34 34 {if isset($U_UPLOAD)} 35 35 <ul><li> … … 37 37 </li></ul> 38 38 {/if} 39 39 <p class="totalImages">{$pwg->l10n_dec('%d element', '%d elements', $NB_PICTURE)}</p> 40 40 </dd> 41 41 </dl> … … 44 44 {if not empty($related_tags)} 45 45 <dl id="mbTags"> 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 46 <dt>{'Related tags'|@translate}</dt> 47 <dd> 48 <ul id="menuTagCloud"> 49 {foreach from=$related_tags item=tag} 50 <li> 51 {if !empty($tag.add) } 52 <a href="{$tag.add.URL}" 53 title="{$pwg->l10n_dec('%d element are also linked to current tags', '%d elements are also linked to current tags', $tag.add.COUNTER)}" 54 rel="nofollow"> 55 <img src="{$ROOT_URL}{$themeconf.icon_dir}/add_tag.png" alt="+" /> 56 </a> 57 {/if} 58 <a href="{$tag.U_TAG}" class="{$tag.CLASS}" title="{'See elements linked to this tag only'|@translate}">{$tag.NAME}</a> 59 </li> 60 {/foreach} 61 </ul> 62 </dd> 63 63 </dl> 64 64 {/if} … … 66 66 67 67 <dl id="mbSpecial"> 68 69 70 71 72 73 74 75 68 <dt>{'special_categories'|@translate}</dt> 69 <dd> 70 <ul> 71 {foreach from=$special_categories item=cat} 72 <li><a href="{$cat.URL}" title="{$cat.TITLE}" {if isset($cat.REL)}{$cat.REL}{/if}>{$cat.NAME}</a></li> 73 {/foreach} 74 </ul> 75 </dd> 76 76 </dl> 77 77 78 78 79 79 <dl id="mbMenu"> 80 81 82 83 84 85 86 87 80 <dt>{'title_menu'|@translate}</dt> 81 <dd> 82 <form action="{$ROOT_URL}qsearch.php" method="get" id="quicksearch"> 83 <p> 84 <input type="text" name="q" id="qsearchInput" onfocus="if (value==qsearch_prompt) value='';" onblur="if (value=='') value=qsearch_prompt;" /> 85 </p> 86 </form> 87 <script type="text/javascript">var qsearch_prompt="{'qsearch'|@translate|@escape:'javascript'}"; document.getElementById('qsearchInput').value=qsearch_prompt;</script> 88 88 89 90 91 92 93 94 89 <ul> 90 {foreach from=$summaries item=sum} 91 <li><a href="{$sum.U_SUMMARY}" title="{$sum.TITLE}" {if isset($sum.REL)}{$sum.REL}{/if}>{$sum.NAME}</a></li> 92 {/foreach} 93 </ul> 94 </dd> 95 95 </dl> 96 96 97 97 98 98 <dl id="mbIdentification"> 99 100 99 <dt>{'identification'|@translate}</dt> 100 <dd> 101 101 {if isset($USERNAME)} 102 102 <p>{'hello'|@translate} {$USERNAME} !</p> 103 103 {/if} 104 104 105 106 107 108 105 <ul> 106 {if isset($U_REGISTER)} 107 <li><a href="{$U_REGISTER}" title="{'Create a new account'|@translate}" rel="nofollow">{'Register'|@translate}</a></li> 108 {/if} 109 109 110 111 112 110 {if isset($U_IDENTIFY)} 111 <li><a href="{$U_IDENTIFY}" rel="nofollow">{'Connection'|@translate}</a></li> 112 {/if} 113 113 114 115 116 114 {if isset($U_LOGOUT)} 115 <li><a href="{$U_LOGOUT}">{'logout'|@translate}</a></li> 116 {/if} 117 117 118 119 120 118 {if isset($U_PROFILE)} 119 <li><a href="{$U_PROFILE}" title="{'hint_customize'|@translate}">{'customize'|@translate}</a></li> 120 {/if} 121 121 122 123 124 125 126 127 128 129 130 122 {if isset($U_ADMIN)} 123 <li><a href="{$U_ADMIN}" title="{'hint_admin'|@translate}">{'admin'|@translate}</a></li> 124 {/if} 125 </ul> 126 127 {if isset($U_IDENTIFY)} 128 <form method="post" action="{$U_IDENTIFY}" class="filter" id="quickconnect"> 129 <fieldset> 130 <legend>{'Quick connect'|@translate}</legend> 131 131 132 133 134 135 132 <label> 133 {'Username'|@translate} 134 <input type="text" name="username" size="15" value=""> 135 </label> 136 136 137 138 139 140 137 <label> 138 {'Password'|@translate} 139 <input type="password" name="password" size="15"> 140 </label> 141 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 142 {if $AUTHORIZE_REMEMBERING} 143 <label> 144 {'remember_me'|@translate} 145 <input type="checkbox" name="remember_me" value="1"> 146 </label> 147 {/if} 148 <p> 149 <input class="submit" type="submit" name="login" value="{'Submit'|@translate}"> 150 </p> 151 152 <ul class="actions"> 153 <li><a href="{$U_LOST_PASSWORD}" title="{'Forgot your password?'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/lost_password.png" class="button" alt="{'Forgot your password?'|@translate}"></a></li> 154 {if isset($U_REGISTER)} 155 <li><a href="{$U_REGISTER}" title="{'Create a new account'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/register.png" class="button" alt="{'Register'|@translate}"/></a></li> 156 {/if} 157 </ul> 158 158 159 160 159 </fieldset> 160 </form> 161 161 {/if} 162 162 -
trunk/template/yoga/upload.tpl
r2265 r2325 36 36 </tr> 37 37 <tr> 38 <td colspan="2" align="center" style="padding:10px;">38 <td colspan="2" align="center"> 39 39 <input name="picture" type="file" value="" /> 40 40 </td> 41 41 </tr> 42 42 {if isset($SHOW_FORM_FIELDS) and $SHOW_FORM_FIELDS} 43 <!-- username-->43 <!-- category --> 44 44 <tr> 45 <td class="menu">{'Username'|@translate} <span style="color:red;">*</span></td> 46 <td align="left" style="padding:10px;"> 45 <td>{'Category'|@translate}</td> 46 <td> 47 {html_options name="category" options=$categories selected=$categories_selected} 48 </td> 49 </tr> 50 <!-- username --> 51 <tr> 52 <td>{'Username'|@translate} <span style="color:red;">*</span></td> 53 <td> 47 54 <input name="username" type="text" value="{$NAME}" /> 48 55 </td> 49 56 </tr> 50 <!-- mail address 57 <!-- mail address --> 51 58 <tr> 52 <td class="menu">{'mail_address'|@translate} <span style="color:red;">*</span></td>53 <td align="left" style="padding:10px;">59 <td>{'mail_address'|@translate} <span style="color:red;">*</span></td> 60 <td> 54 61 <input name="mail_address" type="text" value="{$EMAIL}" /> 55 62 </td> 56 63 </tr> 57 <!-- name of the picture 64 <!-- name of the picture --> 58 65 <tr> 59 <td class="menu">{'upload_name'|@translate}</td>60 <td align="left" style="padding:10px;">66 <td>{'upload_name'|@translate}</td> 67 <td> 61 68 <input name="name" type="text" value="{$NAME_IMG}" /> 62 69 </td> 63 70 </tr> 64 <!-- author 71 <!-- author --> 65 72 <tr> 66 <td class="menu">{'upload_author'|@translate}</td>67 <td align="left" style="padding:10px;">73 <td>{'upload_author'|@translate}</td> 74 <td> 68 75 <input name="author" type="text" value="{$AUTHOR_IMG}" /> 69 76 </td> 70 77 </tr> 71 <!-- date of creation 78 <!-- date of creation --> 72 79 <tr> 73 <td class="menu">{'Creation date'|@translate} (DD/MM/YYYY)</td>74 <td align="left" style="padding:10px;">80 <td>{'Creation date'|@translate} (DD/MM/YYYY)</td> 81 <td> 75 82 <input name="date_creation" type="text" value="{$DATE_IMG}" /> 76 83 </td> 77 84 </tr> 78 <!-- comment 85 <!-- comment --> 79 86 <tr> 80 <td class="menu">{'comment'|@translate}</td>81 <td align="left" style="padding:10px;">87 <td>{'comment'|@translate}</td> 88 <td> 82 89 <textarea name="comment" rows="3" cols="40" style="overflow:auto">{$COMMENT_IMG}</textarea> 83 90 </td> -
trunk/upload.php
r2299 r2325 21 21 // | USA. | 22 22 // +-----------------------------------------------------------------------+ 23 23 24 define('PHPWG_ROOT_PATH','./'); 24 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 25 26 check_status(ACCESS_GUEST); 27 28 $username = !empty($_POST['username'])?$_POST['username']:$user['username']; 29 $mail_address = !empty($_POST['mail_address'])?$_POST['mail_address']:@$user['mail_address']; 30 $name = !empty($_POST['name'])?$_POST['name']:''; 31 $author = !empty($_POST['author'])?$_POST['author']:''; 32 $date_creation = !empty($_POST['date_creation'])?$_POST['date_creation']:''; 33 $comment = !empty($_POST['comment'])?$_POST['comment']:''; 25 26 // +-----------------------------------------------------------------------+ 27 // | Includes | 28 // +-----------------------------------------------------------------------+ 29 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 30 include_once(PHPWG_ROOT_PATH.'include/upload.class.php'); 31 32 // +-----------------------------------------------------------------------+ 33 // | Check Access and exit when user status is not ok | 34 // +-----------------------------------------------------------------------+ 35 check_status($conf['upload_user_access']); 36 37 // +-----------------------------------------------------------------------+ 38 // | Create upload object | 39 // +-----------------------------------------------------------------------+ 40 $upload = new Upload(); 41 42 43 $username = !empty($_POST['username']) ? $_POST['username']:(is_classic_user() ? $user['username'] : ''); 44 $mail_address = !empty($_POST['mail_address']) ? $_POST['mail_address'] : (is_classic_user() ? $user['email'] : ''); 45 $name = !empty($_POST['name']) ? $_POST['name'] : ''; 46 $author = !empty($_POST['author']) ? $_POST['author'] : (is_classic_user() ? $user['username'] : ''); 47 $date_creation = !empty($_POST['date_creation']) ? $_POST['date_creation'] : ''; 48 $comment = !empty($_POST['comment']) ? $_POST['comment'] : ''; 34 49 35 50 //------------------------------------------------------------------- functions … … 122 137 123 138 //-------------------------------------------------- access authorization check 139 if (isset($_POST['category']) and is_numeric($_POST['category'])) 140 { 141 $page['category'] = $_POST['category']; 142 } 143 else 124 144 if (isset($_GET['cat']) and is_numeric($_GET['cat'])) 125 145 { 126 146 $page['category'] = $_GET['cat']; 127 147 } 128 129 if (isset($page['category'])) 130 { 131 check_restrictions( $page['category'] ); 132 $category = get_cat_info( $page['category'] ); 133 $category['cat_dir'] = get_complete_dir( $page['category'] ); 148 else 149 { 150 $page['category'] = null; 151 } 152 153 if (! empty($page['category'])) 154 { 155 check_restrictions($page['category']); 156 $category = get_cat_info($page['category']); 157 $category['cat_dir'] = get_complete_dir($page['category']); 134 158 135 159 if (url_is_remote($category['cat_dir']) or !$category['uploadable']) … … 138 162 } 139 163 } 140 else { // $page['category'] may be set by a futur plugin but without it 141 bad_request('invalid parameters'); 164 else 165 { 166 if (isset($_POST['submit'])) 167 { 168 // $page['category'] may be set by a futur plugin but without it 169 bad_request('invalid parameters'); 170 } 171 else 172 { 173 $category = null; 174 } 142 175 } 143 176 … … 148 181 $page['waiting_id'] = $_GET['waiting_id']; 149 182 } 183 150 184 //-------------------------------------------------------------- picture upload 151 185 // verfying fields … … 297 331 $template->set_filenames(array('upload'=>'upload.tpl')); 298 332 333 // Load category list 334 $query = ' 335 SELECT 336 id, name, uppercats, global_rank 337 FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' 338 ON id = cat_id and user_id = '.$user['id'].' 339 WHERE 340 uploadable = \'true\' 341 '.get_sql_condition_FandF 342 ( 343 array 344 ( 345 'visible_categories' => 'id', 346 ), 347 'AND' 348 ).' 349 ;'; 350 display_select_cat_wrapper($query, array($page['category']), 'categories'); 351 299 352 $u_form = PHPWG_ROOT_PATH.'upload.php?cat='.$page['category']; 300 353 if ( isset( $page['waiting_id'] ) ) … … 305 358 if ( isset( $page['waiting_id'] ) ) 306 359 { 307 $advise_title =l10n('upload_advise_thumbnail').$_FILES['picture']['name'];360 $advise_title = l10n('upload_advise_thumbnail').$_FILES['picture']['name']; 308 361 } 309 362 else 310 363 { 311 $advise_title = l10n('upload_advise'); 312 $advise_title.= get_cat_display_name($category['upper_names']); 364 $advise_title = l10n('Choose an image'); 313 365 } 314 366 -
trunk/ws.php
r2299 r2325 25 25 26 26 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 27 check_status(ACCESS_ NONE);27 check_status(ACCESS_FREE); 28 28 include_once(PHPWG_ROOT_PATH.'include/ws_core.inc.php'); 29 29
Note: See TracChangeset
for help on using the changeset viewer.