Changeset 3317
- Timestamp:
- 01/08/15 22:27:40 (9 years ago)
- Location:
- plugins/dlManager/trunk
- Files:
-
- 6 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dlManager/trunk/_admin.php
r3316 r3317 24 24 if (!defined('DC_CONTEXT_ADMIN')) {return;} 25 25 26 $_menu[' Plugins']->addItem(__('Download Manager'),26 $_menu['Blog']->addItem(__('Download Manager'), 27 27 'plugin.php?p=dlManager', 28 28 'index.php?pf=dlManager/icon.png', 29 29 preg_match('/plugin.php\?p=dlManager(&.*)?$/',$_SERVER['REQUEST_URI']), 30 30 $core->auth->check('admin',$core->blog->id)); 31 32 #dashboard 33 $core->addBehavior('adminDashboardFavorites','dlManagerDashboardFavorites'); 34 35 function dlManagerDashboardFavorites($core,$favs) 36 { 37 $favs->register('dlManager', array( 38 'title' => __('Download Manager'), 39 'url' => 'plugin.php?p=dlManager', 40 'small-icon' => 'index.php?pf=dlManager/icon.png', 41 'large-icon' => 'index.php?pf=dlManager/icon-big.png', 42 'permissions' => 'usage,contentadmin' 43 )); 44 } -
plugins/dlManager/trunk/_define.php
r3316 r3317 28 28 /* Description*/ "Download manager with a public page and a widget", 29 29 /* Author */ "Moe (http://gniark.net/), Osku and Tomtom (http://blog.zenstyle.fr)", 30 /* Version */ '1.1.5', 31 /* Permissions */ 'admin' 30 /* Version */ '1.1.6', 31 /* Properties */ 32 array( 33 'permissions' => 'admin', 34 'type' => 'plugin', 35 'dc_min' => '2.6', 36 'support' => 'http://lab.dotclear.org/wiki/plugin/dlManager/fr', 37 'details' => 'http://lab.dotclear.org/wiki/plugin/dlManager/fr' 38 ) 32 39 ); -
plugins/dlManager/trunk/_prepend.php
r3316 r3317 28 28 require_once(dirname(__FILE__).'/_widget.php'); 29 29 30 $core->blog->settings->addNamespace('dlmanager'); 31 32 if ($core->blog->settings->dlmanager->dlmanager_active) 30 if ($core->blog->settings->dlmanager_active) 33 31 { 34 32 $core->url->register('media','media', -
plugins/dlManager/trunk/_public.php
r3316 r3317 24 24 if (!defined('DC_RC_PATH')) {return;} 25 25 26 $core->blog->settings->addNamespace('dlManager');27 26 if (!$core->blog->settings->dlManager->dlmanager_active) {return;} 28 27 … … 39 38 40 39 # if the plugin is disabled 41 if (!$core->blog->settings->dl manager_active)40 if (!$core->blog->settings->dlManager->dlmanager_active) 42 41 { 43 42 self::p404(); … … 72 71 { 73 72 # define root of DL Manager 74 $page_root = $core->blog->settings->dl manager_root;73 $page_root = $core->blog->settings->dlManager->dlmanager_root; 75 74 76 75 # used to remove root from path … … 102 101 # file sort 103 102 # if visitor can choose how to sort files 104 if ($core->blog->settings->dl manager_enable_sort === true)103 if ($core->blog->settings->dlManager->dlmanager_enable_sort === true) 105 104 { 106 105 # from /dotclear/admin/media.php … … 120 119 { 121 120 # default value 122 $_ctx->dlManager_fileSort = $core->blog->settings->dl manager_file_sort;121 $_ctx->dlManager_fileSort = $core->blog->settings->dlManager->dlmanager_file_sort; 123 122 } 124 123 … … 171 170 172 171 $_ctx->dlManager_multiple_pages = (boolean) (count($files) > 173 $core->blog->settings->dl manager_nb_per_page);172 $core->blog->settings->dlManager->dlmanager_nb_per_page); 174 173 175 174 $_ctx->dlManager_pager = new pager( 176 175 # current page 177 176 ((isset($_GET['page'])) ? $_GET['page'] : 1),count($files), 178 $core->blog->settings->dl manager_nb_per_page,10);177 $core->blog->settings->dlManager->dlmanager_nb_per_page,10); 179 178 180 179 $_ctx->dlManager_pager->html_prev = '« '.__('previous'); … … 236 235 237 236 # file_url for mp3, flv, mp4 and m4v players 238 if ($core->blog->settings->dl manager_hide_urls)237 if ($core->blog->settings->dlManager->dlmanager_hide_urls) 239 238 { 240 239 $_ctx->file_url = $core->blog->url.$core->url->getBase('viewfile'). … … 247 246 248 247 # define root of DL Manager 249 $page_root = $core->blog->settings->dl manager_root;248 $page_root = $core->blog->settings->dlManager->dlmanager_root; 250 249 251 250 # used to remove root from path … … 325 324 if (is_readable($file->file)) 326 325 { 327 if ($core->blog->settings->dl manager_counter)326 if ($core->blog->settings->dlManager->dlmanager_counter) 328 327 { 329 $count = unserialize($core->blog->settings->dl manager_count_dl);328 $count = unserialize($core->blog->settings->dlManager->dlmanager_count_dl); 330 329 if (!is_array($count)) {$count = array();} 331 330 $count[$file->media_id] = array_key_exists($file->media_id,$count) … … 334 333 $settings =& $core->blog->settings; 335 334 336 $settings-> setNamespace('dlmanager');337 $settings-> put('dlmanager_count_dl',serialize($count),'string',335 $settings->addNamespace('dlManager'); 336 $settings->dlManager->put('dlmanager_count_dl',serialize($count),'string', 338 337 'Download counter'); 339 338 //$core->callBehavior('publicDownloadedFile',(integer)$args); … … 369 368 global $core; 370 369 371 if (!$GLOBALS['core']->blog->settings->dl manager_hide_urls372 || empty($args) || !$core->blog->settings->dl manager_active)370 if (!$GLOBALS['core']->blog->settings->dlManager->dlmanager_hide_urls 371 || empty($args) || !$core->blog->settings->dlManager->dlmanager_active) 373 372 { 374 373 self::p404(); … … 521 520 'pageLinks')); 522 521 523 if ($core->blog->settings->dl manager_attachment_url)522 if ($core->blog->settings->dlManager->dlmanager_attachment_url) 524 523 { 525 524 # redefine {{tpl:AttachmentURL}} … … 552 551 { 553 552 return 554 '<?php if ($core->blog->settings->dl manager_enable_sort === true) : ?>'."\n".553 '<?php if ($core->blog->settings->dlManager->dlmanager_enable_sort === true) : ?>'."\n". 555 554 $content. 556 555 '<?php endif; ?>'; … … 796 795 $f = $GLOBALS['core']->tpl->getFilters($attr); 797 796 798 if ($GLOBALS['core']->blog->settings->dl manager_hide_urls)797 if ($GLOBALS['core']->blog->settings->dlManager->dlmanager_hide_urls) 799 798 { 800 799 return('<?php echo($core->blog->url.'. … … 896 895 if ($attr['format'] == 'date_format') 897 896 { 898 $format = $GLOBALS['core']->blog->settings-> date_format;897 $format = $GLOBALS['core']->blog->settings->system->date_format; 899 898 } 900 899 elseif ($attr['format'] == 'time_format') 901 900 { 902 $format = $GLOBALS['core']->blog->settings-> time_format;901 $format = $GLOBALS['core']->blog->settings->system->time_format; 903 902 } 904 903 else … … 931 930 public static function ifDownloadCounter($attr,$content) 932 931 { 933 return('<?php if ($core->blog->settings->dl manager_counter) : ?>'.932 return('<?php if ($core->blog->settings->dlManager->dlmanager_counter) : ?>'. 934 933 $content. 935 934 '<?php endif; ?>'); … … 951 950 {$size = $attr['size'];} 952 951 953 if ($GLOBALS['core']->blog->settings->dl manager_hide_urls)952 if ($GLOBALS['core']->blog->settings->dlManager->dlmanager_hide_urls) 954 953 { 955 954 return('<?php '. -
plugins/dlManager/trunk/_widget.php
r3316 r3317 74 74 sprintf(__('Add a link to %s in the widget:'),__('Download manager')). 75 75 ' ('.__('optional').')',__('Download manager'),'text'); 76 77 $w->dlManager->setting('homeonly',__('Home page only'),false,'check'); 76 77 78 $w->dlManager->setting('homeonly',__('Display on:'),0,'combo', 79 array( 80 __('All pages') => 0, 81 __('Home page only') => 1, 82 __('Except on home page') => 2 83 ) 84 ); 85 $w->dlManager->setting('content_only',__('Content only'),0,'check'); 86 $w->dlManager->setting('class',__('CSS class:'),''); 78 87 } 79 88 … … 83 92 @return <b>string</b> XHTML 84 93 */ 85 public static function show( &$w)94 public static function show($w) 86 95 { 87 96 global $core; 88 89 if ($w->homeonly && $core->url->type != 'default') { 97 98 if (($w->homeonly == 1 && $core->url->type != 'default') || 99 ($w->homeonly == 2 && $core->url->type == 'default')) 90 100 return; 91 }92 93 $core->blog->settings->addNamespace('dlManager');94 101 95 102 if (!$core->blog->settings->dlManager->dlmanager_active) {return;} … … 213 220 dlManager::pageURL().'">'.html::escapeHTML($w->link).'</a></p>' : null; 214 221 215 return '<div class="dlmanager">'.$header.$str.$link.'</div>'; 222 return 223 ($w->content_only ? '' : '<div class="dlmanager'.($w->class ? ' '.html::escapeHTML($w->class) : '').'">'). 224 $header.$str.$link. 225 ($w->content_only ? '' : '</div>'); 216 226 } 217 227 } -
plugins/dlManager/trunk/default-templates/media.html
r1097 r3317 26 26 </style> 27 27 28 <link rel="stylesheet" href="{{tpl:BlogQmarkURL}}pf=dlManager/ default-templates/facebox.css" type="text/css" media="screen" />28 <link rel="stylesheet" href="{{tpl:BlogQmarkURL}}pf=dlManager/css/dlmanager_facebox.css" type="text/css" media="screen" /> 29 29 30 30 {{tpl:include src="_head.html"}} -
plugins/dlManager/trunk/inc/lib.dlManager.php
r3316 r3317 145 145 { 146 146 global $core; 147 148 $core->blog->settings->addNamespace('dlManager'); 147 149 148 $root = $core->blog->settings->dlManager->dlmanager_root; 150 149 … … 166 165 global $core; 167 166 168 $count_dl = unserialize($core->blog->settings->dl manager_count_dl);167 $count_dl = unserialize($core->blog->settings->dlManager->dlmanager_count_dl); 169 168 if (!is_array($count_dl)) 170 169 { … … 177 176 { 178 177 $dl = '0'; 179 if ($core->blog->settings->dl manager_counter)178 if ($core->blog->settings->dlManager->dlmanager_counter) 180 179 { 181 180 if ((isset($v->media_id)) … … 277 276 if ($file->media_image) 278 277 { # We look for thumbnails too 279 $media_root = $core->blog->host.path::clean($core->blog->settings-> public_url).'/';278 $media_root = $core->blog->host.path::clean($core->blog->settings->system->public_url).'/'; 280 279 foreach ($file->media_thumb as $v) { 281 280 $v = preg_replace('/^'.preg_quote($media_root,'/').'/','',$v); -
plugins/dlManager/trunk/index.php
r2771 r3317 24 24 if (!defined('DC_CONTEXT_ADMIN')) { return; } 25 25 26 $page_title = __('Download Manager'); 27 26 28 $settings =& $core->blog->settings; 27 29 … … 30 32 if (!empty($_POST['saveconfig'])) 31 33 { 32 $settings-> setNameSpace('dlmanager');33 $settings-> put('dlmanager_active',!empty($_POST['dlmanager_active']),34 $settings->addNameSpace('dlManager'); 35 $settings->dlManager->put('dlmanager_active',!empty($_POST['dlmanager_active']), 34 36 'boolean','Enable DL Manager'); 35 $settings-> put('dlmanager_hide_urls',!empty($_POST['dlmanager_hide_urls']),37 $settings->dlManager->put('dlmanager_hide_urls',!empty($_POST['dlmanager_hide_urls']), 36 38 'boolean','Hide files URLs'); 37 $settings-> put('dlmanager_counter',!empty($_POST['dlmanager_counter']),39 $settings->dlManager->put('dlmanager_counter',!empty($_POST['dlmanager_counter']), 38 40 'boolean','Enable download counter'); 39 $settings-> put('dlmanager_attachment_url',!empty($_POST['dlmanager_attachment_url']),41 $settings->dlManager->put('dlmanager_attachment_url',!empty($_POST['dlmanager_attachment_url']), 40 42 'boolean','Redirect attachments links to DL Manager'); 41 43 … … 49 51 $nb_per_page = 20; 50 52 } 51 $settings-> put('dlmanager_nb_per_page',$nb_per_page,53 $settings->dlManager->put('dlmanager_nb_per_page',$nb_per_page, 52 54 'integer','Files per page'); 53 $settings-> put('dlmanager_enable_sort',!empty($_POST['dlmanager_enable_sort']),55 $settings->dlManager->put('dlmanager_enable_sort',!empty($_POST['dlmanager_enable_sort']), 54 56 'boolean','Allow visitors to choose how to sort files'); 55 $settings-> put('dlmanager_file_sort',57 $settings->dlManager->put('dlmanager_file_sort', 56 58 (!empty($_POST['dlmanager_file_sort']) ? $_POST['dlmanager_file_sort'] : ''), 57 59 'string','file sort'); 58 $settings-> put('dlmanager_root',60 $settings->dlManager->put('dlmanager_root', 59 61 (!empty($_POST['dlmanager_root']) ? $_POST['dlmanager_root'] : ''), 60 62 'string', 'root directory'); … … 79 81 <html> 80 82 <head> 81 <title><?php echo __('Download Manager'); ?></title>83 <title><?php echo $page_title; ?></title> 82 84 </head> 83 85 <body> 84 85 <h2><?php echo html::escapeHTML($core->blog->name).' › '.__('Download Manager'); ?></h2> 86 87 <?php 88 if (!empty($msg)) {echo '<p class="message">'.$msg.'</p>';} 89 ?> 90 86 <?php 87 echo dcPage::breadcrumb( 88 array( 89 html::escapeHTML($core->blog->name) => '', 90 '<span class="page-title">'.$page_title.'</span>' => '' 91 )); 92 if (!empty($msg)) { 93 dcPage::success($msg); 94 } 95 ?> 91 96 <form method="post" action="<?php echo http::getSelfURI(); ?>"> 92 <fieldset> 93 <legend><?php echo __('Download manager'); ?></legend> 94 <p> 97 <div class="fieldset"> 98 99 <?php 100 if ($core->blog->settings->dlManager->dlmanager_active) { 101 echo '<p><a class="onblog_link outgoing" href="'.$core->blog->url.$core->url->getBase('media').'" title="'.__('View the Download Manager public page').'">'.__('View the Download Manager public page').' <img src="images/outgoing-blue.png" alt="" /></a></p>'; 102 } 103 ?> 104 <h4><?php echo __('Plugin activation'); ?></h4> 105 <p> 95 106 <?php echo form::checkbox('dlmanager_active',1, 96 $core->blog->settings->dl manager_active); ?>107 $core->blog->settings->dlManager->dlmanager_active); ?> 97 108 <label class="classic" for="dlmanager_active"> 98 109 <?php printf(__('Enable the %s'),__('Download manager')); ?> … … 103 114 __('Download manager')); ?> 104 115 </p> 116 </div> 117 <div class="fieldset"> 118 <h4><?php echo __('Advanced options'); ?></h4> 105 119 <p> 106 120 <?php echo form::checkbox('dlmanager_hide_urls',1, 107 $core->blog->settings->dl manager_hide_urls); ?>121 $core->blog->settings->dlManager->dlmanager_hide_urls); ?> 108 122 <label class="classic" for="dlmanager_hide_urls"> 109 123 <?php echo __('Hide URLs of images, mp3, flv, mp4 and m4v files'); ?> … … 119 133 <p> 120 134 <?php echo form::checkbox('dlmanager_counter',1, 121 $core->blog->settings->dl manager_counter); ?>135 $core->blog->settings->dlManager->dlmanager_counter); ?> 122 136 <label class="classic" for="dlmanager_counter"> 123 137 <?php echo __('Enable the download counter'); ?> … … 126 140 <p> 127 141 <?php echo form::checkbox('dlmanager_attachment_url',1, 128 $core->blog->settings->dl manager_attachment_url); ?>142 $core->blog->settings->dlManager->dlmanager_attachment_url); ?> 129 143 <label class="classic" for="dlmanager_attachment_url"> 130 144 <?php printf(__('Redirect attachments links to %s'), … … 147 161 </label> 148 162 <?php echo form::field('dlmanager_nb_per_page',7,7, 149 (($core->blog->settings->dl manager_nb_per_page)150 ? $core->blog->settings->dl manager_nb_per_page : 20)); ?>163 (($core->blog->settings->dlManager->dlmanager_nb_per_page) 164 ? $core->blog->settings->dlManager->dlmanager_nb_per_page : 20)); ?> 151 165 </p> 152 166 <p> 153 167 <?php echo form::checkbox('dlmanager_enable_sort',1, 154 $core->blog->settings->dl manager_enable_sort); ?>168 $core->blog->settings->dlManager->dlmanager_enable_sort); ?> 155 169 <label class="classic" for="dlmanager_enable_sort"> 156 170 <?php echo __('Allow visitors to choose how to sort files'); ?> … … 161 175 <?php echo __('Sort files:'). 162 176 form::combo('dlmanager_file_sort',dlManager::getSortValues(true), 163 $core->blog->settings->dl manager_file_sort); ?>177 $core->blog->settings->dlManager->dlmanager_file_sort); ?> 164 178 </label> 165 179 </p> … … 171 185 <?php printf(__('Define root of %s:'),__('Download manager')); 172 186 echo form::combo('dlmanager_root',dlManager::listDirs(false,true), 173 $core->blog->settings->dl manager_root); ?>187 $core->blog->settings->dlManager->dlmanager_root); ?> 174 188 </label> 175 189 </p> … … 186 200 <?php printf( 187 201 __('Files can be excluded from %1$s by editing %2$s in %3$s.'), 188 __('Download manager'),'<strong>media_exclusion</strong>','<strong>about:config </strong>');202 __('Download manager'),'<strong>media_exclusion</strong>','<strong>about:config (system)</strong>'); 189 203 echo ' '; 190 204 printf(__('For example, to exclude %1$s and %2$s files: %3$s'), … … 196 210 <code><?php echo dlManager::pageURL(); ?></code> 197 211 </p> 198 <p> 199 <a href="<?php echo dlManager::pageURL(); ?>"> 200 <?php printf(__('View the %s page'),__('Download manager')); ?></a> 201 </p> 202 </fieldset> 212 </div> 203 213 204 214 <p><?php echo $core->formNonce(); ?></p> … … 206 216 </form> 207 217 208 <?php dcPage::helpBlock('dlManager _widget');?>218 <?php dcPage::helpBlock('dlManager');?> 209 219 210 220 </body> -
plugins/dlManager/trunk/locales/en/resources.php
r3316 r3317 1 1 <?php 2 if (!isset($__resources['help']['dlManager_widget'])) 2 # ***** BEGIN LICENSE BLOCK ***** 3 # 4 # This file is part of DL Manager. 5 # Copyright 2008,2010 Moe (http://gniark.net/) and Tomtom (http://blog.zenstyle.fr) 6 # 7 # DL Manager is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 3 of the License, or 10 # (at your option) any later version. 11 # 12 # DL Manager is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 19 # 20 # Images are from Silk Icons : http://www.famfamfam.com/lab/icons/silk/ 21 # 22 # ***** END LICENSE BLOCK ***** 23 24 if (!isset($__resources['help']['dlManager'])) 3 25 { 4 $__resources['help']['dlManager _widget'] =5 dirname(__FILE__).'/help/ widget.html';26 $__resources['help']['dlManager'] = 27 dirname(__FILE__).'/help/dlManager.html'; 6 28 } -
plugins/dlManager/trunk/locales/fr/main.po
r1678 r3317 272 272 msgstr "Voir la page %s" 273 273 274 msgid "View the Download Manager public page" 275 msgstr "Voir la page publique Gestionnaire de téléchargement" 276 274 277 #: index.php:202 275 278 msgid "Save configuration" … … 285 288 #: _widget.php:76 286 289 msgid "optional" 287 msgstr " facultatif"290 msgstr "optionnel" 288 291 289 292 #: _widget.php:54 … … 319 322 msgid "Add a link to %s in the widget:" 320 323 msgstr "Ajouter un lien vers %s dans le widget :" 321 322 #: _widget.php:78323 msgid "Home page only"324 msgstr ""325 -
plugins/dlManager/trunk/locales/fr/resources.php
r3316 r3317 1 1 <?php 2 if (!isset($__resources['help']['dlManager_widget'])) 2 # ***** BEGIN LICENSE BLOCK ***** 3 # 4 # This file is part of DL Manager. 5 # Copyright 2008,2010 Moe (http://gniark.net/) and Tomtom (http://blog.zenstyle.fr) 6 # 7 # DL Manager is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 3 of the License, or 10 # (at your option) any later version. 11 # 12 # DL Manager is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 19 # 20 # Images are from Silk Icons : http://www.famfamfam.com/lab/icons/silk/ 21 # 22 # ***** END LICENSE BLOCK ***** 23 24 if (!isset($__resources['help']['dlManager'])) 3 25 { 4 $__resources['help']['dlManager _widget'] =5 dirname(__FILE__).'/help/ widget.html';26 $__resources['help']['dlManager'] = 27 dirname(__FILE__).'/help/dlManager.html'; 6 28 }
Note: See TracChangeset
for help on using the changeset viewer.