Example #1
0
function helppagelink($ocpage, $title = 'Instructions')
{
    global $translate;
    $helpurl = helppageurl($ocpage);
    if ($helpurl == "") {
        return "";
    } else {
        $imgtitle = $translate->t($title, '', basename(__FILE__), __LINE__);
        $imgtitle = "alt='" . $imgtitle . "' title='" . $imgtitle . "'";
        return "<a class='nooutline' href='" . $helpurl . "' " . $imgtitle . " target='_blank'>";
    }
}
Example #2
0
 *
 *  Unicode Reminder メモ
 ***************************************************************************/
require './lib2/web.inc.php';
//get the article name to display
$article = '';
$language = $opt['template']['locale'];
if (isset($_REQUEST['page']) && mb_strpos($_REQUEST['page'], '.') === false && mb_strpos($_REQUEST['page'], '/') === false && mb_strpos($_REQUEST['page'], '\\') === false) {
    $article = $_REQUEST['page'];
}
if ($article == '') {
    //no article specified
    $tpl->redirect('index.php');
} else {
    if (isset($_REQUEST['wiki'])) {
        $tpl->redirect(helppageurl($article));
    } else {
        if (!file_exists($opt['stylepath'] . '/articles/' . $language . '/' . $article . '.tpl')) {
            // does article exist in default-language?
            if (file_exists($opt['stylepath'] . '/articles/' . $opt['template']['default']['article_locale'] . '/' . $article . '.tpl')) {
                $language = $opt['template']['default']['article_locale'];
            } elseif (file_exists($opt['stylepath'] . '/articles/EN/' . $article . '.tpl')) {
                $language = 'EN';
            } else {
                // use any
                $language = false;
                if ($hDir = opendir($opt['stylepath'] . '/articles/')) {
                    while (($sFile = readdir($hDir)) !== false && $language === false) {
                        if ($sFile != '.' && $sFile != '..' && is_dir($opt['stylepath'] . '/articles/' . $sFile)) {
                            if (file_exists($opt['stylepath'] . '/articles/' . $sFile . '/' . $article . '.tpl')) {
                                $language = $sFile;