Esempio n. 1
0
">
<head>
	<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0">
	<title><?php 
echo htmlspecialchars($context->getProperty('blog.title'));
?>
 &gt; <?php 
echo $blogMenu['title'];
?>
</title>
	<link rel="stylesheet" type="text/css" media="screen" href="<?php 
echo $context->getProperty('service.path') . $context->getProperty('panel.skin');
?>
/basic.css" />
<?php 
$browser = Utils_Browser::getInstance();
if ($browser->isMobile()) {
    ?>
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<?php 
}
if ($context->getProperty('blog.useBlogIconAsIphoneShortcut') == true && file_exists(__TEXTCUBE_ATTACH_DIR__ . "/" . $context->getProperty('blog.id') . "/index.gif")) {
    ?>
	<link rel="apple-touch-icon" href="<?php 
    echo $context->getProperty('uri.default') . "/index.gif";
    ?>
" />
<?php 
}
// common CSS.
foreach ($blogMenu['loadCSS'] as $loadCSS) {
Esempio n. 2
0
function printOwnerEditorScript($entryId = false)
{
    global $pluginURL, $pluginName, $configMappings;
    $contentWidth = 500;
    $context = Model_Context::getInstance();
    $browser = Utils_Browser::getInstance();
    if ($browser->isMobile()) {
        $contentWidth = 270;
    } else {
        $contentWidth = Utils_Misc::getContentWidth();
        /*
                if($skin = $context->getProperty('skin.skin')) {
                    if($xml = @file_get_contents(ROOT."/skin/blog/$skin/index.xml")) {
                        $xmls = new XMLStruct();
                        $xmls->open($xml, $context->getProperty('service.encoding'));
                        if($xmls->getValue('/skin/default/contentWidth')) {
                            $contentWidth = $xmls->getValue('/skin/default/contentWidth');
                        }
                    }
                }*/
    }
    ?>
    <script type="text/javascript">
        //<![CDATA[
        var entryId = <?php 
    echo $entryId ? $entryId : 0;
    ?>
;
        var skinContentWidth = <?php 
    echo $contentWidth;
    ?>
;

        function savePosition(oTextarea) {
            if (oTextarea.createTextRange)
                oTextarea.currentPos = document.selection.createRange().duplicate();
        }

        function insertTag(oTextarea, prefix, postfix) {
            if (isSafari && !isMinSafari3)
                var selection = window.getSelection;
            else
                var selection = document.selection;

            if (selection) {
                if (oTextarea.createTextRange && oTextarea.currentPos) {
                    oTextarea.currentPos.text = prefix + oTextarea.currentPos.text + postfix;
                    oTextarea.focus();
                    savePosition(oTextarea);
                }
                else
                    oTextarea.value = oTextarea.value + prefix + postfix;
            }
            else if (oTextarea.selectionStart != null && oTextarea.selectionEnd != null) {
                var s1 = oTextarea.value.substring(0, oTextarea.selectionStart);
                var s2 = oTextarea.value.substring(oTextarea.selectionStart, oTextarea.selectionEnd);
                var s3 = oTextarea.value.substring(oTextarea.selectionEnd);
                oTextarea.value = s1 + prefix + s2 + postfix + s3;
            }
            else
                oTextarea.value += prefix + postfix;

            return true;
        }

        function editorChanged() {
            if ((entryManager != undefined) && (entryManager.stateChanged != undefined))
                entryManager.stateChanged();
        }

        function getEditor() {
            <?php 
    $setEditor = $context->getProperty('editor.key');
    /// CHANGED FROM 1.8 : Editor only loads what user is using.
    foreach (getAllEditors() as $id => $editor) {
        if ($id == $setEditor) {
            getEditorInfo($id);
            // explicitly loads plugin code ($pluginURL, $pluginName returned as global)
            if (isset($editor['initfunc']) && function_exists($editor['initfunc'])) {
                echo "\t\t\n" . call_user_func_array($editor['initfunc'], array(&$editor)) . "\t\t\n";
                $pluginURL = $pluginName = "";
                $context->unsetProperty('plugin.url');
                $context->unsetProperty('plugin.name');
            }
        }
    }
    ?>
            return new TTDefaultEditor();
        }

        var editor = null;
        function setCurrentEditor(key, formatter) {
            var neweditor = getEditor();
            if (neweditor == null) {
                if (editor == null) {
                    // this indicates currently selected editor is unavailable;
                    // we fallback into the default editor.
                    neweditor = new TTDefaultEditor();
                } else {
                    return false;
                }
            }
//		if (editor != null) {
//			try { editor.syncTextarea(); } catch(e) {}
//			editor.finalize();
//		}
            editor = neweditor;
            editor.formatter = formatter;
            editor.initialize(document.getElementById("editWindow"));
            return true;
        }

        function changeEditor(key, formatter) {
            if (entryManager.nowsaving == true) {
                alert("<?php 
    echo _t('현재 자동 저장 중입니다. 저장이 완료된 후 다시 시도해 주세요.');
    ?>
");
                return false;
            }
            if (!confirm("<?php 
    echo _t('정말로 에디터를 변경하시겠습니까?');
    ?>
")) {
                return false;
            }
            if (editor != null) {
                try {
                    editor.syncTextarea();
                } catch (e) {
                }
                editor.finalize();
            }
            entryManager.changeEditor = true;
            entryManager.currentEditor = key;
            entryManager.saveDraft();
        }

        function reloadEditor() {
            var url = '<?php 
    echo $context->getProperty('uri.blog') . "/owner/entry/edit/";
    ?>
' + entryManager.entryId + '?editor=' + entryManager.currentEditor;

            if (entryManager.draftSaved == true) {
                url = url + '&draft=true';
            }
            if (entryManager.returnURL != null) {
                url = url + '&returnURL=' + encodeURIComponent(entryManager.returnURL);
            }
            window.location = url;
        }
        //]]>
    </script>
    <?php 
    printFormatterSelectScript();
}