Changeset 2239:cd7100fa57db
- Timestamp:
- 10/04/13 00:53:07 (12 years ago)
- Branch:
- default
- Children:
- 2240:2553775ae2fe, 2242:f31162da2395
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/index.php
r2229 r2239 258 258 if ($core->auth->isSuperAdmin()) 259 259 { 260 $list = array(); 261 foreach ($core->plugins->getErrors() as $k => $error) { 262 $list[] = '<li>'.$error.'</li>'; 263 } 264 265 if (count($list) > 0) { 260 $list = $core->plugins->getErrors(); 261 if (!empty($list)) { 266 262 echo 267 '<div class="error" id="module-errors" class="error"><p>'.__(' Some plugins are installed twice:').'</p> '.268 '<ul> '.implode("\n",$list).'</ul></div>';263 '<div class="error" id="module-errors" class="error"><p>'.__('Errors have occured with following plugins:').'</p> '. 264 '<ul><li>'.implode("</li>\n<li>", $list).'</li></ul></div>'; 269 265 } 270 266 } -
inc/core/class.dc.modules.php
r2095 r2239 35 35 protected static $_k; 36 36 protected static $_n; 37 38 protected static $type = 'plugin'; 37 39 38 40 public $core; ///< <b>dcCore</b> dcCore instance … … 177 179 array( 178 180 'permissions' => null, 179 'priority' => 1000 181 'priority' => 1000, 182 'standalone_config' => false, 183 'type' => null 180 184 ), $properties 181 185 ); 186 187 if ($properties['type'] !== null && $properties['type'] != self::$type) { 188 $this->errors[] = sprintf( 189 __('Module "%s" has type "%s" that mismatch required module type "%s".'), 190 '<strong>'.html::escapeHTML($name).'</strong>', 191 '<em>'.html::escapeHTML($properties['type']).'</em>', 192 '<em>'.html::escapeHTML(self::$type).'</em>' 193 ); 194 return; 195 } 196 182 197 $permissions = $properties['permissions']; 183 198 if ($this->ns == 'admin') { … … 210 225 $path2 = path::real($this->mroot); 211 226 $this->errors[] = sprintf( 212 __(' %s: in [%s] and [%s]'),227 __('Module "%s" is installed twice in "%s" and "%s".'), 213 228 '<strong>'.$name.'</strong>', 214 229 '<em>'.$path1.'</em>', … … 223 238 $this->modules = array(); 224 239 $this->modules_names = array(); 240 $this->errors = array(); 225 241 } 226 242 … … 258 274 $ret_code = 1; 259 275 260 if (is_dir($destination)) 276 if (!is_dir($destination)) 277 { 278 try { 279 files::makeDir($destination,true); 280 281 $sandbox = clone $modules; 282 $zip->unzip($define, $target.'/_define.php'); 283 284 $sandbox->resetModulesList(); 285 $sandbox->requireDefine($target,basename($destination)); 286 unlink($target.'/_define.php'); 287 288 $new_errors = $sandbox->getErrors(); 289 if (!empty($new_errors)) { 290 $new_errors = is_array($new_errors) ? implode(" \n",$new_errors) : $new_errors; 291 throw new Exception($new_errors); 292 } 293 294 files::deltree($destination); 295 } 296 catch(Exception $e) 297 { 298 $zip->close(); 299 unlink($zip_file); 300 files::deltree($destination); 301 throw new Exception($e->getMessage()); 302 } 303 } 304 else 261 305 { 262 306 # test for update -
inc/core/class.dc.themes.php
r1179 r2239 23 23 class dcThemes extends dcModules 24 24 { 25 protected static $type = 'theme'; 26 25 27 /** 26 28 This method registers a theme in modules list. You should use this to … … 58 60 'parent' => null, 59 61 'priority' => 1000, 60 'standalone_config' => false 62 'standalone_config' => false, 63 'type' => null 61 64 ), $properties 62 65 ); 66 67 if ($properties['type'] !== null && $properties['type'] != self::$type) { 68 $this->errors[] = sprintf( 69 __('Module "%s" has type "%s" that mismatch required module type "%s".'), 70 '<strong>'.html::escapeHTML($name).'</strong>', 71 '<em>'.html::escapeHTML($properties['type']).'</em>', 72 '<em>'.html::escapeHTML(self::$type).'</em>' 73 ); 74 return; 75 } 76 63 77 if ($this->id) { 64 78 $this->modules[$this->id] = array_merge(
Note: See TracChangeset
for help on using the changeset viewer.