Changeset 419:c22178d34030 for themes/ductile/_config.php
- Timestamp:
- 06/27/11 14:38:41 (14 years ago)
- Branch:
- themes
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
themes/ductile/_config.php
r395 r419 13 13 14 14 l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/main'); 15 16 $sticker_images = array( 17 __('Contact') => 'sticker-contact.png', 18 __('Feed') => 'sticker-feed.png', 19 __('About') => 'sticker-about.png' 20 ); 15 21 16 22 $fonts = array( … … 94 100 $ductile_user = array_merge($ductile_base,$ductile_user); 95 101 102 $ductile_stickers_base = array( 103 array('label' => null,'url' => null,'image' => null), 104 array('label' => null,'url' => null,'image' => null), 105 array('label' => null,'url' => null,'image' => null) 106 ); 107 108 $ductile_stickers = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_stickers'); 109 $ductile_stickers = @unserialize($ductile_stickers); 110 if (!is_array($ductile_stickers)) { 111 $ductile_stickers = array(); 112 } 113 114 $ductile_stickers = $ductile_stickers_base; 115 96 116 $conf_tab = isset($_POST['conf_tab']) ? $_POST['conf_tab'] : 'html'; 97 117 … … 103 123 if ($conf_tab == 'html') { 104 124 $ductile_user['subtitle_hidden'] = (integer) !empty($_POST['subtitle_hidden']); 125 126 $count = 0; 127 if (!empty($_POST['sticker1_label']) && !empty($_POST['sticker1_url'])) { 128 $ductile_stickers[$count]['label'] = $_POST['sticker1_label']; 129 $ductile_stickers[$count]['url'] = $_POST['sticker1_url']; 130 $ductile_stickers[$count]['image'] = $_POST['sticker1_image']; 131 $count++; 132 } 133 if (!empty($_POST['sticker2_label']) && !empty($_POST['sticker2_url'])) { 134 $ductile_stickers[$count]['label'] = $_POST['sticker2_label']; 135 $ductile_stickers[$count]['url'] = $_POST['sticker2_url']; 136 $ductile_stickers[$count]['image'] = $_POST['sticker2_image']; 137 $count++; 138 } 139 if (!empty($_POST['sticker3_label']) && !empty($_POST['sticker3_url'])) { 140 $ductile_stickers[$count]['label'] = $_POST['sticker3_label']; 141 $ductile_stickers[$count]['url'] = $_POST['sticker3_url']; 142 $ductile_stickers[$count]['image'] = $_POST['sticker3_image']; 143 $count++; 144 } 145 for ($i = $count; $i < 3; $i++) { 146 $ductile_stickers[$i]['label'] = null; 147 $ductile_stickers[$i]['url'] = null; 148 $ductile_stickers[$i]['image'] = null; 149 } 105 150 } 106 151 … … 133 178 $core->blog->settings->addNamespace('themes'); 134 179 $core->blog->settings->themes->put($core->blog->settings->system->theme.'_style',serialize($ductile_user)); 180 $core->blog->settings->themes->put($core->blog->settings->system->theme.'_stickers',serialize($ductile_stickers)); 135 181 $core->blog->triggerBlog(); 136 182 … … 159 205 '</fieldset>'; 160 206 207 //echo '<fieldset><legend>'.__('Stickers').'</legend>'; 208 echo '<h3>'.__('Stickers').'</h3>'; 209 210 echo '<table id="stickerslist">'.'<caption>'.__('Stickers').'</caption>'. 211 '<thead>'. 212 '<tr>'. 213 '<th scope="col">'.__('Position').'</th>'. 214 '<th scope="col">'.__('Label').'</th>'. 215 '<th scope="col">'.__('URL').'</th>'. 216 '<th scope="col">'.__('Icon').'</th>'. 217 '</tr>'. 218 '</thead>'. 219 '<tbody>'. 220 '<tr>'. 221 '<td scope="raw">1</td>'. 222 '<td>'.form::field('sticker1_label',20,255,$ductile_stickers[0]['label']).'</td>'. 223 '<td>'.form::field('sticker1_url',40,255,$ductile_stickers[0]['url']).'</td>'. 224 '<td>'.form::combo('sticker1_image',$sticker_images,$ductile_stickers[0]['image']).'</td>'. 225 '</tr>'. 226 '<tr>'. 227 '<td scope="raw">2</td>'. 228 '<td>'.form::field('sticker2_label',20,255,$ductile_stickers[1]['label']).'</td>'. 229 '<td>'.form::field('sticker2_url',40,255,$ductile_stickers[1]['url']).'</td>'. 230 '<td>'.form::combo('sticker2_image',$sticker_images,$ductile_stickers[1]['image']).'</td>'. 231 '</tr>'. 232 '<tr>'. 233 '<td scope="raw">3</td>'. 234 '<td>'.form::field('sticker3_label',20,255,$ductile_stickers[2]['label']).'</td>'. 235 '<td>'.form::field('sticker3_url',40,255,$ductile_stickers[2]['url']).'</td>'. 236 '<td>'.form::combo('sticker3_image',$sticker_images,$ductile_stickers[2]['image']).'</td>'. 237 '</tr>'. 238 '</tbody>'. 239 '</table>'; 240 241 //echo '</fieldset>'; 242 161 243 echo '<input type="hidden" name="conf_tab" value="html">'; 162 244 echo '<p class="clear"><input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>';
Note: See TracChangeset
for help on using the changeset viewer.