function writePage() { SB_Page::head('DB Configuration', 'siteBarConfig'); ?> <h2>DB Configuration</h2> <p> <a href="doc/install.txt">Install & Upgrade Guide</a> <br> <a href="doc/troubleshooting.txt">Troubleshooting</a> <?php if (!$this->hasErrors()) { if ($this->command == 'Check Settings') { $this->message = 'Connection parameters are OK!'; } if ($this->message) { ?> <div class="message"> <?php echo $this->message; ?> </div> <?php } } else { ?> <div class="error"> <?php $this->writeErrors(false); ?> </div> <?php } }
} $um->setParam('user', $_COOKIE['popup_params']); if (isset($_REQUEST['install'])) { IEInstall(); exit; } if (isset($_REQUEST['search_engine'])) { SearchEngine(); exit; } // Redirect and keep cookies $meta = null; if (isset($_GET['url'])) { $meta = '<meta http-equiv="refresh" content="0;url=integrator.php?lang=' . SB_GetLanguage() . '">'; } SB_Page::head('Integrator', 'siteBarIndex', null, null, $meta); if (isset($_GET['url'])) { exit; } // Include skin hook file include_once SB_Skin::path() . '/hook.inc.php'; $hook = new SB_Hook(); $sponsor = new SB_SponsorInterface($hook); $file = './inc/sponsor.inc.php'; if (is_file($file)) { include_once $file; $sponsor = new SB_Sponsor($hook); } $browser = SB_reqVal('browser'); $browsers = array('firefox' => array('label' => 'Mozilla Firefox', 'homepage' => 'http://www.mozilla.org/products/firefox/', 'platforms' => '9.0/All', 'usage' => '', 'exclude' => array(), 'extra' => array('sitebar_client', 'sitebar', 'sidebar', 'livebookmarks', 'search_engine', 'iframe', 'google')), 'konqueror' => array('label' => 'Konqueror', 'homepage' => 'http://www.konqueror.org/', 'platforms' => '3.x/Linux', 'usage' => '', 'exclude' => array(), 'extra' => array('sidebar_konqueror', 'iframe', 'google')), 'opera' => array('label' => 'Opera Web Browser', 'homepage' => 'http://www.opera.com/', 'platforms' => '9.5/WinXP', 'usage' => SB_P('integrator::usage_opera'), 'exclude' => array('dir'), 'extra' => array('hotlist', 'iframe', 'google')), 'msie' => array('label' => 'Microsoft Internet Explorer', 'homepage' => 'http://www.microsoft.com/windows/ie/default.mspx', 'platforms' => '8.0/Windows', 'usage' => '', 'exclude' => array(), 'extra' => array('install', 'uninstall', 'searchbar', 'iframe', 'google')), 'maxthon' => array('label' => 'Maxthon Tabbed Browser', 'homepage' => 'http://www.maxthon.com/', 'platforms' => '1.1.120/WinXP', 'usage' => '', 'exclude' => array(), 'extra' => array('maxthon_sidebar', 'maxthon_toolbar', 'iframe', 'google')), 'other' => array('label' => 'Linux Distro/Other Tools', 'homepage' => '', 'platforms' => 'Gentoo,Debian/PHP Layers Menu', 'usage' => '', 'exclude' => array('dir', 'window', 'popup', 'addpage'), 'extra' => array('gentoo', 'debian', 'phplm'))); $bookmarklet = "javascript:var w=window;var d=w.document;var cp=d.characterSet?d.characterSet:d.charset;" . "w.open('" . SB_Page::absBaseUrl() . "command.php?command=Add%20Bookmark" . "&url='+escape(w.location.href)+'" . "&name='+escape(d.title)+" . "(cp?'&cp='+cp:''),'sbBmkWin','" . $um->getParamB64('user', 'popup_params') . "');void(0)";
function create() { SB_Page::head('Edit Translation', 'siteBarLocale'); ?> <h2>Create Translation</h2> [<a href="translator.php">Back to Translation List</a>] <p> <?php if (isset($_REQUEST['save'])) { $ok = true; foreach (array('newdir', 'language', 'author', 'url') as $name) { if (!isset($_REQUEST[$name]) || !strlen($_REQUEST[$name])) { $ok = false; echo "Field {$name} must be filled!<br>"; } } if ($ok) { $lang = $_REQUEST['newdir']; if (!mkdir('./locale/' . $lang)) { $this->writeErrors(true); die('Cannot create directory!'); } chmod('./locale/' . $lang, 0777); foreach ($this->parts as $part => $param) { $file = sprintf($this->fmt, $lang, $param['file']); if (!($fh = fopen($file, 'w'))) { $this->writeErrors(true); die("Cannot create file {$file}!"); } fwrite($fh, "<?php \${$part} = array(); ?>"); fclose($fh); chmod($file, 0666); } $file = sprintf($this->fmt, $lang, "info.inc.php"); if (!($fh = fopen($file, 'w'))) { die("Cannot create file {$file}!"); } $text = <<<_INFO <?php \$info = array ( 'language' => '{$_REQUEST['language']}', 'authors' => array ( '{$_REQUEST['author']}' => '{$_REQUEST['url']}', ), ); ?> _INFO; fwrite($fh, $text); fclose($fh); chmod($file, 0666); echo 'Directory created!'; } } else { ?> <form method="POST"> <table> <tr> <th>Directory</th> <td><input name="newdir"></td> </tr> <tr> <th>Language</th> <td><input name='language'></td> </tr> <tr> <th>Author</th> <td><input name='author'></td> </tr> <tr> <th>URL</th> <td><input name='url'></td> </tr> </table> <input type='submit' name='save' value='Submit'> <input type='reset'> </form> <?php } if (!defined("EMBEDDED")) { SB_Page::foot(); } }
function drawHeadPage() { $inPlaceCmds = implode("','", $this->um->inPlaceCommands()); SB_Page::head(null, null, "SB_initPage( new Array('{$inPlaceCmds}'));\nSB_gWinPrefs = '" . $this->um->getParamB64('user', 'popup_params') . "';", "SB_onLoad();", '<meta name="viewport" content="width=320, user-scalable=no, minimum-scale=1">' . "\n"); $style = ''; if (SB_Page::isMSIE()) { //JIGSAW doesn't validate $style = ' style="filter: alpha(opacity=50);"'; } echo '<div id="dragNodeIcon"' . $style . '><img class="favicon" src="' . SB_Skin::imgsrc('node') . '" alt=""></div>' . "\r"; echo '<div id="dragLinkIcon"' . $style . '><img class="favicon" src="' . SB_Skin::imgsrc('link') . '" alt=""></div>' . "\r"; echo '<div id="hidden" class="hidden">' . "\r"; $this->drawJavaScriptData(); // Optimization for MSIE to keep images in the cache if (SB_Page::isMSIE()) { $images = array('collapse', 'connect', 'empty', 'filter', 'join', 'join_last', 'link', 'link_private', 'link_wrong_favicon', 'logo', 'menu', 'minus', 'minus_last', 'node', 'node_open', 'plus', 'plus_last', 'reload', 'reload_all', 'root', 'root_deleted', 'root_plus', 'root_transparent', 'search'); foreach ($images as $image) { echo ' ' . SB_Skin::img($image) . "\r"; } } echo "</div>\r"; }
} else { $cw->onLoad = 'window.close()'; } } /** * I do not need instance, I just need to call static functions. * As of PHP 4.3.1 it will generate strange warning in case * bookmarkmanager issued an error() on import(). I cannot see * any relevance because SB_Page does not inherit from SB_ErrorHandler. * But it is indeed related to SB_ErrorHandler (when removing & from * declaration of getErrors() it works, but errors cannot be * reported then. Too curious for reporting and PHP 5 adds * static members what should solve the problem in future. */ $page = new SB_Page(); $page->head('Commander', 'siteBarCmdWin', null, $cw->onLoad, $metaTag); $errId = $cw->hasErrors() && $cw->hasErrors(E_ERROR) ? 'error' : 'warn'; $onlineHelp = 'http://sitebar.org/help.php?command=' . urlencode($cw->command) . '&version=' . STATIC_VERSION . '&lang=' . SB_GetLanguage(); ?> <div id="<?php echo ($cw->hasErrors() ? $errId : 'command') . 'Head'; ?> " class="cmnTitle"> <div id="help" onclick="SB_openHelp('<?php echo $onlineHelp; ?> ')">?</div> <div id="command"><?php echo SB_T($cw->command); ?> </div>