Documentation is available at editor.php
- <?
- /**
- * editor.php
- *
- * This program 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.
- * This program 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.
- * @author Stephan Raabe
- */
- /**
- * writes the text editor icon
- */
- function editText($block,$tooltip,$output)
- {
- global $page,$site_staging,$author_release;
- if (isset($_GET["preview"]))
- {
- if ($site_staging == 0)
- {
- if ($output != "no") { echo $page[$block]; }
- }
- else
- {
- if ($output != "no") { echo staging_output($block); }
- }
- }
- else
- {
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- if ($site_staging == 0)
- {
- ?>
- <a href="Javascript:openTexteditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'WYSIWYG-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align="left"></a>
- <?
- if ($output != "no") { echo $page[$block]; }
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- if (($_SESSION["account_group"] == 3) && ($author_release == 0))
- {
- }
- else
- {
- ?>
- <a href="Javascript:openRelease('<?= $page["page_path"]; ?>','<?= $page["page_key"]; ?>','<?= $block; ?>');" onmouseover="return overlib('Release Content', CAPTION, 'Release', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_release.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- ?>
- <a href="Javascript:openTexteditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'WYSIWYG-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- if ($output != "no") { echo staging_output($block); }
- }
- }
- else
- {
- if ($output != "no") { echo $page[$block]; }
- }
- }
- }
- /**
- * writes the link editor icon
- */
- function editLink($link,$tooltip)
- {
- global $page;
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- ?>
- <a href="<?= $link; ?>" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'Link-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- /**
- * writes the item editor icon
- */
- function editItem($block,$tooltip,$output)
- {
- global $page,$site_staging,$author_release;
- if (isset($_GET["preview"]))
- {
- if ($site_staging == 0)
- {
- if ($output != "no") { echo $page[$block]; }
- }
- else
- {
- if ($output != "no") { echo staging_output($block); }
- }
- }
- else
- {
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- if ($site_staging == 0)
- {
- ?>
- <a href="Javascript:openItemeditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'Item-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- if ($output != "no") { echo $page[$block]; }
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- if (($_SESSION["account_group"] == 3) && ($author_release == 0))
- {
- }
- else
- {
- ?>
- <a href="Javascript:openRelease('<?= $page["page_path"]; ?>','<?= $page["page_key"]; ?>','<?= $block; ?>');" onmouseover="return overlib('Release Content', CAPTION, 'Release', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_release.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- ?>
- <a href="Javascript:openItemeditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'Item-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- if ($output != "no") { echo staging_output($block); }
- }
- }
- else
- {
- if ($output != "no") { echo $page[$block]; }
- }
- }
- }
- /**
- * writes the upload editor icon
- */
- function editUpload($block,$tooltip)
- {
- global $page,$site_staging,$author_release;
- if (empty($_GET["preview"]))
- {
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- if ($site_staging == 0)
- {
- ?>
- <a href="Javascript:openUploadDialog('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'Upload-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_upload.png'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- if (($_SESSION["account_group"] == 3) && ($author_release == 0))
- {
- }
- else
- {
- ?>
- <a href="Javascript:openRelease('<?= $page["page_path"]; ?>','<?= $page["page_key"]; ?>','<?= $block; ?>');" onmouseover="return overlib('Release Content', CAPTION, 'Release', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_release.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- ?>
- <a href="Javascript:openUploadDialog('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'Upload-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_upload.png'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- }
- }
- /**
- * writes the uploadpath editor icon
- */
- function editUploadPath($path,$block,$tooltip)
- {
- global $site_staging,$author_release;
- $page_path = get_page($path);
- ?>
- <a href="Javascript:openUploadDialog('<?= $page_path["page_path"]; ?>&cache=false','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'Upload-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_upload.png'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- /**
- * returns the content of a text block
- * @return string
- */
- function outputBlock($block)
- {
- global $page,$site_staging;
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- if ($site_staging == 0)
- {
- return $page[$block];
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- return staging_output($block);
- }
- else
- {
- return $page[$block];
- }
- }
- }
- else
- {
- return $page[$block];
- }
- }
- /**
- * returns if the text block is not equal null
- * @return bool
- */
- function isContent($block)
- {
- global $page,$site_staging;
- if ($site_staging == 0)
- {
- if ($page[$block] == "")
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- if (staging_output($block) == "")
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- else
- {
- if ($page[$block] == "")
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- }
- }
- /**
- * writes the Select editor icon
- */
- function editSelect($block,$select,$tooltip)
- {
- global $page,$site_staging,$author_release;
- $selectstring = "option=";
- foreach ($select as $value)
- {
- $selectstring .= $value["name"]."**";
- $selectstring .= $value["value"]."***";
- }
- if (empty($_GET["preview"]))
- {
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- if ($site_staging == 0)
- {
- ?>
- <a href="Javascript:openSelecteditor('<?= $page["page_path"]; ?>&<?= $selectstring; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'Select-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- if (($_SESSION["account_group"] == 3) && ($author_release == 0))
- {
- }
- else
- {
- ?>
- <a href="Javascript:openRelease('<?= $page["page_path"]; ?>','<?= $page["page_key"]; ?>','<?= $block; ?>');" onmouseover="return overlib('Release Content', CAPTION, 'Release', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_release.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- ?>
- <a href="Javascript:openSelecteditor('<?= $page["page_path"]; ?>&<?= $selectstring; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'Select-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- }
- }
- /**
- * returns the content of a select block
- * @return string
- */
- function outputSelect($block,$select)
- {
- global $page,$site_staging,$author_release;
- $input = "";
- $emptyOutput = 0;
- if ($site_staging == 0)
- {
- if ($page[$block] == "")
- {
- $emptyOutput = 1;
- }
- }
- else
- {
- if (staging_output($block) == "")
- {
- $emptyOutput = 1;
- }
- }
- if ($emptyOutput == 0)
- {
- if ($site_staging == 0)
- {
- $input = $page[$block];
- }
- else
- {
- $input = staging_output($block);
- }
- foreach ($select as $value)
- {
- if ($value["value"] == $input)
- {
- echo $value["name"];
- }
- }
- }
- else
- {
- echo $select[0]["name"];
- }
- }
- /**
- * writes the NewData editor icon
- */
- function editNew($tooltip,$template)
- {
- global $page;
- $icon = "system/admin/img/oes_addpage.png";
- if (empty($_GET["preview"]))
- {
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- ?>
- <a href="Javascript:openSmallDialog('<?= $page["page_path"]; ?>','newdata&newtemplate=<?= $template; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'New-Data-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='<?= $icon; ?>' alt='' border='0' align='left'></a>
- <?
- }
- }
- }
- /**
- * writes the individual editor icon
- */
- function editIndividual($include,$tooltip,$name)
- {
- global $page;
- if (empty($_GET["preview"]))
- {
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- ?>
- <a href="Javascript:openBigDialog('<?= $page["page_path"]; ?>','edit/individual&include=<?= $include; ?>&name=<?= $name; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'Individual-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- }
- /**
- * writes the NewData editor icon with user icon
- */
- function editNewIcon($tooltip,$template,$icon)
- {
- global $page;
- if (empty($_GET["preview"]))
- {
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- ?>
- <a href="Javascript:openSmallDialog('<?= $page["page_path"]; ?>','newdata&newtemplate=<?= $template; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'New-Data-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='<?= $icon; ?>' alt='' border='0' align='left'></a>
- <?
- }
- }
- }
- /**
- * writes the HTML editor icon
- */
- function editHTML($block,$tooltip,$output)
- {
- global $page,$site_staging,$author_release;
- if (isset($_GET["preview"]))
- {
- if ($site_staging == 0)
- {
- if ($output != "no") { echo $page[$block]; }
- }
- else
- {
- if ($output != "no") { echo staging_output($block); }
- }
- }
- else
- {
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- if ($site_staging == 0)
- {
- ?>
- <a href="Javascript:openHTMLeditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'HTML-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- if ($output != "no") { echo $page[$block]; }
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- if (($_SESSION["account_group"] == 3) && ($author_release == 0))
- {
- }
- else
- {
- ?>
- <a href="Javascript:openRelease('<?= $page["page_path"]; ?>','<?= $page["page_key"]; ?>','<?= $block; ?>');" onmouseover="return overlib('Release Content', CAPTION, 'Release', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_release.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- ?>
- <a href="Javascript:openHTMLeditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'HTML-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- if ($output != "no") { echo staging_output($block); }
- }
- }
- else
- {
- if ($output != "no") { echo $page[$block]; }
- }
- }
- }
- /**
- * writes the PHP editor icon
- */
- function editPHP($block,$tooltip)
- {
- global $page,$site_staging,$author_release;
- if (isset($_GET["preview"]))
- {
- if ($site_staging == 0)
- {
- eval($page[$block]);
- }
- else
- {
- eval(staging_output($block));
- }
- }
- else if (isset($_GET["export"]))
- {
- echo "<? ".$page[$block]." ?>";
- }
- else
- {
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- if ($site_staging == 0)
- {
- ?>
- <a href="Javascript:openPHPeditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'PHP-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- eval($page[$block]);
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- if (($_SESSION["account_group"] == 3) && ($author_release == 0))
- {
- }
- else
- {
- ?>
- <a href="Javascript:openRelease('<?= $page["page_path"]; ?>','<?= $page["page_key"]; ?>','<?= $block; ?>');" onmouseover="return overlib('Release Content', CAPTION, 'Release', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_release.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- ?>
- <a href="Javascript:openPHPeditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'PHP-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- eval(staging_output($block));
- }
- }
- else
- {
- eval($page[$block]);
- }
- }
- }
- /**
- * writes the RSS editor icon
- */
- function editRSS($block,$tooltip)
- {
- global $page,$site_staging,$author_release;
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- if (empty($_GET["preview"]))
- {
- if ($site_staging == 0)
- {
- ?>
- <a href="Javascript:openRSSeditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'RSS-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- if (($_SESSION["account_group"] == 3) && ($author_release == 0))
- {
- }
- else
- {
- ?>
- <a href="Javascript:openRelease('<?= $page["page_path"]; ?>','<?= $page["page_key"]; ?>','<?= $block; ?>');" onmouseover="return overlib('Release Content', CAPTION, 'Release', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_release.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- ?>
- <a href="Javascript:openRSSeditor('<?= $page["page_path"]; ?>','<?= $block; ?>');" onmouseover="return overlib('<?= $tooltip; ?>', CAPTION, 'RSS-Editor', WIDTH, 150, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src='system/admin/img/oes_editor.gif'" width='16' height='16' alt='' border='0' align='left'></a>
- <?
- }
- }
- }
- }
- /**
- * returns a rss object
- */
- function outputRss($block)
- {
- global $page,$site_staging,$site_url;
- if (($_SESSION["account_group"] == 2) || (($_SESSION["account_group"] == 3) && ($page["page_lock"] == 0)))
- {
- if ($site_staging == 0)
- {
- $url = $page[$block];
- }
- else
- {
- if(isStage($page["page_key"],$block))
- {
- $url = staging_output($block);
- }
- else
- {
- $url = $page[$block];
- }
- }
- }
- else
- {
- $url = $page[$block];
- }
- require_once("system/admin/magpierss061/rss_fetch.inc");
- $rss = fetch_rss($url);
- return $rss;
- }
- ?>
Documentation generated on Tue, 16 Aug 2005 17:32:20 +0200 by phpDocumentor 1.3.0RC3