/** * The screen that lets users add a bookmarklet. * */ function u_marklet_screen() { global $config_array, $Paths; PageHeader(lang('userbar', 'userinfo'), 1); PageAnkeiler(lang('userbar', 'userinfo') . ' » ' . lang('bookmarklets', 'bm_add')); // A quick hack to make sure the raquo's are encoded when using UTF-8 $withlinktitle = lang('bookmarklets', 'bm_withlink'); $nolinktitle = lang('bookmarklets', 'bm_nolink'); $withlinktitle = str_replace("»", "»", str_replace("»", "»", $withlinktitle)); $nolinktitle = str_replace("»", "»", str_replace("»", "»", $nolinktitle)); $url = gethost() . $Paths['pivot_url'] . "index.php?menu=entries&func=new_entry"; $withlink = sprintf("javascript:bm=document.selection?document.selection.createRange().text:document.getSelection();void(open('%s&url='+escape(location.href)+'&i='+escape(bm)+'&t='+escape(document.title), 'new_log_entry', 'resizable=yes, scrollbars=yes, width=790, height=480, location=yes, status=yes'));", $url); $nolink = sprintf("javascript:void(open('%s','new_log_entry', 'resizable=yes, scrollbars=yes, width=790, height=480, location=yes, status=yes'));", $url); $main_funcs = array(array($withlinktitle, $withlink, lang('bookmarklets', 'bm_withlink_desc')), array($nolinktitle, $nolink, lang('bookmarklets', 'bm_nolink_desc'))); DispPage($main_funcs); echo "<p>" . lang('bookmarklets', 'bookmarklets_info'); echo "<ul><li>" . lang('bookmarklets', 'bookmarklets_info_1') . "</li>"; echo "<li>" . lang('bookmarklets', 'bookmarklets_info_2') . "</li></ul></p>"; PageFooter(); }
/** * The screen to edit a weblog, screen 3 */ function main_blogs_edit3() { global $Pivot_Vars, $blog_settings, $Weblogs; PageHeader(lang('weblog_config', 'create_3')); PageAnkeiler(lang('userbar', 'admin') . ' » ' . lang('weblog_config', 'create_3')); if (isset($Pivot_Vars['orig_name']) && strlen($Pivot_Vars['orig_name']) > 1) { $blog_settings = $Weblogs[$Pivot_Vars['orig_name']]; $orig_name = $Pivot_Vars['orig_name']; MidHeading(sprintf(lang('weblog_config', 'edit_weblog') . ' \'%s\'', $Weblogs[$Pivot_Vars['orig_name']]['name'])); } else { $blog_settings = get_tempweblog(); $orig_name = ""; MidHeading(lang('weblog_config', 'create_new')); } $temp_subweblogs = $Pivot_Vars['sub_weblog']; foreach ($temp_subweblogs as $subweblog => $dummy) { // fix the subweblogs' categories.. if (count($temp_subweblogs[$subweblog]['categories']) > 0) { foreach ($temp_subweblogs[$subweblog]['categories'] as $cat => $dummy) { unset($temp_subweblogs[$subweblog]['categories'][$cat]); $temp_subweblogs[$subweblog]['categories'][] = $cat; } } else { // you are an idiot if you did not select any categories.. $temp_subweblogs[$subweblog]['categories'] = array(); } } // unserialize the parsed temp_weblog.. $temp_weblog = unserialize(urldecode($Pivot_Vars['temp_weblog'])); // merge temp_weblog with temp_subweblogs $temp_weblog['sub_weblog'] = $temp_subweblogs; StartForm('blog_save', 1); StartTable(); EndForm(lang('weblog_config', 'create'), 2); $settings = get_weblog_config3(); $settings[] = array('orig_name', 'originalname', '', 7, $orig_name); $settings[] = array('temp_weblog', 'tempweblog', '', 7, urlencode(serialize($temp_weblog))); DisplaySettings($settings, 'blog_settings'); EndForm(lang('weblog_config', 'create'), 1); PageFooter(); }