Skip to content
Browse files

Implements/Fixes Link Browser (Source Selector) for CKeditor & FCKedi…

…tor for both pages and sections. Uncovers an anomaly in CKeditor which encodes all returns

[#34 state:resolved]
  • Loading branch information...
1 parent 641672c commit 42f362a8af20763f899999f3cafbf9a5dea7805c @dleffler dleffler committed Mar 15, 2011
View
16 content_selector.php
@@ -2,7 +2,7 @@
##################################################
#
-# Copyright (c) 2004-2006 OIC Group, Inc.
+# Copyright (c) 2004-2011 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
@@ -20,15 +20,21 @@
define('SCRIPT_EXP_RELATIVE','');
define('SCRIPT_FILENAME','content_selector.php');
-// Initialize the Exponent Framework
-include_once('exponent.php');
/* exdoc
* Define Content Selector constant as 1, since we are not selecting orphaned content.
* @node General
*/
define('CONTENT_SELECTOR',1);
+// Initialize the Exponent Framework
+include_once('exponent.php');
+$section = $router->getSection();
+$sectionObj = $router->getSectionObj($section);
+
+// Call the real selector script. It will use the value of CONTENT_SELECTOR to determine what it needs to do.
+include_once('selector.php');
+
// Include the Selector script, which does all of the real work.
-include_once(dirname(__realpath(__FILE__)).'/selector.php');
+//include_once(dirname(__realpath(__FILE__)).'/selector.php');
-?>
+?>
View
23 external/editors/ckconnector/content_linked.php
@@ -1,23 +0,0 @@
-<?php
-define("SCRIPT_EXP_RELATIVE","external/editors/ckconnector/");
-define("SCRIPT_FILENAME","content_linked.php");
-
-require_once("../../../exponent.js.php");
-global $router;
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <script type="text/javascript">
- /* <![CDATA[ */
- var f_url = window.opener.document.getElementById("f_href");
- f_url.value = "<?php echo $router->buildUrlByPageId(exponent_sessions_get("last_section")); ?>#mod_<?php echo $_GET['cid']; ?>";
- var f_extern = window.opener.document.getElementById("f_extern");
- f_extern.checked = false;
- //TODO: find a way(maybe via containermod:_source_picker.tpl) to pass the title of the contained module to the Link Picker
- window.close();
- /* ]]> */
- </script>
- </head>
- <body/>
-</html>
View
263 external/editors/ckconnector/insert_image.php
@@ -1,263 +0,0 @@
-<?PHP
- define("SCRIPT_EXP_RELATIVE","external/editors/ckconnector/");
- define("SCRIPT_FILENAME","insert_image.php");
-
- require_once("../../../exponent.php");
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Insert/Modify Image</title>
-
- <script type="text/javascript" src="../../../exponent.js.php"></script>
- <script type="text/javascript" src="popup.js"></script>
- <script type="text/javascript" src="<?PHP echo PATH_RELATIVE . 'external/editors/ckconnector/lang/' . exponent_lang_convertLangCode(LANG) . '.js';?>"></script>
- <script type="text/javascript">
- /* <![CDATA[ */
- I18N = eXp._TR;
-
- function i18n(str) {
- return (eXp._TR[str] || str);
- };
-
- function efm_pickedFile(file_id,file_path) {
- document.getElementById("f_url").value = file_path;
- window.onPreview();
- }
-
- function Init() {
- __dlg_translate(eXp._TR);
- __dlg_init();
- var param = window.dialogArguments;
-
- if (param) {
- document.getElementById("f_url").value = param["f_url"];
- document.getElementById("f_alt").value = param["f_alt"];
- document.getElementById("f_border").value = param["f_border"];
- document.getElementById("f_align").value = param["f_align"];
- document.getElementById("f_vert").value = param["f_vert"];
- document.getElementById("f_horiz").value = param["f_horiz"];
-
- if (param.f_url.substr(0,7) == "http://") {
- window.ipreview.location.replace(param.f_url);
- }
- else {
- window.ipreview.location.replace(eXp.PATH_RELATIVE + param.f_url);
- }
- }
-
- document.getElementById("f_url").focus();
- };
-
-
- function onOK() {
- var required = {"f_url": "You must enter the URL" };
-
- for (var i in required) {
- var el = document.getElementById(i);
-
- if (!el.value) {
- alert(required[i]);
- el.focus();
- return false;
- }
- } // pass data back to the calling window
-
- var fields = ["f_url", "f_alt", "f_align", "f_border","f_horiz", "f_vert"];
- var param = new Object();
-
- for (var i in fields) {
- var id = fields[i];
- var el = document.getElementById(id);
- param[id] = el.value;
- }
-
- // TinyMCE integration, indicates this comes from an image browser
- param["f_dialogType"] = "Image";
-
- __dlg_close(param);
- window.close();
- return false;
- };
-
-
- function onCancel() {
- __dlg_close(null);
- window.close();
- return false;
- };
-
-
- function onPreview() {
- var f_url = document.getElementById("f_url");
- var url = f_url.value;
-
- if (!url) {
- alert("You have to enter an URL first");
- f_url.focus();
- return false;
- };
-
- if (url.substr(0,7) == "http://") {
- window.ipreview.location.replace(url);
- } else {
- window.ipreview.location.replace(eXp.PATH_RELATIVE + url);
- }
-
- return false;
- };
-
- function onBrowse() {
- window.open("../../../modules/filemanagermodule/actions/picker.php?id=0", "Browser");
- return false;
-
- // window.open("../../../source_selector.php?showmodules=imagemanagermodule&dest=&vmod=imagemanagermodule&vview=_sourcePicker&hideOthers=1","palette","toolbar=no,title=no,width=640,height=480,scrollbars=yes");
- }
- /* ]]> */
- </script>
- <style type="text/css">
- /* <![CDATA[ */
- html, body {
- background: ButtonFace;
- color: ButtonText;
- font: 11px
- Tahoma,Verdana,sans-serif;
- margin: 0px;
- padding: 0px;
- }
- body {
- padding: 5px;
- }
- table {
- font: 11px Tahoma,Verdana,sans-serif;
- }
- form p {
- margin-top: 5px;
- margin-bottom: 5px;
- }
- .fl {
- width: 9em;
- float: left;
- padding: 2px 5px;
- text-align: right;
- }
- .fr {
- width: 6em;
- float: left;
- padding: 2px 5px;
- text-align: right;
- }
- fieldset {
- padding: 0px 10px 5px 5px;
- }
- select, input, button {
- font: 11px Tahoma,Verdana,sans-serif;
- }
- button {
- width: 70px;
- }
- .space {
- padding: 2px;
- }
- .title {
- background: #ddf;
- color: #000;
- font-weight: bold;
- font-size: 120%;
- padding: 3px 10px;
- margin-bottom: 10px;
- border-bottom: 1px solid black;
- letter-spacing: 2px;
- }
- form {
- padding: 0px;
- margin: 0px;
- }
- /* ]]> */
- </style>
-</head>
-<body onload="Init()">
- <div class="title">Insert/Modify Image</div>
- <!--- new stuff -->
- <form action="" method="get">
- <table border="0" width="100%" style="padding: 0px; margin: 0px">
- <tbody>
- <tr>
- <td style="width: 7em; text-align: right">Image URL</td>
-
- <td>
- <input type="text" name="url" id="f_url" style="width:75%" title="Enter the image URL here" onchange="onPreview();" />
- <button name="preview" onclick="return onBrowse();" title="Browse Uploaded Images and Select One">Browse</button>
- <!-- Taken out to tie ImageManager in <button name="preview" onclick="return onPreview();" title="Preview the image in a new window">Preview</button> -->
- </td>
- </tr>
- <tr>
- <td style="width: 7em; text-align: right">Alternate Text</td>
-
- <td>
- <input type="text" name="alt" id="f_alt" style="width:100%" title="For browsers that don't support images"/>
- </td>
- </tr>
- </tbody>
- </table>
- <p/>
- <fieldset style="float: left; margin-left: 5px;">
- <legend>Layout</legend>
-
- <div class="space"/>
-
- <div class="fl">Alignment</div>
- <select size="1" name="align" id="f_align" title="Positioning of this image">
- <option value="">Not Set</option>
- <option value="left">Left</option>
- <option value="right">Right</option>
- <option value="texttop">Texttop</option>
- <option value="absmiddle">Absmiddle</option>
- <option value="baseline" selected="1">Baseline</option>
- <option value="absbottom">Absbottom</option>
- <option value="bottom">Bottom</option>
- <option value="middle">Middle</option>
- <option value="top">Top</option>
- </select>
-
- <p/>
-
- <div class="fl">Border Thickness</div>
- <input type="text" name="border" id="f_border" size="5" title="Leave empty for no border"/>
-
- <div class="space"/>
- </fieldset>
- <fieldset style="float:right; margin-right: 5px;">
- <legend>Spacing</legend>
-
- <div class="space"/>
-
- <div class="fr">Horizontal</div>
- <input type="text" name="horiz" id="f_horiz" size="5" title="Horizontal padding"/>
-
- <p/>
-
- <div class="fr">Vertical</div>
- <input type="text" name="vert" id="f_vert" size="5" title="Vertical padding"/>
-
- <div class="space"/>
-
- </fieldset>
-
- <br clear="all"/>
-
- <table width="100%" style="margin-bottom: 0.2em">
- <tr>
- <td valign="bottom">
- <span>Image Preview</span><br/>
- <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="300" src=""></iframe>
- </td>
- <td valign="bottom" style="text-align: right">
- <button type="button" name="ok" onclick="return onOK();">OK</button><br/>
- <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
- </td>
- </tr>
- </table>
- </form>
-</body>
-</html>
View
50 external/editors/ckconnector/lang/de.js
@@ -1,50 +0,0 @@
-// german version for htmlArea v3.0 - Alpha Release
-// - translated by AtK<atk@chello.at>
-// term�s and licenses are equal to htmlarea!
-// translation improved by broxx<broxx@broxx.com>
-
-eXp._TR = {
- "Select a Page, or Content" : "Verweise auf Seiten oder Inhalte",
- "Link to a Page" : "Verweis auf Seite",
- "Link to Content" : "Verweis auf Inhalt",
- "Internal Links" : "Interne Verweise",
- "Manually Enter Address" : "Adresse Manuell Eingeben",
- "External Website" : "Externe Website",
- "Additional Link Options" : "Zus�tzliche Optionen",
- "Cancel" : "Abbrechen",
- "Insert/Modify Link" : "Internet-Link Anlegen/Ver�ndern",
- "New window (_blank)" : "In neuem Fenster �ffnen (_blank)",
- "None (use implicit)" : "Keines (implicit)",
- "OK" : "OK",
- "Other" : "Sonstiges",
- "Same frame (_self)" : "Im selben Rahmen (_self)",
- "Target" : "Ziel",
- "Title (tooltip)" : "Titel (tooltip)",
- "Top frame (_top)" : "Im obersten Rahmen (_top)",
- "URL" : "URL",
- "You must enter the URL where this link points to" : "Sie m�ssen eine Ziel-URL ausw�hlen/eingeben !",
- "Image Preview" : "Voransicht",
- "Alignment" : "Anordnung",
- "Border Thickness" : "St�rke der R�nder",
- "Spacing" : "Abst�nde",
- "Not Set" : "k. A.",
- "Left" : "Links",
- "Right" : "Rechts",
- "Top" : "Oben",
- "Middle" : "Mitte",
- "Bottom" : "Unten",
- "Baseline" : "Grundlinie",
- "Image URL" : "Bild URL",
- "Alternate Text" : "Alternativer Text",
- "Horizontal" : "Horizontal",
- "Vertical" : "Vertikal",
- "Insert/Modify Image" : "Bild Einf�gen/Ver�ndern",
- "Browse" : "Durchsuchen",
- "Enter the image URL here" : "Bitte die Internetadresse(URL) des Bildes eingeben",
- "Browse Uploaded Images and Select One" : "Ein Bild aus der Gallerie w�hlen",
- "For browsers that don't support images" : "Alternative f�r Browser ohne Bilddarstellung",
- "Positioning of this image" : "Position des Bildes",
- "Leave empty for no border" : "Leerlassen, wenn keine R�nder gew�nscht",
- "Horizontal padding" : "Horizontaler Abstand",
- "Vertical padding" : "Vertikaler Abstand"
-};
View
5 external/editors/ckconnector/lang/en.js
@@ -1,5 +0,0 @@
-// Placeholder
-
-eXp._TR = {
- };
-
View
231 external/editors/ckconnector/link.php
@@ -1,231 +0,0 @@
-<?PHP
- define("SCRIPT_EXP_RELATIVE","external/editors/ckconnector/");
- define("SCRIPT_FILENAME","link.php");
-
- require_once("../../../exponent.php");
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-
- <head>
- <title>Insert/Modify Link</title>
-
- <script type="text/javascript" src="../../../exponent.js.php"></script>
- <script type="text/javascript" src="popup.js"></script>
- <script type="text/javascript" src="<?PHP echo PATH_RELATIVE . 'external/editors/ckconnector/lang/' . exponent_lang_convertLangCode(LANG) . '.js'?>"></script>
- <script type="text/javascript">
- /* <![CDATA[ */
- var I18N = eXp.I18N;
-
-
- function i18n(str) {
- return (I18N[str] || str);
- };
-
- function onTargetChanged() {
- var f = document.getElementById("f_other_target");
- if (this.value == "_other") {
- f.style.visibility = "visible";
- f.select();
- f.focus();
- } else f.style.visibility = "hidden";
- };
-
- function Init() {
- __dlg_translate(eXp._TR);
- __dlg_init();
- var param = window.dialogArguments;
- var target_select = document.getElementById("f_target");
- if (param) {
- document.getElementById("f_href").value = param["f_href"];
- document.getElementById("f_extern").checked = (param["f_href"].substr(0,7) == "http://");
- document.getElementById("f_title").value = param["f_title"];
- comboSelectValue(target_select, param["f_target"]);
- if (target_select.value != param.f_target) {
- var opt = document.createElement("option");
- opt.value = param.f_target;
- opt.innerHTML = opt.value;
- target_select.appendChild(opt);
- opt.selected = true;
- }
- }
- var opt = document.createElement("option");
- opt.value = "_other";
- opt.innerHTML = eXp.i18n("Other");
- target_select.appendChild(opt);
- target_select.onchange = onTargetChanged;
- document.getElementById("f_href").focus();
- document.getElementById("f_href").select();
- };
-
-
- function onOK() {
- var required = {"f_href": "You must enter the URL where this link points to"};
-
- for (var i in required) {
- var el = document.getElementById(i);
- if (!el.value) {
- alert(required[i]);
- el.focus();
- return false;
- }
- }
-
- var el = document.getElementById("f_href");
- if (el.value.substr(0,7) != "http://") {
- var cb = document.getElementById("f_extern");
- if (cb.checked == true) {
- //alert("External!");
- //el.setAttribute("value","http://"+el.value);
- el.value = "http://"+el.value;
- } else {
- //alert("Not External");
- }
- //return false;
- }
- // pass data back to the calling window
- var fields = ["f_href", "f_title", "f_target"];
- var param = new Object();
- for (var i in fields) {
- var id = fields[i];
- var el = document.getElementById(id);
- param[id] = el.value;
- }
- if (param.f_target == "_other") {
- param.f_target = document.getElementById("f_other_target").value;
- }
-
- // TinyMCE integration, indicates this comes from a link browser
- param["f_dialogType"] = "Link";
-
- __dlg_close(param);
- return false;
- };
-
- function onCancel() {
- __dlg_close(null);
- return false;
- };
-
- function openSectionLinker() {
- window.open("../../../modules/navigationmodule/nav.php?linkbase="+escape("../../external/editors/ckconnector/section_linked.php?dummy"),"sectionlinker","toolbar=no,title=no,width=250,height=480,scrollbars=yes");
- }
-
- function openContentLinker() {
- window.open("../../../content_selector.php?dest="+escape("external/editors/ckconnector/content_linked.php?dummy")+"&vview=_linkPicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=640,height=480,scrollbars=yes");
- }
- /* ]]> */
- </script>
-
- <style type="text/css">
- /* <![CDATA[ */
- html, body {
- background: ButtonFace;
- color: ButtonText;
- font: 11px Tahoma,Verdana,sans-serif;
- margin: 0px;
- padding: 0px;
- }
- body {
- padding: 5px;
- }
- table {
- font: 11px Tahoma,Verdana,sans-serif;
- }
- select, input, button {
- font: 11px Tahoma,Verdana,sans-serif;
- }
- button {
- width: 70px;
- }
- table .label {
- text-align: right;
- font-weight: normal;
- vertical-align: top;
- width: 8em;
- }
-
- .title {
- background: #ddf;
- color: #000;
- font-weight: bold;
- font-size: 120%;
- padding: 3px 10px;
- margin-bottom: 10px;
- border-bottom: 1px
- solid black;
- letter-spacing: 2px;
- }
-
- a {
- text-decoration: none;
- color: rgb(97,115,132);
- font-weight: bold;
- }
-
- #buttons {
- margin-top: 1em;
- border-top: 1px
- solid #999;
- padding: 2px;
- text-align: right;
- }
- /* ]]> */
- </style>
-
- </head>
-
- <body onload="Init()">
- <div class="title">Insert/Modify Link</div>
-
- <table border="0" style="width: 100%;">
- <tbody>
- <tr>
- <td colspan="2"><hr size="1" /><a class="header">Select a Page, or Content</a></td>
- </tr>
- <tr>
- <td class="label">Internal Links</td>
- <td align="center">
- <a href="#" onclick="openSectionLinker(); return false;">Link to a Page</a>&nbsp;|&nbsp;<a href="#" onclick="openContentLinker(); return false;">Link to Content</a>
- </td>
- </tr>
- <tr>
- <td colspan="2"><hr size="1" /><a class="header">Manually Enter Address</a></td>
- </tr>
- <tr>
- <td class="label">URL</td>
- <td><input type="text" id="f_href" style="width: 100%" /></td>
- </tr>
- <tr>
- <td class="label">&nbsp;</td>
- <td ><input type="checkbox" id="f_extern" checked="checked" /><a class="label">External Website</a></td>
- </tr>
- <tr>
- <td colspan="2"><hr size="1" /><a class="header">Additional Link Options</a></td>
- </tr>
- <tr>
- <td class="label">Title (tooltip)</td>
- <td><input type="text" id="f_title" style="width: 100%" /></td>
- </tr>
- <tr>
- <td class="label">Target</td>
- <td>
- <select id="f_target">
- <option value="">None (use implicit)</option>
- <option value="_blank">New window (_blank)</option>
- <option value="_self">Same frame (_self)</option>
- <option value="_top">Top frame (_top)</option>
- </select>
- <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />
- </td>
- </tr>
- </tbody>
- </table>
-
- <div id="buttons">
- <button type="button" name="ok" onclick="return onOK();">OK</button>
- <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
- </div>
-
- </body>
-</html>
View
118 external/editors/ckconnector/popup.js
@@ -1,118 +0,0 @@
-// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
-// This copyright notice MUST stay intact for use (see license.txt).
-//
-// Portions (c) dynarch.com, 2003
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon.
-// http://dynarch.com/mishoo
-//
-// $Id$
-// v 1.3 2005/12/15 MaxxCorp
-
-function getAbsolutePos(el) {
- var r = { x: el.offsetLeft, y: el.offsetTop };
- if (el.offsetParent) {
- var tmp = getAbsolutePos(el.offsetParent);
- r.x += tmp.x;
- r.y += tmp.y;
- }
- return r;
-};
-
-function comboSelectValue(c, val) {
- var ops = c.getElementsByTagName("option");
- for (var i = ops.length; --i >= 0;) {
- var op = ops[i];
- op.selected = (op.value == val);
- }
- c.value = val;
-};
-
-function __dlg_onclose() {
- opener.Dialog._return(null);
-};
-
-function __dlg_init(bottom) {
- var body = document.body;
- var body_height = 0;
- if (typeof bottom == "undefined") {
- var div = document.createElement("div");
- body.appendChild(div);
- var pos = getAbsolutePos(div);
- body_height = pos.y;
- } else {
- var pos = getAbsolutePos(bottom);
- body_height = pos.y + bottom.offsetHeight;
- }
- window.dialogArguments = opener.Dialog._arguments;
- if (!document.all) {
- window.sizeToContent();
- window.sizeToContent(); // for reasons beyond understanding,
- // only if we call it twice we get the
- // correct size.
- window.addEventListener("unload", __dlg_onclose, true);
- // center on parent
- var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
- var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
- window.moveTo(x, y);
- window.innerWidth = body.offsetWidth + 5;
- window.innerHeight = body_height + 2;
- } else {
- // window.dialogHeight = body.offsetHeight + 50 + "px";
- // window.dialogWidth = body.offsetWidth + "px";
- window.resizeTo(body.offsetWidth, body_height);
- var ch = body.clientHeight;
- var cw = body.clientWidth;
- window.resizeBy(body.offsetWidth - cw, body_height - ch);
- var W = body.offsetWidth;
- var H = 2 * body_height - ch;
- var x = (screen.availWidth - W) / 2;
- var y = (screen.availHeight - H) / 2;
- window.moveTo(x, y);
- }
- document.body.onkeypress = __dlg_close_on_esc;
-};
-
-function __dlg_translate(i18n) {
- var types = ["span", "option", "td", "button", "div", "legend", "a", "input", "select"];
- for (var type in types) {
- var spans = document.getElementsByTagName(types[type]);
- for (var i = spans.length; --i >= 0;) {
- var span = spans[i];
- if (span.firstChild && span.firstChild.data) {
- var txt = i18n[span.firstChild.data];
- if (txt)
- span.firstChild.data = txt;
- }
- if (span.getAttributeNode("title")) {
- var txt = i18n[span.getAttribute("title")];
- if (txt) {
- span.setAttribute("title", txt);
- }
- }
- }
- }
- var txt = i18n[document.title];
- if (txt)
- document.title = txt;
-};
-
-// closes the dialog and passes the return info upper.
-function __dlg_close(val) {
- if (typeof opener.Dialog._return != 'undefined') {
- opener.Dialog._return(val);
- }
- window.close();
-};
-
-function __dlg_close_on_esc(ev) {
- ev || (ev = window.event);
- if (ev.keyCode == 27) {
- window.close();
- return false;
- }
- return true;
-};
View
73 external/editors/ckconnector/section_linked.php
@@ -1,73 +0,0 @@
-<?php
-
-##################################################
-#
-# Copyright (c) 2004-2005 James Hunt and the OIC Group, Inc.
-#
-# This file is part of Exponent
-#
-# Exponent is free software; you can redistribute
-# it and/or modify it under the terms of the GNU
-# General Public License as published by the Free
-# Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# Exponent is distributed in the hope that it
-# will be useful, but WITHOUT ANY WARRANTY;
-# without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU
-# General Public License along with Exponent; if
-# not, write to:
-#
-# Free Software Foundation, Inc.,
-# 59 Temple Place,
-# Suite 330,
-# Boston, MA 02111-1307 USA
-#
-# $Id: section_linked.php 1984 2007-11-27 22:51:14Z kessler44 $
-##################################################
-
-# Thanks to Daniel Grabert for this patch. - 1/12/05
- define("SCRIPT_EXP_RELATIVE","external/editors/ckconnector/");
- define("SCRIPT_FILENAME","section_linked.php");
- require_once("../../../exponent.php");
-
- if (empty($_REQUEST['section'])) {
- // bad request - no section found
-
- // go back to referring page, if available
- $referer_url = $_SERVER['HTTP_REFERER'];
- if ( $referer_url ) {
- header("Location: $referer_url");
- } else {
- echo SITE_403_HTML;
- exit();
- }
- }
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <body>
- <script type="text/javascript">
- var f_url = window.opener.document.getElementById("f_href");
- var f_extern = window.opener.document.getElementById("f_extern");
- var f_title = window.opener.document.getElementById("f_title");
-
- // set value for url form element in opener
- f_url.value = "<?php echo $router->buildUrlByPageId($_REQUEST['section']); ?>";
-
- // uncheck external link box in parent window
- f_extern.checked = false;
-
- // set title
- f_title.value = "<?php echo 'Link to page ' . $_REQUEST['section_name']; ?>";
-
- window.close();
- </script>
- </body>
-</html>
-
View
17 ...nal/editors/ckconnector/CKeditor_link.php → external/editors/connector/CKeditor_link.php
@@ -1,5 +1,5 @@
<?PHP
- define("SCRIPT_EXP_RELATIVE","external/editors/ckconnector/");
+ define("SCRIPT_EXP_RELATIVE","external/editors/connector/");
define("SCRIPT_FILENAME","CKeditor_link.php");
require_once('../../../exponent.php');
@@ -12,7 +12,7 @@
<script type="text/javascript" src="<?PHP echo PATH_RELATIVE ?>exponent.js.php"></script>
<script type="text/javascript" src="popup.js"></script>
- <script type="text/javascript" src="<?PHP echo PATH_RELATIVE . 'external/editors/ckconnector/lang/' . exponent_lang_convertLangCode(LANG) . '.js'?>"></script>
+ <script type="text/javascript" src="<?PHP echo PATH_RELATIVE . 'external/editors/connector/lang/' . exponent_lang_convertLangCode(LANG) . '.js'?>"></script>
<script type="text/javascript">
/* <![CDATA[ */
I18N = eXp.I18N;
@@ -43,7 +43,7 @@ function onOK() {
// CKeditor integration
var funcNum = getUrlParam('CKEditorFuncNum');
- var fileUrl = document.getElementById("f_href").value;
+ var fileUrl = '/'+document.getElementById("f_href").value;
window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl);
window.close();
@@ -55,15 +55,14 @@ function onCancel() {
return false;
};
-
-
function openSectionLinker() {
- window.open("../../../modules/navigationmodule/nav.php?linkbase="+escape("../../external/editors/ckconnector/section_linked.php?dummy"),"sectionlinker","toolbar=no,title=no,width=250,height=480,scrollbars=yes");
+ window.open("../../../modules/navigationmodule/nav.php?linkbase="+escape("../../external/editors/connector/section_linked.php?dummy"),"sectionlinker","toolbar=no,title=no,width=250,height=480,scrollbars=yes");
}
function openContentLinker() {
- window.open("../../../content_selector.php?dest="+escape("external/editors/ckconnector/content_linked.php?dummy")+"&vview=_linkPicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=640,height=480,scrollbars=yes");
-// window.open("../../../content_selector.php?dest="+escape("external/editors/ckconnector/content_linked.php?dummy")+"&vview=_sourcePicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=640,height=480,scrollbars=yes");
+// window.open("../../../content_selector.php?dest="+escape("external/editors/connector/content_linked.php?dummy")+"&vview=_sourcePicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=800,height=600,scrollbars=yes");
+// window.open("../../../content_selector.php?dest="+escape("external/editors/connector/content_linked.php?dummy")+"&vview=_linkPicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=800,height=600,scrollbars=yes");
+ window.open("../../../source_selector.php?dest="+escape("external/editors/connector/content_linked.php?dummy")+"&vview=_linkPicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=800,height=600,scrollbars=yes");
}
/* ]]> */
</script>
@@ -156,4 +155,4 @@ function openContentLinker() {
include(BASE.'modules/navigationmodule/nav.php');
?>
</body>
-</html>
+</html>
View
11 external/editors/connector/FCKeditor_link.php
@@ -21,8 +21,6 @@ function i18n(str) {
return (I18N[str] || str);
};
-
-
function onPageSelect(section) {
// FCKeditor integration
@@ -46,15 +44,14 @@ function onCancel() {
return false;
};
-
-
function openSectionLinker() {
window.open("../../../modules/navigationmodule/nav.php?linkbase="+escape("../../external/editors/connector/section_linked.php?dummy"),"sectionlinker","toolbar=no,title=no,width=250,height=480,scrollbars=yes");
}
function openContentLinker() {
- window.open("../../../content_selector.php?dest="+escape("external/editors/connector/content_linked.php?dummy")+"&vview=_linkPicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=640,height=480,scrollbars=yes");
-// window.open("../../../content_selector.php?dest="+escape("external/editors/connector/content_linked.php?dummy")+"&vview=_sourcePicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=640,height=480,scrollbars=yes");
+// window.open("../../../content_selector.php?dest="+escape("external/editors/connector/content_linked.php?dummy")+"&vview=_sourcePicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=800,height=600,scrollbars=yes");
+// window.open("../../../content_selector.php?dest="+escape("external/editors/connector/content_linked.php?dummy")+"&vview=_linkPicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=800,height=600,scrollbars=yes");
+ window.open("../../../source_selector.php?dest="+escape("external/editors/connector/content_linked.php?dummy")+"&vview=_linkPicker&vmod=containermodule&showmodules=all","contentlinker","toolbar=no,title=no,width=800,height=600,scrollbars=yes");
}
/* ]]> */
</script>
@@ -147,4 +144,4 @@ function openContentLinker() {
include(BASE.'modules/navigationmodule/nav.php');
?>
</body>
-</html>
+</html>
View
41 framework/modules/file/views/file/uploader.tpl
@@ -3,6 +3,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>File Uploader | Exponent CMS</title>
+ <link rel="stylesheet" type="text/css" href="{$smarty.const.URL_FULL}framework/core/assets/css/msgq.css">
<link rel="stylesheet" type="text/css" href="{$smarty.const.URL_FULL}framework/modules/file/assets/css/filemanager.css">
<script type="text/javascript" src="{$smarty.const.YUI2_PATH}yahoo-dom-event/yahoo-dom-event.js"></script>
@@ -11,16 +12,21 @@
<script type="text/javascript" src="{$smarty.const.YUI2_PATH}datasource/datasource-min.js"></script>
<script type="text/javascript" src="{$smarty.const.YUI2_PATH}datatable/datatable-min.js"></script>
<script type="text/javascript" src="{$smarty.const.URL_FULL}exponent.js.php"></script>
+
+ <script type="text/javascript" src="{$smarty.const.YUI3_PATH}yui/yui-min.js"></script>
+
</head>
-<body class=" exp-skin">
+<body class="exp-skin">
<div id="exp-uploader">
<h1>Upload Files</h1>
<div id="actionbar">
<div id="uploaderOverlay" style="position:absolute; z-index:2"></div>
<a class="btn" style="z-index:1" id="selectLink" href="#"><strong><em>Select Files</em></strong></a>
<a id="uploadLink" class="btn" href="#"><strong><em>Upload Files</em></strong></a>
- <a class="btn" href="{link action=picker update=$smarty.get.update fck=$smarty.get.fck ajax_action=1}?CKEditor={$smarty.get.CKEditor}&amp;CKEditorFuncNum={$smarty.get.CKEditorFuncNum}&amp;langCode={$smarty.get.langCode}"><strong><em>Back to Manager</em></strong></a>
+ <a id="backlink" class="btn" href="{link action=picker update=$smarty.get.update fck=$smarty.get.fck ajax_action=1}?CKEditor={$smarty.get.CKEditor}&amp;CKEditorFuncNum={$smarty.get.CKEditorFuncNum}&amp;langCode={$smarty.get.langCode}"><strong><em>Back to Manager</em></strong></a>
</div>
+ {messagequeue}
+
<div id="dataTableContainer"></div>
</div>
@@ -117,6 +123,15 @@
// Fired when the user selects files in the "Browse" dialog
// and clicks "Ok".
function onFileSelect(event) {
+
+ for (i in event.fileList) {
+ if (event.fileList[i].size > {/literal}{$bmax}{literal}) {
+ delete event.fileList[i];
+ // alert(event.fileList[i].name+" cannot be uploaded as it's file size is greater than the mximum limit.");
+ };
+ }
+
+
if('fileList' in event && event.fileList != null) {
fileList = event.fileList;
createDataTable(fileList);
@@ -129,17 +144,22 @@
this.dataArr = [];
for(var i in entries) {
var entry = entries[i];
- entry["progress"] = "<div style='height:5px;width:100px;background-color:#CCC;'></div>";
+ entry["progress"] = "<div style='width:100%;background-color:#CCC;padding:3px;'><div style='height:12px;padding:0px;font-size:10px;color:#fff;background-color:#900;width:0;'>0%</div></div>";
dataArr.unshift(entry);
}
for (var j = 0; j < dataArr.length; j++) {
this.fileIdHash[dataArr[j].id] = j;
}
+
+ var sizeFormat = function (elCell, oRecord, oColumn, oData) {
+ var newsize = Math.round(oData/1048576*100000)/100000;
+ elCell.innerHTML = newsize.toFixed(2)+"mb";
+ };
var myColumnDefs = [
{key:"name", label: "File Name", sortable:false},
- {key:"size", label: "Size", sortable:false},
+ {key:"size", label: "Size", sortable:false,formatter: sizeFormat},
{key:"progress", label: "Upload progress", sortable:false}
];
@@ -155,6 +175,8 @@
selectionMode:"single"
});
}
+
+ createDataTable();
// Do something on each file's upload start.
function onUploadStart(event) {
@@ -165,15 +187,15 @@
function onUploadProgress(event) {
rowNum = fileIdHash[event["id"]];
prog = Math.round(100*(event["bytesLoaded"]/event["bytesTotal"]));
- progbar = "<div style='height:5px;width:100px;background-color:#CCC;'><div style='height:5px;background-color:#F00;width:" + prog + "px;'></div></div>";
+ progbar = "<div style='width:100%;background-color:#CCC;'><div style='height:12px;padding:3px;font-size:10px;color:#fff;background-color:#f00;width:" + prog + "%;'>"+prog+"%</div></div>";
singleSelectDataTable.updateRow(rowNum, {name: dataArr[rowNum]["name"], size: dataArr[rowNum]["size"], progress: progbar});
}
// Do something when each file's upload is complete.
function onUploadComplete(event) {
rowNum = fileIdHash[event["id"]];
prog = Math.round(100*(event["bytesLoaded"]/event["bytesTotal"]));
- progbar = "<div style='height:5px;width:100px;background-color:#CCC;'><div style='height:5px;background-color:#F00;width:100px;'></div></div>";
+ progbar = "<div style='width:100%;background-color:#CCC;'><div style='height:12px;padding:3px;font-size:10px;color:#fff;background-color:#090;width:100%;'>100%</div></div>";
singleSelectDataTable.updateRow(rowNum, {name: dataArr[rowNum]["name"], size: dataArr[rowNum]["size"], progress: progbar});
uploader.removeFile(event["id"]);
fileList = event.fileList;
@@ -198,6 +220,13 @@
}
})();
+YUI(EXPONENT.YUI3_CONFIG).use('node', function(Y) {
+ Y.all('.msg-queue .close').on('click',function(e){
+ e.halt();
+ e.target.get('parentNode').remove();
+ });
+});
+
{/literal}
</script>
</body>
View
38 modules/containermodule/views/_linkPicker.tpl
@@ -13,31 +13,19 @@
* GPL: http://www.gnu.org/licenses/gpl.txt
*
*}
-<div class="container_editbox">
- <div class="container_editheader">
- {* I.E. requires a 'dummy' div inside of the above div, so that it
- doesn't just 'lose' the margins and padding. jh 8/23/04 *}
- <div style="width: 100%">
- <table width="100%" cellpadding="0" cellspacing="3" border="0" class="container_editheader">
- <tr>
- <td valign="top" class="info">
- {$container->info.module}
- {if $container->view != ""}<br />{$_TR.shown_in_view|sprintf:$container->view}{/if}
- </td>
- <td align="right" valign="top">
- <a class="mngmntlink container_mngmnltink" href="{$dest}&cid={$container->id}">
- <img class="mngmnt_icon" style="border:none;" src="{$smarty.const.ICON_RELATIVE}add.gif" title="{$_TR.link_to_module}" alt="{$_TR.link_to_module}" />
- </a>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <div class="container_box">
- <div style="width: 100%">
- {$container->output}
- </div>
+{if $container->info.clickable}
+<div id="module{$container->id}" class="exp-container-module-wrapper">
+ <div class="container-chrome module-chrome">
+ {* <a style="text-align:center;display:block;font-size:11px;padding-top:2px" href="{$dest}&ss={$container->info.source}&sm={$container->info.class}"> *}
+ <a style="text-align:center;display:block;text-decoration:none;font-weight:bold;text-transform:uppercase;font-size:11px;
+ text-shadow: 0px -1px 0px #374683;padding:1px 15px 0 5px;top:0px; left:5px;line-height:15px;color:#fff;"
+ href="{$dest}&cid={$container->id}">
+ * {$container->info.module} - {$_TR.link_to_module}Link to this Module *
+ </a>
</div>
+ {$container->output}
</div>
-<br /><br />
+{else}
+ {$container->output}
+{/if}
View
14 selector.php
@@ -18,6 +18,16 @@
##################################################
if (!defined('EXPONENT')) exit('');
+function epb($buffer, $mode) {
+ //@ob_gzhandler($buffer, $mode);
+ @ob_gzhandler($buffer);
+ //return $buffer; // uncomment if you're messing with output buffering so errors show. ~pb
+ return expProcessBuffer($buffer);
+}
+
+ob_start('epb');
+$microtime_str = explode(' ',microtime());
+$i_start = $microtime_str[0] + $microtime_str[1];
// Initialize the Theme Subsystem
if (!defined('SYS_THEME')) require_once(BASE.'subsystems/theme.php');
@@ -30,7 +40,6 @@
'themes/'.DISPLAY_THEME.'/subthemes/'.$section->subtheme.'.php' :
'themes/'.DISPLAY_THEME.'/index.php'
);
-
if (is_readable(BASE.$page)) {
define('PREVIEW_READONLY',1); // for mods
define('SELECTOR',1);
@@ -75,9 +84,12 @@
exponent_sessions_set('source_select',$source_select);
// Include the rendering page.
include_once(BASE.$page);
+ exponent_theme_satisfyThemeRequirements();
} else {
$i18n = exponent_lang_loadFile('selector.php');
echo sprintf($i18n['not_readable'],BASE.$page);
}
+ob_end_flush();
+
?>
View
4 source_selector.php
@@ -20,6 +20,10 @@
define('SCRIPT_EXP_RELATIVE','');
define('SCRIPT_FILENAME','source_selector.php');
+/* exdoc
+ * Define Source_Selector constant as 1, since we are not selecting orphaned content.
+ * @node General
+ */
define('SOURCE_SELECTOR',1);
// Initialize the Exponent Framework
View
8 subsystems/forms/controls/ckeditorcontrol.php
@@ -80,12 +80,14 @@ function controlToHTML($name) {
$content = "
EXPONENT.editor".createValidId($name)." = CKEDITOR.replace('".createValidId($name)."',
{
- filebrowserBrowseUrl : '".makelink(array("controller"=>"file", "action"=>"picker", "ajax_action"=>1, "ck"=>1, "update"=>"fck"))."',
- filebrowserLinkBrowseUrl : '".PATH_RELATIVE."external/editors/ckconnector/CKeditor_link.php',
toolbar : [".stripSlashes($tb)."],
forcePasteAsPlainText:true,
+ filebrowserBrowseUrl : '".makelink(array("controller"=>"file", "action"=>"picker", "ajax_action"=>1, "ck"=>1, "update"=>"fck"))."',
filebrowserWindowWidth : '640',
- filebrowserWindowHeight : '480'
+ filebrowserWindowHeight : '480',
+ filebrowserLinkBrowseUrl : '".PATH_RELATIVE."external/editors/connector/CKeditor_link.php',
+ filebrowserLinkWindowWidth : '320',
+ filebrowserLinkWindowHeight : '600'
});
";
View
1 themes/coolwatertheme/index.php
@@ -14,7 +14,6 @@
?>
</head>
<body>
-<?php exponent_theme_sourceSelectorInfo(); //this will be deprecated by copy 'n paste in the 0.98 ?>
<!-- wrap starts here -->
<div id="wrap">
<!--header -->

0 comments on commit 42f362a

Please sign in to comment.
Something went wrong with that request. Please try again.