Changeset 5216 for trunk/plugins/LocalFilesEditor
- Timestamp:
- Mar 21, 2010, 3:08:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/LocalFilesEditor/admin.php
r5215 r5216 40 40 l10n('locfiledit_onglet_localconf'), 41 41 $my_base_url.'&tab=localconf'); 42 $tabsheet->add('css', 43 l10n('locfiledit_onglet_css'), 44 $my_base_url.'&tab=css'); 42 45 $tabsheet->add('tpl', 43 46 l10n('locfiledit_onglet_tpl'), … … 139 142 break; 140 143 144 case 'css': 145 $selected = 0; 146 $options[] = l10n('locfiledit_choose_file'); 147 $options[] = '----------------------'; 148 $value = PHPWG_ROOT_PATH . "local/css/rules.css"; 149 $options[$value] = 'local / css / rules.css'; 150 if ($edited_file == $value) $selected = $value; 151 $options[] = '----------------------'; 152 153 foreach (get_dirs($conf['themes_dir']) as $theme_id) 154 { 155 $value = PHPWG_ROOT_PATH . 'local/css/'.$theme_id.'-rules.css'; 156 $options[$value] = 'local / css / '.$theme_id.'-rules.css'; 157 if ($edited_file == $value) $selected = $value; 158 } 159 $template->assign('css_lang_tpl', array( 160 'OPTIONS' => $options, 161 'SELECTED' => $selected)); 162 $editarea_options['syntax'] = 'css'; 163 break; 164 141 165 case 'tpl': 142 166 // New file form creation … … 151 175 $options['parent'] = array_merge($options['parent'], get_rec_dirs(PHPWG_ROOT_PATH . 'template-extension')); 152 176 153 // Model list154 $eligible_templates = array(155 'about.tpl',156 'footer.tpl',157 'header.tpl',158 'identification.tpl',159 'index.tpl',160 'mainpage_categories.tpl',161 'menubar.tpl',162 'menubar_categories.tpl',163 'menubar_identification.tpl',164 'menubar_links.tpl',165 'menubar_menu.tpl',166 'menubar_specials.tpl',167 'menubar_tags.tpl',168 'navigation_bar.tpl',169 'nbm.tpl',170 'notification.tpl',171 'picture.tpl',172 'picture_content.tpl',173 'picture_nav_buttons.tpl',174 'popuphelp.tpl',175 'profile.tpl',176 'profile_content.tpl',177 'redirect.tpl',178 'register.tpl',179 'search.tpl',180 'search_rules.tpl',181 'slideshow.tpl',182 'tags.tpl',183 'thumbnails.tpl',184 'upload.tpl');185 186 177 $options['model'][] = l10n('locfiledit_empty_page'); 187 178 $options['model'][] = '----------------------'; 179 $i = 0; 188 180 foreach (get_extents() as $pwg_template) 189 181 { 190 182 $value = PHPWG_ROOT_PATH . 'template-extension/' . $pwg_template; 191 183 $options['model'][$value] = 'template-extension / ' . str_replace('/', ' / ', $pwg_template); 184 $i++; 192 185 } 193 $template_dir = PHPWG_ROOT_PATH . 'template'; 194 foreach (get_dirs($template_dir) as $pwg_template) 186 foreach (get_dirs($conf['themes_dir']) as $theme_id) 195 187 { 196 if ( count($options['model']) > 2)188 if ($i) 197 189 { 198 190 $options['model'][] = '----------------------'; 191 $i = 0; 199 192 } 200 $dir = $ template_dir . '/' . $pwg_template . '/';193 $dir = $conf['themes_dir'] . '/' . $theme_id . '/template/'; 201 194 if (is_dir($dir) and $content = opendir($dir)) 202 195 { 203 196 while ($node = readdir($content)) 204 197 { 205 if (is_file($dir . $node) and in_array($node, $eligible_templates))198 if (is_file($dir.$node) and get_extension($node) == 'tpl') 206 199 { 207 200 $value = $dir . $node; 208 $options['model'][$value] = $pwg_template . ' / ' . $node; 201 $options['model'][$value] = $theme_id . ' / ' . $node; 202 $i++; 209 203 } 210 204 } 211 205 } 206 } 207 if (end($options['model']) == '----------------------') 208 { 209 array_pop($options['model']); 212 210 } 213 211 // Assign variables to template … … 221 219 } 222 220 // List existing template extensions 223 $template_dir = PHPWG_ROOT_PATH . 'template-extension';224 221 $selected = 0; 225 222 $options[] = l10n('locfiledit_choose_file'); … … 251 248 foreach (get_languages() as $language_code => $language_name) 252 249 { 253 $value = PHPWG_ROOT_PATH.'l anguage/'.$language_code.'/local.lang.php';250 $value = PHPWG_ROOT_PATH.'local/language/'.$language_code.'.lang.php'; 254 251 if ($edited_file == $value) 255 252 {
Note: See TracChangeset
for help on using the changeset viewer.