Merge pull request 'Merge latest PHP8 changes to develop' (#31) from dev_php8 into develop

Reviewed-on: #31
Dieser Commit ist enthalten in:
Ortwin Pinke 2022-05-23 17:18:43 +00:00
Commit 6a150745dd
84 geänderte Dateien mit 4531 neuen und 3471 gelöschten Zeilen

4
.gitignore vendored
Datei anzeigen

@ -17,3 +17,7 @@
/cms/dflip/
/cms/js/firstlevel/
/conlite/external/**/.git
/dievino/
/conlite/logs/debug.log
/cms/data/config/production/config.mod_rewrite.php
/cms/data/config/production/config.local.php

Datei anzeigen

@ -14,7 +14,11 @@
# $Id: htaccess_simple.txt 145 2019-10-25 16:00:47Z oldperl $
################################################################################
#SetEnv CONLITE_ENVIRONMENT development
# easily set this enviroment variable to the config you want to use
# add a config folder with the same name in data/config and cms/data/config
# and use your custom config for development
#SetEnv CONLITE_ENVIRONMENT develop
<IfModule mod_rewrite.c>
@ -33,7 +37,7 @@
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR]
RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC]
RewriteRule ^.* - [F,L] # all matching conditions from above will end in nirvana
RewriteRule ^.* - [F,L,DPI] # all matching conditions from above will end in nirvana
# Rewrite request to root to front_content.php
RewriteRule ^$ front_content.php [QSA,L]
@ -44,7 +48,7 @@
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ - [NC,L,DPI]
# Pass other requests to front_content.php
RewriteRule ^.*$ front_content.php [QSA,NC,L]

Datei anzeigen

@ -1,5 +1,5 @@
----------------------------------------------------------------------------------------------------
This is the readme file for ConLite 2.1.3
This is the readme file for ConLite 2.2.0 beta
Any help you need you may find by visiting the following links.
@ -56,6 +56,8 @@ FS#25 - Collision with pre-installed AMR after Migration
** History / Changelog **
ConLite 2.2.0 beta
ConLite 2.1.3
ConLite 2.1.2
ConLite 2.1.1

Datei anzeigen

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

Datei anzeigen

@ -1,5 +1,5 @@
/*
Simple Responsive Template v 1.2
Simple Responsive Template v 1.2 test
primary styles

Datei anzeigen

@ -93,7 +93,7 @@ if ($cfg["use_pseudocron"] == true) {
* PHPLIB application development toolkit
* @see http://sourceforge.net/projects/phplib
*/
if ($contenido) {
if (!empty($contenido)) {
//Backend
page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang);
@ -102,33 +102,24 @@ if ($contenido) {
page_open(array('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
}
/**
* Bugfix
* @see http://contenido.org/forum/viewtopic.php?t=18291
*
* added by H. Librenz (2007-12-07)
*/
//includePluginConf();
/**
* fixed bugfix - using functions brokes variable scopes!
*
* added by H. Librenz (2007-12-21) based on an idea of A. Lindner
*/
require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.includePluginConf.php';
$db = new DB_Contenido;
// Call hook after plugins are loaded, added by Murat Purc, 2008-09-07
CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins');
$db = new DB_ConLite();
$sess->register("cfgClient");
$sess->register("errsite_idcat");
$sess->register("errsite_idart");
$sess->register("encoding");
if ($cfgClient["set"] != "set") {
if (empty($cfgClient["set"]) || $cfgClient["set"] != "set") {
rereadClients();
}
# Check if this request is for a compressed file
if ($_GET['action'] == 'get_compressed') {
if (isset($_GET['action']) && $_GET['action'] == 'get_compressed') {
# Get the calling parameters
$sFilename = ((isset($_GET['f'])) ? $_GET['f'] : $_GET['amp;f']);
$sContentType = ((isset($_GET['c'])) ? $_GET['c'] : $_GET['amp;c']);
@ -264,9 +255,9 @@ if ($idart && !$idcat && !$idcatart) {
unset($code);
unset($markscript);
if (!$idcatart) {
if (!$idart) {
if (!$idcat) {
if (empty($idcatart)) {
if (empty($idart)) {
if (empty($idcat)) {
# Note: In earlier Contenido versions the information if an article is startarticle of a category has been stored
# in relation con_cat_art.
if ($cfg["is_start_compatible"] == true) {
@ -313,7 +304,7 @@ if (!$idcatart) {
$idart = $db->f("idart");
$idcat = $db->f("idcat");
} else {
if ($contenido) {
if (!empty($contenido)) {
cInclude("includes", "functions.i18n.php");
die(i18n("No start article for this category"));
} else {
@ -525,7 +516,7 @@ if ($contenido) {
/* If mode is 'edit' and user has permission to edit articles in the current category */
if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) {
if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) {
cInclude("includes", "functions.tpl.php");
cInclude("includes", "functions.con.php");
include ($cfg["path"]["contenido"] . $cfg["path"]["includes"] . "include.con_editcontent.php");
@ -606,10 +597,12 @@ if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_ar
}
/* Add mark Script to code if user is in the backend */
if(!empty($markscript)) {
$code = preg_replace("/<\/head>/i", "$markscript\n</head>", $code, 1);
}
/* If article is in use, display notification */
if ($sHtmlInUseCss && $sHtmlInUseMessage) {
if (!empty($sHtmlInUseCss) && !empty($sHtmlInUseMessage)) {
$code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n</head>", $code, 1);
$code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1);
}
@ -652,7 +645,7 @@ if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_ar
WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '" . Contenido_Security::escapeDB($user_id, $db2) . "' AND A.idcat = '" . Contenido_Security::toInteger($idcat) . "'
AND A.idarea = C.idarea AND B.idaction = A.idaction";
$db2 = new DB_Contenido;
$db2 = new DB_ConLite();
$db2->query($sql);
if ($db2->num_rows() > 0) {
@ -853,4 +846,3 @@ if (isset($savedlang)) {
$db->disconnect();
page_close();
?>

Datei anzeigen

@ -1,4 +1,4 @@
<!-- developer design for file list -->
<!-- developer design for file list test -->
<h3>{TITLE}</h3>
<!--
Possible place holders for entries:

Datei anzeigen

@ -92,6 +92,10 @@ class DB_Sql extends DB_Sql_Abstract {
return null;
}
// PHP 8.1 fix
$driver = new mysqli_driver();
$driver->report_mode = MYSQLI_REPORT_OFF;
$dbh = mysqli_init();
//print_r($dbh);
if (!$dbh) {
@ -123,7 +127,7 @@ class DB_Sql extends DB_Sql_Abstract {
$aCon['socket'] = null;
}
if (!isset($aCon['flags'])) {
$aCon['flags'] = null;
$aCon['flags'] = MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT;
}
if (!isset($aCon['database'])) {
$aCon['database'] = null;
@ -134,10 +138,10 @@ class DB_Sql extends DB_Sql_Abstract {
);
if (isset($aCon['charset'])) {
@mysqli_set_charset($dbh, $aCon['charset']);
if (!empty($aCon['charset'])) {
mysqli_set_charset($dbh, $aCon['charset']);
} else {
@mysqli_set_charset($dbh, 'utf8');
mysqli_set_charset($dbh, 'utf8');
}
//echo mysqli_character_set_name($dbh);
@ -420,10 +424,13 @@ class DB_Sql extends DB_Sql_Abstract {
* @see DB_Sql_Abstract::escape()
*/
public function escape($sString) {
if(is_null($sString)) {
$sString = '';
}
$sResult = '';
if (is_resource($this->Link_ID) || $this->connect()) {
$sResult = mysqli_real_escape_string($this->Link_ID, $sString);
};
}
return $sResult;
}
@ -440,7 +447,7 @@ class DB_Sql extends DB_Sql_Abstract {
$return[$i]['table_name'] = $info[0];
$return[$i]['tablespace_name'] = $this->Database;
$return[$i]['database'] = $this->Database;
$i ++;
$i++;
}
mysqli_free_result($h);

Datei anzeigen

@ -36,7 +36,7 @@ class cApiUploadCollection extends ItemCollection {
public function sync($dir, $file) {
global $client;
if (strstr(strtolower($_ENV["OS"]), 'windows') === FALSE) {
if (!empty($_ENV["OS"]) && strstr(strtolower($_ENV["OS"]), 'windows') === FALSE) {
#Unix style OS distinguish between lower and uppercase file names, i.e. test.gif is not the same as Test.gif
$this->select("dirname = BINARY '$dir' AND filename = BINARY '$file' AND idclient = '$client'");
} else {

Datei anzeigen

@ -17,13 +17,14 @@
* @link http://www.conlite.org ConLite.org
*/
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
/*
if (!class_exists("HTML_Common2")) {
cInclude("pear", "HTML/Common2.php");
}
*/
/* Global ID counter */
$cHTMLIDCount = 0;
@ -32,7 +33,7 @@ $cHTMLIDCount = 0;
*
* @author Ortwin Pinke <o.pinke@conlite.org>
*/
class cHTML extends HTML_Common2 {
class cHTML extends cHTML5Common {
/**
* Storage of the open SGML tag template

Datei anzeigen

@ -0,0 +1,584 @@
<?php
/**
* @category ConLite
* @package Core
* @subpackage cHTML5
* @since 2.2
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2022, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*/
/*
* HTML_Common2: port of HTML_Common package to PHP5
*
* PHP version 5
*
* LICENSE:
*
* Copyright (c) 2004-2012, Alexey Borzov <avb@php.net>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * The names of the authors may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category HTML
* @package HTML_Common2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version SVN: $Id$
* @link http://pear.php.net/package/HTML_Common2
*/
/*
* Base class for HTML classes
*
* Implements methods for working with HTML attributes, parsing and generating
* attribute strings. Port of HTML_Common class for PHP4 originally written by
* Adam Daniel with contributions from numerous other developers.
*
* @category HTML
* @package HTML_Common2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version Release: 2.1.0
* @link http://pear.php.net/package/HTML_Common2
*/
abstract class cHTML5Common implements ArrayAccess
{
/**
* Associative array of attributes
* @var array
*/
protected $attributes = array();
/**
* Changes to attributes in this list will be announced via onAttributeChange()
* method rather than performed by HTML_Common2 class itself
* @var array
* @see onAttributeChange()
*/
protected $watchedAttributes = array();
/**
* Indentation level of the element
* @var int
*/
private $_indentLevel = 0;
/**
* Comment associated with the element
* @var string
*/
private $_comment = null;
/**
* Global options for all elements generated by subclasses of HTML_Common2
*
* Preset options are
* - 'charset': charset parameter used in htmlspecialchars() calls,
* defaults to 'ISO-8859-1'
* - 'indent': string used to indent HTML elements, defaults to "\11"
* - 'linebreak': string used to indicate linebreak, defaults to "\12"
*
* @var array
*/
private static $_options = array(
'charset' => 'ISO-8859-1',
'indent' => "\11",
'linebreak' => "\12"
);
/**
* Sets global option(s)
*
* @param string|array $nameOrOptions Option name or array ('option name' => 'option value')
* @param mixed $value Option value, if first argument is not an array
*/
public static function setOption($nameOrOptions, $value = null)
{
if (is_array($nameOrOptions)) {
foreach ($nameOrOptions as $k => $v) {
self::setOption($k, $v);
}
} else {
$linebreaks = array('win' => "\15\12", 'unix' => "\12", 'mac' => "\15");
if ('linebreak' == $nameOrOptions && isset($linebreaks[$value])) {
$value = $linebreaks[$value];
}
self::$_options[$nameOrOptions] = $value;
}
}
/**
* Returns global option(s)
*
* @param string $name Option name
*
* @return mixed Option value, null if option does not exist,
* array of all options if $name is not given
*/
public static function getOption($name = null)
{
if (null === $name) {
return self::$_options;
} else {
return isset(self::$_options[$name])? self::$_options[$name]: null;
}
}
/**
* Parses the HTML attributes given as string
*
* @param string $attrString HTML attribute string
*
* @return array An associative array of attributes
*/
protected static function parseAttributes($attrString)
{
$attributes = array();
if (preg_match_all(
"/(([A-Za-z_:]|[^\\x00-\\x7F])([A-Za-z0-9_:.-]|[^\\x00-\\x7F])*)" .
"([ \\n\\t\\r]+)?(=([ \\n\\t\\r]+)?(\"[^\"]*\"|'[^']*'|[^ \\n\\t\\r]*))?/",
$attrString,
$regs
)) {
for ($i = 0; $i < count($regs[1]); $i++) {
$name = trim($regs[1][$i]);
$check = trim($regs[0][$i]);
$value = trim($regs[7][$i]);
if ($name == $check) {
$attributes[strtolower($name)] = strtolower($name);
} else {
if (!empty($value) && ($value[0] == '\'' || $value[0] == '"')) {
$value = substr($value, 1, -1);
}
$attributes[strtolower($name)] = $value;
}
}
}
return $attributes;
}
/**
* Creates a valid attribute array from either a string or an array
*
* @param string|array $attributes Array of attributes or HTML attribute string
*
* @return array An associative array of attributes
*/
protected static function prepareAttributes($attributes)
{
$prepared = array();
if (is_string($attributes)) {
return self::parseAttributes($attributes);
} elseif (is_array($attributes)) {
foreach ($attributes as $key => $value) {
if (is_int($key)) {
$key = strtolower($value);
$prepared[$key] = $key;
} else {
$prepared[strtolower($key)] = (string)$value;
}
}
}
return $prepared;
}
/**
* Removes an attribute from an attribute array
*
* @param array &$attributes Attribute array
* @param string $name Name of attribute to remove
*/
protected static function removeAttributeArray(array &$attributes, $name)
{
unset($attributes[strtolower($name)]);
}
/**
* Creates HTML attribute string from array
*
* @param array $attributes Attribute array
*
* @return string Attribute string
*/
protected static function getAttributesString(array $attributes)
{
$str = '';
$charset = self::getOption('charset');
foreach ($attributes as $key => $value) {
$str .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES, $charset) . '"';
}
return $str;
}
/**
* Class constructor, sets default attributes
*
* @param array|string $attributes Array of attribute 'name' => 'value' pairs
* or HTML attribute string
*/
public function __construct($attributes = null)
{
$this->mergeAttributes($attributes);
}
/**
* Sets the value of the attribute
*
* @param string $name Attribute name
* @param string $value Attribute value (will be set to $name if omitted)
*
* @return HTML_Common2
*/
public function setAttribute($name, $value = null)
{
$name = strtolower($name);
if (is_null($value)) {
$value = $name;
}
if (in_array($name, $this->watchedAttributes)) {
$this->onAttributeChange($name, $value);
} else {
$this->attributes[$name] = (string)$value;
}
return $this;
}
/**
* Returns the value of an attribute
*
* @param string $name Attribute name
*
* @return string|null Attribute value, null if attribute does not exist
*/
public function getAttribute($name)
{
$name = strtolower($name);
return isset($this->attributes[$name])? $this->attributes[$name]: '';
}
/**
* Sets the attributes
*
* @param string|array $attributes Array of attribute 'name' => 'value' pairs
* or HTML attribute string
*
* @return HTML_Common2
*/
public function setAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
$watched = array();
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->setAttribute($watchedKey, $attributes[$watchedKey]);
unset($attributes[$watchedKey]);
} else {
$this->removeAttribute($watchedKey);
}
if (isset($this->attributes[$watchedKey])) {
$watched[$watchedKey] = $this->attributes[$watchedKey];
}
}
$this->attributes = array_merge($watched, $attributes);
return $this;
}
/**
* Returns the attribute array or string
*
* @param bool $asString Whether to return attributes as string
*
* @return array|string
*/
public function getAttributes($asString = false)
{
if ($asString) {
return self::getAttributesString($this->attributes);
} else {
return $this->attributes;
}
}
/**
* Merges the existing attributes with the new ones
*
* @param array|string $attributes Array of attribute 'name' => 'value' pairs
* or HTML attribute string
*
* @return HTML_Common2
*/
public function mergeAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->onAttributeChange($watchedKey, $attributes[$watchedKey]);
unset($attributes[$watchedKey]);
}
}
$this->attributes = array_merge($this->attributes, $attributes);
return $this;
}
/**
* Removes an attribute
*
* @param string $attribute Name of attribute to remove
*
* @return HTML_Common2
*/
public function removeAttribute($attribute)
{
if (in_array(strtolower($attribute), $this->watchedAttributes)) {
$this->onAttributeChange(strtolower($attribute), null);
} else {
self::removeAttributeArray($this->attributes, $attribute);
}
return $this;
}
/**
* Sets the indentation level
*
* @param int $level Indentation level
*
* @return HTML_Common2
*/
public function setIndentLevel($level)
{
$level = intval($level);
if (0 <= $level) {
$this->_indentLevel = $level;
}
return $this;
}
/**
* Gets the indentation level
*
* @return int
*/
public function getIndentLevel()
{
return $this->_indentLevel;
}
/**
* Returns the string to indent the element
*
* @return string
*/
protected function getIndent()
{
return str_repeat(self::getOption('indent'), $this->getIndentLevel());
}
/**
* Sets the comment for the element
*
* @param string $comment String to output as HTML comment
*
* @return HTML_Common2
*/
public function setComment($comment)
{
$this->_comment = $comment;
return $this;
}
/**
* Returns the comment associated with the element
*
* @return string
*/
public function getComment()
{
return $this->_comment;
}
/**
* Checks whether the element has given CSS class
*
* @param string $class CSS Class name
*
* @return bool
*/
public function hasClass($class)
{
$regex = '/(^|\s)' . preg_quote($class, '/') . '(\s|$)/';
return (bool)preg_match($regex, $this->getAttribute('class'));
}
/**
* Adds the given CSS class(es) to the element
*
* @param string|array $class Class name, multiple class names separated by
* whitespace, array of class names
*
* @return HTML_Common2
*/
public function addClass($class)
{
if (!is_array($class)) {
$class = preg_split('/\s+/', $class, null, PREG_SPLIT_NO_EMPTY);
}
$curClass = preg_split(
'/\s+/', $this->getAttribute('class'), null, PREG_SPLIT_NO_EMPTY
);
foreach ($class as $c) {
if (!in_array($c, $curClass)) {
$curClass[] = $c;
}
}
$this->setAttribute('class', implode(' ', $curClass));
return $this;
}
/**
* Removes the given CSS class(es) from the element
*
* @param string|array $class Class name, multiple class names separated by
* whitespace, array of class names
*
* @return HTML_Common2
*/
public function removeClass($class)
{
if (!is_array($class)) {
$class = preg_split('/\s+/', $class, null, PREG_SPLIT_NO_EMPTY);
}
$curClass = array_diff(
preg_split(
'/\s+/', $this->getAttribute('class'), null, PREG_SPLIT_NO_EMPTY
),
$class
);
if (0 == count($curClass)) {
$this->removeAttribute('class');
} else {
$this->setAttribute('class', implode(' ', $curClass));
}
return $this;
}
/**
* Returns the HTML representation of the element
*
* This magic method allows using the instances of HTML_Common2 in string
* contexts
*
* @return string
*/
abstract public function __toString();
/**
* Called if trying to change an attribute with name in $watchedAttributes
*
* This method is called for each attribute whose name is in the
* $watchedAttributes array and which is being changed by setAttribute(),
* setAttributes() or mergeAttributes() or removed via removeAttribute().
* Note that the operation for the attribute is not carried on after calling
* this method, it is the responsibility of this method to change or remove
* (or not) the attribute.
*
* @param string $name Attribute name
* @param string $value Attribute value, null if attribute is being removed
*/
protected function onAttributeChange($name, $value = null)
{
}
/**
* Whether or not an offset (HTML attribute) exists
*
* @param string $offset An offset to check for.
*
* @return boolean Returns true on success or false on failure.
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->attributes[strtolower($offset)]);
}
/**
* Returns the value at specified offset (i.e. attribute name)
*
* @param string $offset The offset to retrieve.
*
* @return string|null
* @link http://php.net/manual/en/arrayaccess.offsetget.php
* @see getAttribute()
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->getAttribute($offset);
}
/**
* Assigns a value to the specified offset (i.e. attribute name)
*
* @param string $offset The offset to assign the value to
* @param string $value The value to set
*
* @return void
* @link http://php.net/manual/en/arrayaccess.offsetset.php
* @see setAttribute()
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (null !== $offset) {
$this->setAttribute($offset, $value);
} else {
// handles $foo[] = 'disabled';
$this->setAttribute($value);
}
}
/**
* Unsets an offset (i.e. removes an attribute)
*
* @param string $offset The offset to unset
*
* @return void
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
* @see removeAttribute
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
$this->removeAttribute($offset);
}
}

Datei anzeigen

@ -283,7 +283,7 @@ class Article extends Item
*/
public function getContent($type, $id = NULL)
{
if ($type == '') {
if (empty($type)) {
return 'Class ' . get_class($this) . ': content-type must be specified!';
}
@ -295,7 +295,7 @@ class Article extends Item
if (is_null($id)) {
// return Array
return $this->content[$type];
return (empty($this->content[$type]))?'':$this->content[$type];
}
// return String

Datei anzeigen

@ -238,7 +238,7 @@ class cAutoload {
* @return (string|null) Path and filename or null
*/
private static function _getContenidoClassFile($className) {
$file = isset(self::$_includeFiles[$className]) ? self::$_conRootPath . self::$_includeFiles[$className] : null;
$file = isset(self::$_includeFiles[$className]) ? self::$_conRootPath . self::$_includeFiles[$className] : '';
return self::_validateClassAndFile($className, $file);
}
@ -247,7 +247,7 @@ class cAutoload {
*
* @param string $className
* @param string $filePathName
* @return (string|null) The file if validation was successfull, otherwhise null
* @return (string) The file if validation was successfull, otherwhise empty
*/
private static function _validateClassAndFile($className, $filePathName) {
if (class_exists($className)) {
@ -256,14 +256,14 @@ class cAutoload {
'file' => str_replace(self::$_conRootPath, '', $filePathName),
'error' => self::ERROR_CLASS_EXISTS
);
return null;
return '';
} elseif (!is_file($filePathName)) {
self::$_errors[] = array(
'class' => $className,
'file' => str_replace(self::$_conRootPath, '', $filePathName),
'error' => self::ERROR_FILE_NOT_FOUND
);
return null;
return '';
}
return $filePathName;

Datei anzeigen

@ -1712,8 +1712,13 @@ abstract class Item extends cItemBaseAbstract {
* @return mixed Filtered data
*/
public function _inFilter($mData) {
if (is_numeric($mData) || is_array($mData))
if (is_numeric($mData) || is_array($mData)) {
return $mData;
}
if(is_null($mData)) {
$mData = '';
}
foreach ($this->_arrInFilters as $_function) {
if (function_exists($_function)) {

Datei anzeigen

@ -672,7 +672,7 @@ class cHTMLSelectElement extends cHTMLFormElement {
*/
function setDefault($lvalue) {
$bSet = false;
$lvalue = cString::nullToString($lvalue);
if (is_array($this->_options)) {
foreach ($this->_options as $key => $value) {
if (strcmp($value->getAttribute("value"), $lvalue) == 0) {

Datei anzeigen

@ -715,4 +715,19 @@ class cString extends cStringMultiByteWrapper {
return $string;
}
/**
* Convert null string to empty string
*
* @param string $string
* @return string
*/
public static function nullToString($string) {
//var_dump($string);
if(empty($string) || is_null($string)) {
$string = '';
}
//var_dump($string);
return $string;
}
}

Datei anzeigen

@ -174,10 +174,10 @@ class UI_Menu {
foreach ($this->link as $key => $value) {
if ($value != NULL) {
if ($this->imagewidth[$key] != 0) {
if (!empty($this->imagewidth[$key]) && !empty ($this->image[$key])) {
$value->setContent('<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">');
$img = $value->render();
} else {
} else if(!empty ($this->image[$key])) {
$value->setContent('<img border="0" src="' . $this->image[$key] . '">');
$img = $value->render();
}
@ -186,14 +186,12 @@ class UI_Menu {
} else {
$link = $this->title[$key];
if ($this->image[$key] != "") {
if (!empty($this->image[$key])) {
if ($this->imagewidth[$key] != 0) {
$img = '<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">';
} else {
$img = '<img border="0" src="' . $this->image[$key] . '">';
}
} else {
$img = "&nbsp;";
}
}
@ -212,21 +210,24 @@ class UI_Menu {
$bgColor = $cfg["color"]["table_light_active"];
}
if ($this->extra[$key] == 'id="marked" ') {
if (!empty($this->extra[$key]) && $this->extra[$key] == 'id="marked" ') {
$bgColor = $cfg["color"]["table_light_active"];
}
}
$tpl->set('d', 'NAME', $link);
if ($this->image[$key] == "") {
if (empty($this->image[$key])) {
$tpl->set('d', 'ICON', '');
} else {
$tpl->set('d', 'ICON', $img);
}
if ($this->extra[$key] != "" || $this->rowmark == true) {
if (!empty($this->extra[$key]) || $this->rowmark == true) {
$extraadd = "";
if(empty($this->extra[$key])) {
$this->extra[$key] = '';
}
if ($this->rowmark == true) {
$extraadd = 'onmouseover="row.over(this)" onmouseout="row.out(this)" onclick="row.click(this)"';
@ -439,7 +440,7 @@ class UI_Table_Form {
if (is_array($this->items)) {
foreach ($this->items as $key => $value) {
if ($this->itemType[$key] == 'subheader') {
if (isset($this->itemType[$key]) && $this->itemType[$key] == 'subheader') {
$subheader = '<tr class="text_medium" style="background-color: ' . $cfg["color"]["table_header"] . ';">';
$subheader .= '<td colspan="2" valign="top" style="border: 0px;border-top: 0px; border-bottom:0px; border-right:1px;border-color: ' . $cfg["color"]["table_border"] . '; border-style: solid;">' . $this->captions[$key] . '</td></tr>';
@ -703,6 +704,7 @@ class UI_Page {
class Link {
var $alt = '';
var $link;
var $title;
var $targetarea;
@ -770,7 +772,8 @@ class Link {
function render() {
global $sess, $cfg;
$custom = '';
$attributes = '';
if ($this->alt != "") {
$alt = 'alt="' . $this->alt . '" title="' . $this->alt . '" ';
} else {
@ -819,7 +822,7 @@ class Link {
break;
}
if ($this->images == '') {
if (empty($this->images)) {
return ($link . $this->content . "</a>");
} else {
list($this->img_width, $this->img_height, $this->img_type, $this->img_attr) = getimagesize($cfg['path']['contenido'] . $this->images);
@ -910,6 +913,7 @@ class UI_List {
$colcount = 0;
if (is_array($this->cells)) {
$dark = true;
foreach ($this->cells as $row => $cells) {
$thefont = '';
$unne = '';
@ -928,7 +932,7 @@ class UI_List {
$bgColor = $cfg["color"]["table_light"];
}
if ($this->bgcolor[$row] != "") {
if (!empty($this->bgcolor[$row])) {
$bgColor = $this->bgcolor[$row];
}
@ -936,7 +940,7 @@ class UI_List {
$count = 0;
foreach ($cells as $key => $value) {
$thefontDispl = $thefont . $this->extra[$row][$key];
$thefontDispl = $thefont . (empty($this->extra[$row][$key]))?'':$this->extra[$row][$key];
$count++;
$tpl2->reset();
@ -966,7 +970,7 @@ class UI_List {
$tpl2->set('s', 'ALIGN', 'left');
}
if ($this->cellvalignment[$row][$key] != "") {
if (!empty($this->cellvalignment[$row][$key])) {
$tpl2->set('s', 'VALIGN', $this->cellvalignment[$row][$key]);
} else {
$tpl2->set('s', 'VALIGN', 'top');
@ -1027,10 +1031,10 @@ class cScrollList {
var $listStart;
/**
* sortable flag
* @var string
* sortable array
* @var array
*/
var $sortable;
protected $_aSortable;
/**
* sortlink
@ -1080,7 +1084,7 @@ class cScrollList {
$this->resultsPerPage = 0;
$this->listStart = 1;
$this->sortable = false;
$this->_aSortable = [];
$this->objTable = new cHTMLTable();
if ($defaultstyle == true) {
@ -1126,7 +1130,7 @@ class cScrollList {
* @param $sortable boolean true or false
*/
function setSortable($key, $sortable) {
$this->sortable[$key] = $sortable;
$this->_aSortable[$key] = $sortable;
}
/**
@ -1298,8 +1302,7 @@ class cScrollList {
$this->sortkey = $field;
$this->sortmode = $order;
$field = $field + 1;
$field = intval($field) + 1;
$this->data = array_csort($this->data, "$field", $order);
}
@ -1330,8 +1333,8 @@ class cScrollList {
/* Render header */
foreach ($this->header as $key => $value) {
if (is_array($this->sortable)) {
if (array_key_exists($key, $this->sortable) && $this->sortable[$key] == true) {
if (is_array($this->_aSortable)) {
if (array_key_exists($key, $this->_aSortable) && $this->_aSortable[$key] == true) {
$this->sortlink->setContent($value);
$this->sortlink->setCustom("sortby", $key);

Datei anzeigen

@ -378,6 +378,10 @@ class User {
function getUserProperty($type, $name, $group = false) {
global $cfg, $perm;
if(empty($this->values)) {
return false;
}
if (!is_object($perm)) {
$perm = new Contenido_Perm();
}

Datei anzeigen

@ -58,7 +58,7 @@ class cRegistry {
public static function getFrontendPath() {
$cfgClient = self::getClientConfig();
$client = self::getClientId();
return $cfgClient[$client]['path']['frontend'];
return (empty($cfgClient))?'':$cfgClient[$client]['path']['frontend'];
}
/**

Datei anzeigen

@ -69,7 +69,7 @@ class cApiLayout extends Item {
* @param mixed $mId Specifies the ID of item to load
*/
public function __construct($mId = false) {
global $cfg;
$cfg = cRegistry::getConfig();
parent::__construct($cfg["tab"]["lay"], "idlay");
$this->setFilters(array(), array());
@ -78,7 +78,7 @@ class cApiLayout extends Item {
$this->_setLayPath();
}
$oClient = new cApiClient($client);
$oClient = new cApiClient(cRegistry::getClientId());
$aClientProp = $oClient->getPropertiesByType('layfileedit');
if(count($aClientProp) > 0) {
$this->_aLayFileEditConf = array_merge($this->_aLayFileEditConf, $aClientProp);

Datei anzeigen

@ -912,7 +912,7 @@ class cApiModule extends Item {
}
private function _displayNoteFromFile($bIsOldPath = FALSE) {
if ($this->_bNoted === true) {
if (isset($this->_bNoted) && $this->_bNoted === true) {
return;
}
global $frame, $area;
@ -1053,6 +1053,8 @@ class cApiModuleTranslationCollection extends ItemCollection {
protected $_error;
protected $f_obj;
/**
* Constructor Function
* @param none

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -0,0 +1,2 @@
/local
/localhost

Datei anzeigen

@ -0,0 +1 @@

Datei anzeigen

@ -4,17 +4,15 @@
* Contenido Content Management System
*
* Description:
* <Description>
* Configuration File
*
* Requirements:
* @con_php_req 5
* @con_template <Templatefiles>
* @con_notice <Notice>
*
*
* @package ContenidoBackendArea
* @version <version>
* @author <author>
* @version 0.1
* @author unknown
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
@ -23,31 +21,32 @@
*
*
* {@internal
* created <date>
* modified 2008-07-04, bilal arslan, added security fix
* created unknown
* modified 2008-07-03, bilal arslan, added security fix
*
* $Id$:
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// Relative path to contenido directory, for all inclusions, in most cases: "../contenido/"
$contenido_path = "!PATH!";
$contenido_path = "../conlite/";
// If language isn't specified, set this client and language (ID)
$load_lang = "!LANG!";
$load_client = "!CLIENT!";
$load_lang = "1";
$load_client = "1";
/* Various debugging options */
$frontend_debug["container_display"] = false;
$frontend_debug["module_display"] = false;
$frontend_debug["module_timing"] = false;
$frontend_debug["module_timing_summary"] = false;
$frontend_debug["module_timing_summary"]= false;
/* Set to 1 to brute-force module regeneration */
$force = 0;
?>

Datei anzeigen

@ -8,9 +8,11 @@
*
* Requirements:
* @con_php_req 5
* @con_template <Templatefiles>
* @con_notice <Notice>
*
*
* @package ContenidoBackendArea
* @version <version>
* @author unknown
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
@ -22,13 +24,15 @@
* {@internal
* created unknown
* modified 2008-06-16, H. Librenz - Hotfix: checking for potential unsecure calling
* modified 2008-07-04, bilal arslan, added security fix
* modified 2008-07-03, bilal arslan, added security fix
* modified 2010-05-20, Murat Purc, standardized Contenido startup and security check invocations, see [#CON-307]
*
* $Id$:
* }}
*
*/
if (!defined("CON_FRAMEWORK")) {
if (!defined("CON_FRAMEWORK")) {
define("CON_FRAMEWORK", true);
}
@ -36,12 +40,8 @@ $contenido_path = '';
# include the config file of the frontend to init the Client and Language Id
include_once ("config.php");
// include security class and check request variables
include_once ($contenido_path . 'classes/class.security.php');
Contenido_Security::checkRequests();
include_once ($contenido_path . "includes/startup.php");
cInclude("includes", "functions.general.php");
// Contenido startup process
include_once ($contenido_path . 'includes/startup.php');
if ($contenido)
{

19
conlite/external/frontend/environment.php vendored Normale Datei
Datei anzeigen

@ -0,0 +1,19 @@
<?php
// Load environment config file
$configEnv = str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . '/data/config/config.environment.php';
if (file_exists($configEnv)) {
include_once($configEnv);
}
if (!defined('CL_ENVIRONMENT')) {
if (getenv('CONLITE_ENVIRONMENT')) {
define('CL_ENVIRONMENT', getenv('CONLITE_ENVIRONMENT'));
} if (getenv('CONTENIDO_ENVIRONMENT')) {
define('CL_ENVIRONMENT', getenv('CONTENIDO_ENVIRONMENT'));
} else {
define('CL_ENVIRONMENT', 'production');
}
}
//echo CL_ENVIRONMENT;

BIN
conlite/external/frontend/favicon.ico vendored Normale Datei

Binäre Datei nicht angezeigt.

Nachher

Breite:  |  Höhe:  |  Größe: 28 KiB

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,40 +1,25 @@
<?php
/**
* Project:
* Contenido Content Management System
* file: front_crcloginform.inc.php
*
* Description:
* <Description>
*
* Requirements:
* @con_php_req 5
* @con_template <Templatefiles>
* @con_notice <Notice>
*
*
* @package ContenidoBackendArea
* @version <version>
* @package ConLite
* @subpackage Frontend
* @version $Rev$
* @author Ortwin Pinke
* @copyright conrepo.org
* @link http://conlite.conrepo.org
* @author Jan Lengowski
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
*
*
* {@internal
* created 2003-01-21
* modified 2005-09-29, Andreas Lindner
* modified 2008-07-04, bilal arslan, added security fix
* modified 2008-11-18, Murat Purc, add usage of Contenido_Url to create urls to frontend pages and redesign of HTML markup
* modified 2009-01-03, Murat Purc, synchronized with cms/front_crcloginform.inc.php
* modified 2011-02-07, Dominik Ziegler, fixed check of but_ok.gif and changed input type button to submit
*
* $Id$:
* }}
*
*/
/**
* security check
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -108,18 +93,17 @@ if ( file_exists($cfgClient[$client]['path']['frontend'] . 'images/but_ok.gif')
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $encoding[$lang] ?>" />
<meta charset="<?php echo $encoding[$lang] ?>" />
<title>:: :: :: :: Contenido Login</title>
<script type="text/javascript"><!--
<script type="text/javascript">
if (top != self) {
top.location.href = self.location.href;
}
// --></script>
<style type="text/css"><!--
</script>
<style type="text/css">
* {margin:0; padding:0;}
html, body {height: 100%;}
body {background-color:#fff; font-family: Verdana, Arial, Helvetica, Sans-Serif; font-size: 11px; color:#000;}
@ -134,7 +118,7 @@ if ( file_exists($cfgClient[$client]['path']['frontend'] . 'images/but_ok.gif')
#login .formHeader {font-weight:bold; background-color:<?php echo $cfg['color']['table_header'] ?>; border-bottom:1px solid <?php echo $cfg['color']['table_border'] ?>; padding:3px; margin-bottom:10px;}
#login .formRow {padding:0 10px; height:31px;}
#login .clear {clear:both;}
// --></style>
</style>
</head>
<body>
@ -156,13 +140,14 @@ if ( file_exists($cfgClient[$client]['path']['frontend'] . 'images/but_ok.gif')
</form>
</div>
<script type="text/javascript"><!--
if (document.login.username.value == '') {
<script type="text/javascript">
<!--
if (document.login.username.value == '') {
document.login.username.focus();
} else {
} else {
document.login.password.focus();
}
// --></script>
}
// -->
</script>
</body>
</html>

Datei anzeigen

@ -0,0 +1,85 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
* Recursive loop over given category for building a frontend navigation
*
* @package Frontend
* @subpackage Navigation
* @version 1.0.0
* @author Rudi Bieller
* @copyright four for business AG <www.4fb.de>
*
* $Id$
*/
class Contenido_NavMain_Util {
/**
* Recursive Loop over all (sub)categories.
* Each level will be assigned a css class navmainStandardLevel_x
*
* @param Contenido_Category $oCategory
* @param Contenido_FrontendNavigation $oFrontendNavigation
* @param Template $oTpl
* @param string $sUrlStyle
* @param array $aCfg
* @param int $iLang
* @param array $aLevelInfo Information for marking active cat per levels
* @param array $aDepthInfo Info on level depth / where to stop. Format: array(iCurrentLoopCount, iMaxLoopCount)
* @return void
*/
public static function loopCats(Contenido_Category $oCategory, Contenido_FrontendNavigation $oFrontendNavigation, Template $oTpl, array $aCfg, $iLang, array $aLevelInfo, $iCurrentPageIdcat, array $aDepthInfo = array()) {
$aDepthInfo[0] = isset($aDepthInfo[0]) ? $aDepthInfo[0] + 1 : 1;
$aDepthInfo[1] = isset($aDepthInfo[1]) ? $aDepthInfo[1] : 1;
// display current item
$iItemLevel = $oFrontendNavigation->getLevel($oCategory->getIdCat());
if (!isset($aLevelInfo[$oCategory->getIdCat()])) {
$aLevelInfo[$oCategory->getIdCat()] = array();
}
$oCurrentSubcategories = $oFrontendNavigation->getSubCategories($oCategory->getIdCat());
$aLevelInfo[$oCategory->getIdCat()]['has_children'] = $oCurrentSubcategories->count() > 0;
$aLevelInfo[$oCategory->getIdCat()]['first_child_item'] = -1;
$aLevelInfo[$oCategory->getIdCat()]['last_child_item'] = -1;
$bMarkActive = $oCategory->getIdCat() == $iCurrentPageIdcat || $oFrontendNavigation->isInPathToRoot($oCategory->getIdCat(), $iCurrentPageIdcat);
if ($oCurrentSubcategories->count() > 0) {
$aLevelInfo[$oCategory->getIdCat()]['first_child_item'] = $oCurrentSubcategories[0]->getIdCat();
$aLevelInfo[$oCategory->getIdCat()]['last_child_item'] = $oCurrentSubcategories[$oCurrentSubcategories->count()-1]->getIdCat();
}
// this is just for sample client - modify to your needs!
if (($aCfg['url_builder']['name'] == 'front_content') || ($aCfg['url_builder']['name'] == 'MR')) {
$aParams = array('lang' => $iLang, 'idcat' => $oCategory->getIdCat());
} else {
$aParams = array('a' => $oCategory->getIdCat(),
'idcat' => $oCategory->getIdCat(), // needed to build category path
'lang' => $iLang, // needed to build category path
'level' => 1); // needed to build category path
}
// fill template with values
$oTpl->set('d', 'name', $oCategory->getCategoryLanguage()->getName());
$oTpl->set('d', 'css_level', $iItemLevel);
$oTpl->set('d', 'css_first_item', ($aLevelInfo[$oCategory->getIdParent()]['first_child_item'] == $oCategory->getIdCat() ? ' first' : ''));
$oTpl->set('d', 'css_last_item', ($aLevelInfo[$oCategory->getIdParent()]['last_child_item'] == $oCategory->getIdCat() ? ' last' : ''));
$oTpl->set('d', 'css_active_item', ($bMarkActive === true ? ' active' : ''));
try {
$oTpl->set('d', 'url', Contenido_Url::getInstance()->build($aParams));
} catch (InvalidArgumentException $e) {
$oTpl->set('d', 'url', '#');
}
$oTpl->next();
// continue until max level depth
if ($aDepthInfo[1] > $aDepthInfo[0]) {
// check if current item has sub-items to be displayed
$bShowFollowUps = ($oCategory->getIdCat() == $iCurrentPageIdcat || $oFrontendNavigation->isInPathToRoot($oCategory->getIdCat(), $iCurrentPageIdcat))
? true : false;
if ($bShowFollowUps === true && $oCurrentSubcategories->count() > 0) {
$oSubCategories = $oCurrentSubcategories;
foreach ($oSubCategories as $oSubCategory) {
self::loopCats($oSubCategory, $oFrontendNavigation, $oTpl, $aCfg, $iLang, $aLevelInfo, $iCurrentPageIdcat, $aDepthInfo);
}
}
}
}
}
?>

Datei anzeigen

@ -0,0 +1,66 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
* Recursive loop over given category for building a sitemap navigation
*
* @package Frontend
* @subpackage Navigation
* @version 1.0.0
* @author Rudi Bieller
* @copyright four for business AG <www.4fb.de>
*
* $Id$
*/
class Contenido_Sitemap_Util {
/**
* Recursive Loop over all (sub)categories.
* Each level will be assigned a css class sitemapStandardLevel_x
*
* @param Contenido_Category $oCategory
* @param Contenido_FrontendNavigation $oFrontendNavigation
* @param Template $oTpl
* @param string $sUrlStyle
* @param array $aCfg
* @param int $iLang
* @param array $aDepthInfo Info on level depth / where to stop. Format: array(iCurrentLoopCount, iMaxLoopCount)
* @return void
*/
public static function loopCats(Contenido_Category $oCategory, Contenido_FrontendNavigation $oFrontendNavigation, Template $oTpl, $sUrlStyle, array $aCfg, $iLang, array $aDepthInfo = array()) {
$aDepthInfo[0] = isset($aDepthInfo[0]) ? $aDepthInfo[0] + 1 : 1;
$aDepthInfo[1] = isset($aDepthInfo[1]) ? $aDepthInfo[1] : 1;
// display current item
$iItemLevel = $oFrontendNavigation->getLevel($oCategory->getIdCat());
// this is just for sample client - modify to your needs!
if (($aCfg['url_builder']['name'] == 'front_content') || ($aCfg['url_builder']['name'] == 'MR')) {
$aParams = array('lang' => $iLang, 'idcat' => $oCategory->getIdCat());
} else {
$aParams = array('a' => $oCategory->getIdCat(),
'idcat' => $oCategory->getIdCat(), // needed to build category path
'lang' => $iLang, // needed to build category path
'level' => 1); // needed to build category path
}
// fill template with values
$oTpl->set('d', 'name', $oCategory->getCategoryLanguage()->getName());
$oTpl->set('d', 'css_level', $iItemLevel);
try {
$oTpl->set('d', 'url', Contenido_Url::getInstance()->build($aParams));
} catch (InvalidArgumentException $e) {
$oTpl->set('d', 'url', '#');
}
$oTpl->next();
// continue until max level depth
if ($aDepthInfo[1] > $aDepthInfo[0]) {
// check if current item has sub-items
$oSubCategories = $oFrontendNavigation->getSubCategories($oCategory->getIdCat());
if ($oSubCategories->count() > 0) {
foreach ($oSubCategories as $oSubCategory) {
self::loopCats($oSubCategory, $oFrontendNavigation, $oTpl, $sUrlStyle, $aCfg, $iLang, $aDepthInfo);
}
}
}
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -26,14 +27,13 @@
*
* $Id$:
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// Select box with additional functions for category and article selection
class cHTMLInputSelectElement extends cHTMLSelectElement
{
class cHTMLInputSelectElement extends cHTMLSelectElement {
/**
* Constructor. Creates an HTML select field (aka "DropDown").
*
@ -45,13 +45,11 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* @param string $sAccesskey Key to access the field
*
* @return none
**/
function cHTMLInputSelectElement ($sName, $iWidth = "", $sID = "", $bDisabled = false, $iTabIndex = null, $sAccessKey = "")
{
* */
function __construct($sName, $iWidth = "", $sID = "", $bDisabled = false, $iTabIndex = null, $sAccessKey = "") {
cHTMLSelectElement :: __construct($sName, $iWidth, $sID, $bDisabled, $iTabIndex, $sAccessKey);
}
/**
* Function addArticles. Adds articles to select box values.
*
@ -61,27 +59,25 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* @param string $sSpaces Just some "&nbsp;" to show data hierarchically (used in conjunction with addCategories)
*
* @return int Number of items added
**/
function addArticles ($iIDCat, $bColored = false, $bArtOnline = true, $sSpaces = "")
{
* */
function addArticles($iIDCat, $bColored = false, $bArtOnline = true, $sSpaces = "") {
global $cfg, $lang;
$oDB = new DB_ConLite;
$oDB = new DB_Contenido;
if (is_numeric($iIDCat) && $iIDCat > 0)
{
if (is_numeric($iIDCat) && $iIDCat > 0) {
$sSQL = "SELECT tblArtLang.title AS title, tblArtLang.idartlang AS idartlang, tblCatArt.idcat AS idcat, ";
$sSQL .= "tblCatArt.idcatart AS idcatart, tblCatArt.is_start AS isstart, tblArtLang.online AS online, ";
$sSQL .= "tblCatLang.startidartlang as idstartartlang ";
$sSQL .= "FROM ".$cfg["tab"]["art_lang"]." AS tblArtLang, ".$cfg["tab"]["cat_art"]." AS tblCatArt, ";
$sSQL .= $cfg["tab"]["cat_lang"]." AS tblCatLang ";
$sSQL .= "WHERE tblCatArt.idcat = '".Contenido_Security::toInteger($iIDCat)."' AND tblCatLang.idcat = tblCatArt.idcat AND tblCatLang.idlang = tblArtLang.idlang AND ";
$sSQL .= "FROM " . $cfg["tab"]["art_lang"] . " AS tblArtLang, " . $cfg["tab"]["cat_art"] . " AS tblCatArt, ";
$sSQL .= $cfg["tab"]["cat_lang"] . " AS tblCatLang ";
$sSQL .= "WHERE tblCatArt.idcat = '" . Contenido_Security::toInteger($iIDCat) . "' AND tblCatLang.idcat = tblCatArt.idcat AND tblCatLang.idlang = tblArtLang.idlang AND ";
if ($bArtOnline) {
$sSQL .= "tblArtLang.online = '1' AND ";
}
$sSQL .= "tblArtLang.idart = tblCatArt.idart AND tblArtLang.idlang = '".Contenido_Security::escapeDB($lang, $oDB)."' ";
$sSQL .= "tblArtLang.idart = tblCatArt.idart AND tblArtLang.idlang = '" . Contenido_Security::escapeDB($lang, $oDB) . "' ";
if ($cfg["is_start_compatible"] == true) {
$sSQL .= "ORDER BY tblCatArt.is_start DESC, tblArtLang.title"; // Getting start article as first article
} else {
@ -95,13 +91,11 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
return 0;
} else {
$iCounter = count($this->_options);
while ($oDB->next_record())
{
while ($oDB->next_record()) {
// Generate new option element
$oOption = new cHTMLOptionElement($sSpaces."&nbsp;&nbsp;&nbsp;".substr(urldecode($oDB->f("title")), 0, 32), $oDB->f("idcatart"));
$oOption = new cHTMLOptionElement($sSpaces . "&nbsp;&nbsp;&nbsp;" . substr(urldecode($oDB->f("title")), 0, 32), $oDB->f("idcatart"));
if ($bColored)
{
if ($bColored) {
$bIsStartArticle = false;
if ($cfg["is_start_compatible"] == true && $oDB->f("isstart") == 1) {
// Compatible mode and "start article" flag is set
@ -111,8 +105,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
$bIsStartArticle = true;
}
if ($bIsStartArticle)
{
if ($bIsStartArticle) {
if ($oDB->f("online") == 0) {
// Start article, but offline -> red
$oOption->setStyle("color: #ff0000;");
@ -150,23 +143,22 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* @param bool $bArtOnline If true, show only online articles
*
* @return int Number of items added
**/
function addCategories ($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true,
$bWithArt = false, $bArtOnline = true)
{
* */
function addCategories($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true,
$bWithArt = false, $bArtOnline = true) {
global $cfg, $client, $lang;
$oDB = new DB_ConLite;
$oDB = new DB_Contenido;
$sSQL = "SELECT tblCat.idcat AS idcat, tblCatLang.name AS name, ";
$sSQL .= "tblCatLang.visible AS visible, tblCatLang.public AS public, tblCatTree.level AS level ";
$sSQL .= "FROM ".$cfg["tab"]["cat"]." AS tblCat, ".$cfg["tab"]["cat_lang"]." AS tblCatLang, ";
$sSQL .= $cfg["tab"]["cat_tree"]." AS tblCatTree ";
$sSQL .= "WHERE tblCat.idclient = '".Contenido_Security::escapeDB($client, $oDB)."' AND tblCatLang.idlang = '".Contenido_Security::escapeDB($lang, $oDB)."' AND ";
$sSQL .= "FROM " . $cfg["tab"]["cat"] . " AS tblCat, " . $cfg["tab"]["cat_lang"] . " AS tblCatLang, ";
$sSQL .= $cfg["tab"]["cat_tree"] . " AS tblCatTree ";
$sSQL .= "WHERE tblCat.idclient = '" . Contenido_Security::escapeDB($client, $oDB) . "' AND tblCatLang.idlang = '" . Contenido_Security::escapeDB($lang, $oDB) . "' AND ";
$sSQL .= "tblCatLang.idcat = tblCat.idcat AND tblCatTree.idcat = tblCat.idcat ";
if ($iMaxLevel > 0) {
$sSQL .= "AND tblCatTree.level < '".Contenido_Security::escapeDB($iMaxLevel, $oDB)."' ";
$sSQL .= "AND tblCatTree.level < '" . Contenido_Security::escapeDB($iMaxLevel, $oDB) . "' ";
}
$sSQL .= "ORDER BY tblCatTree.idtree";
@ -177,8 +169,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
return false;
} else {
$iCounter = count($this->_options);
while ($oDB->next_record())
{
while ($oDB->next_record()) {
$sSpaces = "";
$sStyle = "";
$iID = $oDB->f("idcat");
@ -188,18 +179,17 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
}
// Generate new option element
if (($bCatVisible && $oDB->f("visible") == 0) ||
($bCatPublic && $oDB->f("public") == 0)) {
if (($bCatVisible && $oDB->f("visible") == 0) || ($bCatPublic && $oDB->f("public") == 0)) {
// If category has to be visible or public and it isn't, don't add value
$sValue = "";
} else if ($bWithArt) {
// If article will be added, set negative idcat as value
$sValue = "-".$iID;
$sValue = "-" . $iID;
} else {
// Show only categories - and everything is fine...
$sValue = $iID;
}
$oOption = new cHTMLOptionElement($sSpaces.">&nbsp;".urldecode($oDB->f("name")), $sValue);
$oOption = new cHTMLOptionElement($sSpaces . ">&nbsp;" . urldecode($oDB->f("name")), $sValue);
// Coloring option element, restricted shows grey color
$oOption->setStyle("background-color: #EFEFEF");
@ -227,24 +217,22 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* @param string $sTypeRange Komma separated list of Contenido type ids which may be in the resulting list (e.g. '1','17','28')
*
* @return int Number of items added
**/
function addTypesFromArt ($iIDCatArt, $sTypeRange = "")
{
* */
function addTypesFromArt($iIDCatArt, $sTypeRange = "") {
global $cfg, $lang;
$oDB = new DB_ConLite;
$oDB = new DB_Contenido;
if (is_numeric($iIDCatArt) && $iIDCatArt > 0)
{
if (is_numeric($iIDCatArt) && $iIDCatArt > 0) {
$sSQL = "SELECT tblContent.typeid AS typeid, tblContent.idtype AS idtype, tblType.type AS type, tblType.description AS description, ";
$sSQL .= "tblContent.value AS value ";
$sSQL .= "FROM ".$cfg["tab"]["content"]." AS tblContent, ".$cfg["tab"]["art_lang"]." AS tblArtLang, ";
$sSQL .= $cfg["tab"]["cat_art"]." AS tblCatArt, ".$cfg["tab"]["type"]." AS tblType ";
$sSQL .= "FROM " . $cfg["tab"]["content"] . " AS tblContent, " . $cfg["tab"]["art_lang"] . " AS tblArtLang, ";
$sSQL .= $cfg["tab"]["cat_art"] . " AS tblCatArt, " . $cfg["tab"]["type"] . " AS tblType ";
$sSQL .= "WHERE tblContent.idtype = tblType.idtype AND tblContent.idartlang = tblArtLang.idartlang AND ";
$sSQL .= "tblArtLang.idart = tblCatArt.idart AND tblArtLang.idlang = '". Contenido_Security::escapeDB($lang, $oDB)."' AND tblCatArt.idcatart = '". Contenido_Security::toInteger($iIDCatArt)."' ";
$sSQL .= "tblArtLang.idart = tblCatArt.idart AND tblArtLang.idlang = '" . Contenido_Security::escapeDB($lang, $oDB) . "' AND tblCatArt.idcatart = '" . Contenido_Security::toInteger($iIDCatArt) . "' ";
if ($sTypeRange != "") {
$sSQL .= "AND tblContent.idtype IN (". Contenido_Security::escapeDB($sTypeRange, $oDB).") ";
$sSQL .= "AND tblContent.idtype IN (" . Contenido_Security::escapeDB($sTypeRange, $oDB) . ") ";
}
$sql .= "ORDER BY tblContent.idtype, tblContent.typeid";
@ -255,12 +243,11 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
if ($iCount == 0) {
return false;
} else {
while ($oDB->next_record())
{
$sTypeIdentifier = "tblData.idtype = '".$oDB->f('idtype')."' AND tblData.typeid = '".$oDB->f('typeid')."'";
while ($oDB->next_record()) {
$sTypeIdentifier = "tblData.idtype = '" . $oDB->f('idtype') . "' AND tblData.typeid = '" . $oDB->f('typeid') . "'";
// Generate new option element
$oOption = new cHTMLOptionElement($oDB->f('type')."[".$oDB->f('typeid')."]: ".substr(strip_tags(urldecode($oDB->f("value"))), 0, 50), $sTypeIdentifier);
$oOption = new cHTMLOptionElement($oDB->f('type') . "[" . $oDB->f('typeid') . "]: " . substr(strip_tags(urldecode($oDB->f("value"))), 0, 50), $sTypeIdentifier);
// Add option element to the list
$this->addOptionElement($sTypeIdentifier, $oOption);
@ -279,14 +266,10 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
*
* @return none
*/
function setSelected($aElements)
{
if (is_array($this->_options) && is_array($aElements))
{
foreach ($this->_options as $sKey => $oOption)
{
if (in_array($oOption->getAttribute("value"), $aElements))
{
function setSelected($aElements) {
if (is_array($this->_options) && is_array($aElements)) {
foreach ($this->_options as $sKey => $oOption) {
if (in_array($oOption->getAttribute("value"), $aElements)) {
$oOption->setSelected(true);
$this->_options[$sKey] = $oOption;
} else {
@ -296,13 +279,13 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
}
}
}
}
class UI_Config_Table
{
class UI_Config_Table {
var $_sTplCellCode;
var $_sTplTableFile;
var $_sWidth;
var $_sBorder;
var $_sBorderColor;
@ -316,148 +299,125 @@ class UI_Config_Table
var $_aRowBgColor;
var $_aRowExtra;
var $_bAddMultiSelJS;
var $_sColorLight;
var $_sColorDark;
function UI_Config_Table()
{
function __construct() {
global $cfg;
$this->_sPadding = 2;
$this->_sBorder = 0;
$this->_sBorderColor = $cfg['color']['table_border'];
$this->_sTplCellCode = ' <td align="{ALIGN}" valign="{VALIGN}" class="{CLASS}" colspan="{COLSPAN}" style="{EXTRA}white-space:nowrap;" nowrap="nowrap">{CONTENT}</td>'."\n";
$this->_sTplTableFile = $cfg['path']['contenido'].$cfg['path']['templates'].$cfg['templates']['generic_list'];
$this->_sTplCellCode = ' <td align="{ALIGN}" valign="{VALIGN}" class="{CLASS}" colspan="{COLSPAN}" style="{EXTRA}white-space:nowrap;" nowrap="nowrap">{CONTENT}</td>' . "\n";
$this->_sTplTableFile = $cfg['path']['contenido'] . $cfg['path']['templates'] . $cfg['templates']['generic_list'];
$this->_sColorLight = $cfg['color']['table_light'];
$this->_sColorDark = $cfg['color']['table_dark'];
}
function setCellTemplate($sCode)
{
function setCellTemplate($sCode) {
$this->_sTplCellCode = $sCode;
}
function setTableTemplateFile($sPath)
{
function setTableTemplateFile($sPath) {
$this->_sTplTableFile = $sPath;
}
function setLightColor($sColor)
{
function setLightColor($sColor) {
$this->_sColorLight = $sColor;
}
function setDarkColor($sColor)
{
function setDarkColor($sColor) {
$this->_sColorDark = $sColor;
}
function setAddMultiSelJS($bEnabled = true)
{
$this->_bAddMultiSelJS = (bool)$bEnabled;
function setAddMultiSelJS($bEnabled = true) {
$this->_bAddMultiSelJS = (bool) $bEnabled;
}
function setWidth ($sWidth)
{
function setWidth($sWidth) {
$this->_sWidth = $sWidth;
}
function setPadding ($sPadding)
{
function setPadding($sPadding) {
$this->_sPadding = $sPadding;
}
function setBorder ($sBorder)
{
function setBorder($sBorder) {
$this->_sBorder = $sBorder;
}
function setBorderColor ($sBorderColor)
{
function setBorderColor($sBorderColor) {
$this->_sBorderColor = $sBorderColor;
}
function setSolidBorder ($bSolidBorder = true)
{
$this->_bSolidBorder = (bool)$bSolidBorder;
function setSolidBorder($bSolidBorder = true) {
$this->_bSolidBorder = (bool) $bSolidBorder;
}
function setCell ($sRow, $sCell, $sContent)
{
function setCell($sRow, $sCell, $sContent) {
$this->_aCells[$sRow][$sCell] = $sContent;
$this->_aCellAlignment[$sRow][$sCell] = "";
}
function setCellAlignment ($sRow, $sCell, $sAlignment)
{
function setCellAlignment($sRow, $sCell, $sAlignment) {
$this->_aCellAlignment[$sRow][$sCell] = $sAlignment;
}
function setCellVAlignment ($sRow, $sCell, $sAlignment)
{
function setCellVAlignment($sRow, $sCell, $sAlignment) {
$this->_aCellVAlignment[$sRow][$sCell] = $sAlignment;
}
function setCellColspan ($sRow, $sCell, $iColSpan)
{
function setCellColspan($sRow, $sCell, $iColSpan) {
$this->_aCellColSpan[$sRow][$sCell] = $iColSpan;
}
function setCellClass ($sRow, $sCell, $sClass)
{
function setCellClass($sRow, $sCell, $sClass) {
$this->_aCellClass[$sRow][$sCell] = $sClass;
}
function setRowBgColor ($sRow, $sColor)
{
function setRowBgColor($sRow, $sColor) {
$this->_aRowBgColor[$sRow] = $sColor;
}
function setRowExtra ($sRow, $sExtra)
{
function setRowExtra($sRow, $sExtra) {
$this->_aRowExtra[$sRow] = $sExtra;
}
function _addMultiSelJS()
{
function _addMultiSelJS() {
// Trick: To save multiple selections in <select>-Element, add some JS which saves the
// selection, comma separated in a hidden input field on change.
// Try ... catch prevents error messages, if function is added more than once
// if (!fncUpdateSel) in JS has not worked...
$sSkript = ' <script type="text/javascript"><!--'."\n".
' try {'."\n".
' function fncUpdateSel(sSelectBox, sStorage)'."\n".
' {'."\n".
' var sSelection = "";'."\n".
' var oSelectBox = document.getElementsByName(sSelectBox)[0];'."\n".
' var oStorage = document.getElementsByName(sStorage)[0];'."\n".
' '."\n".
' if (oSelectBox && oStorage)'."\n".
' {'."\n".
' for (i = 0; i < oSelectBox.length; i++)'."\n".
' {'."\n".
' if(oSelectBox.options[i].selected == true)'."\n".
' {'."\n".
' if (sSelection != "")'."\n".
' sSelection = sSelection + ",";'."\n".
' sSelection = sSelection + oSelectBox.options[i].value;'."\n".
' }'."\n".
' }'."\n".
' oStorage.value = sSelection;'."\n".
' }'."\n".
' }'."\n".
' } catch (e) { }'."\n".
' //--></script>'."\n";
$sSkript = ' <script type="text/javascript"><!--' . "\n" .
' try {' . "\n" .
' function fncUpdateSel(sSelectBox, sStorage)' . "\n" .
' {' . "\n" .
' var sSelection = "";' . "\n" .
' var oSelectBox = document.getElementsByName(sSelectBox)[0];' . "\n" .
' var oStorage = document.getElementsByName(sStorage)[0];' . "\n" .
' ' . "\n" .
' if (oSelectBox && oStorage)' . "\n" .
' {' . "\n" .
' for (i = 0; i < oSelectBox.length; i++)' . "\n" .
' {' . "\n" .
' if(oSelectBox.options[i].selected == true)' . "\n" .
' {' . "\n" .
' if (sSelection != "")' . "\n" .
' sSelection = sSelection + ",";' . "\n" .
' sSelection = sSelection + oSelectBox.options[i].value;' . "\n" .
' }' . "\n" .
' }' . "\n" .
' oStorage.value = sSelection;' . "\n" .
' }' . "\n" .
' }' . "\n" .
' } catch (e) { }' . "\n" .
' //--></script>' . "\n";
return $sSkript;
}
function render($bPrint = false)
{
function render($bPrint = false) {
$oTable = new Template;
$oTable->reset();
@ -469,31 +429,26 @@ class UI_Config_Table
$bDark = false;
$sBgColor = "";
$bMultiSelJSAdded = false;
if (is_array($this->_aCells))
{
foreach ($this->_aCells as $sRow => $aCells)
{
if (is_array($this->_aCells)) {
foreach ($this->_aCells as $sRow => $aCells) {
$iColCount++;
//$bDark = !$bDark;
$sLine = "";
$iCount = 0;
foreach ($aCells as $sCell => $sData)
{
foreach ($aCells as $sCell => $sData) {
$iCount++;
$sTplCell = $this->_sTplCellCode;
if ($this->_bSolidBorder)
{
if ($iCount < count($aCells))
{
if ($this->_bSolidBorder) {
if ($iCount < count($aCells)) {
if ($iColCount < count($this->_aCells)) {
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-bottom: 1px; border-color: '.$this->_sBorderColor.'; border-style: solid;', $sTplCell);
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-bottom: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
} else {
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-color: '.$this->_sBorderColor.'; border-style: solid;', $sTplCell);
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
}
} else if ($iColCount < count($this->_aCells)) {
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-bottom: 1px; border-color: '.$this->_sBorderColor.'; border-style: solid;', $sTplCell);
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-bottom: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
} else {
$sTplCell = str_replace('{EXTRA}', '', $sTplCell);
}
@ -557,7 +512,7 @@ class UI_Config_Table
if ($this->_sWidth) {
// Table: Width
$oTable->set('s', 'EXTRA', 'width: '.$this->_sWidth.';');
$oTable->set('s', 'EXTRA', 'width: ' . $this->_sWidth . ';');
} else {
$oTable->set('s', 'EXTRA', '');
}
@ -569,5 +524,7 @@ class UI_Config_Table
return $sRendered;
}
}
}
?>

Datei anzeigen

@ -0,0 +1,40 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
*
*
* @package Frontend
* @subpackage Functions
* @version $Rev$
* @author unknown
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* $Id$:
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
function getTeaserImage ($text,$return = 'path') {
$regEx = "/<img[^>]*?>.*?/i";
$match = array();
preg_match($regEx, $text, $match);
$regEx = "/(src)(=)(['\"]?)([^\"']*)(['\"]?)/i";
$img = array();
preg_match($regEx, $match[0], $img);
if ($return == 'path') {
return $img[4];
} else {
return $match[0];
}
}
?>

Datei anzeigen

@ -0,0 +1,521 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
*
*
* @package Frontend
* @subpackage Functions
* @version $Rev$
* @author unknown
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* $Id$:
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// create Navigation array for one level
function createNavigationArray($start_id, $db) {
global $user, $cfg, $client, $lang, $auth;
$navigation = array();
$FrontendPermissionCollection = new FrontendPermissionCollection;
// SECURITY-FIX
$sql = "SELECT
A.idcat,
C.name,
C.public,
C.idcatlang
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
C.visible = '1' AND
B.parentid = '" . Contenido_Security::escapeDB($start_id, $db) . "'
ORDER BY
A.idtree";
$db->query($sql);
while ($db->next_record()) {
$cat_id = $db->f("idcat");
$cat_idlang = $db->f("idcatlang");
$visible = false;
if ($db->f("public") != 0) {
$visible = true;
} elseif (($auth->auth['uid'] != '') && ($auth->auth['uid'] != 'nobody')) {
$FrontendGroupMemberCollection = new FrontendGroupMemberCollection;
$FrontendGroupMemberCollection->setWhere("idfrontenduser", $auth->auth['uid']);
$FrontendGroupMemberCollection->query();
$groups = array();
while ($member = $FrontendGroupMemberCollection->next()) {
$groups[] = $member->get("idfrontendgroup");
}
}
if (count($groups) > 0) {
for ($i = 0; $i < count($groups); $i++) {
if ($FrontendPermissionCollection->checkPerm($groups[$i], 'category', 'access', $cat_idlang, true)) {
$visible = true;
}
}
}
if ($visible) {
$navigation[$cat_id] = array("idcat" => $cat_id,
"name" => $db->f("name"),
"target" => '_self', # you can not call getTarget($cat_id, &$db) at this point with the same db instance!
"public" => $db->f("public"));
}
} // end while
$db->free();
return $navigation;
}
/**
* Return target of a given category id
*
* @deprecated
*/
function getTarget($cat_id, $db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
a.external_redirect AS ext
FROM
" . $cfg["tab"]["art_lang"] . " AS a,
" . $cfg["tab"]["cat_art"] . " AS b,
" . $cfg["tab"]["cat"] . " AS c
WHERE
b.idcat = '" . Contenido_Security::escapeDB($cat_id, $db) . "' AND
c.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
c.idcat = b.idcat AND
a.idart = b.idart AND
a.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "'";
$db->query($sql);
$db->next_record();
$target = ( $db->f('ext') == 0 ) ? '_self' : '_blank';
$db->free();
return $target;
}
/**
* Return true if $parentid is parent of $catid
*/
function isParent($parentid, $catid, $db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
a.parentid
FROM
" . $cfg["tab"]["cat"] . " AS a,
" . $cfg["tab"]["cat_lang"] . " AS b
WHERE
a.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
b.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
a.idcat = b.idcat AND
a.idcat = '" . Contenido_Security::escapeDB($catid, $db) . "'";
$db->query($sql);
$db->next_record();
$pre = $db->f("parentid");
if ($parentid == $pre) {
return true;
} else {
return false;
}
}
function getParent($preid, &$db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
a.parentid
FROM
" . $cfg["tab"]["cat"] . " AS a,
" . $cfg["tab"]["cat_lang"] . " AS b
WHERE
a.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
b.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
a.idcat = b.idcat AND
a.idcat = '" . Contenido_Security::escapeDB($preid, $db) . "'";
$db->query($sql);
if ($db->next_record()) {
return $db->f("parentid");
} else {
return false;
}
}
function getLevel($catid, &$db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
level
FROM
" . $cfg["tab"]["cat_tree"] . "
WHERE
idcat = '" . Contenido_Security::escapeDB($catid, $db) . "' ";
$db->query($sql);
if ($db->next_record()) {
return $db->f("level");
} else {
return false;
}
}
/**
* Return path of a given category up to a certain level
*/
function getCategoryPath($cat_id, $level, $reverse = true, &$db) {
$root_path = array();
array_push($root_path, $cat_id);
$parent_id = $cat_id;
while (getLevel($parent_id, $db) != false AND getLevel($parent_id, $db) > $level AND getLevel($parent_id, $db) >= 0) {
$parent_id = getParent($parent_id, $db);
if ($parent_id != false) {
array_push($root_path, $parent_id);
}
}
if ($reverse == true) {
$root_path = array_reverse($root_path);
}
return $root_path;
}
/**
* Return location string of a given category
*/
function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sTextStyleClass, $fullweblink = false, $reverse = true, $mod_rewrite = true, $db) {
global $sess, $cfgClient, $client;
$aCatPath = getCategoryPath($iStartCat, $level, $reverse, $db);
if (is_array($aCatPath) AND count($aCatPath) > 0) {
$aLocation = array();
foreach ($aCatPath as $value) {
if (!$fullweblink) {
if ($mod_rewrite == true) {
$linkUrl = $sess->url("index-a-$value.html");
} else {
$linkUrl = $sess->url("front_content.php?idcat=$value");
}
} else {
if ($mod_rewrite == true) {
$linkUrl = $sess->url($cfgClient[$client]["path"]["htmlpath"] . "index-a-$value.html");
} else {
$linkUrl = $sess->url($cfgClient[$client]["path"]["htmlpath"] . "front_content.php?idcat=$value");
}
}
$name = getCategoryName($value, $db);
$aLocation[] = '<a href="' . $linkUrl . '" class="' . $sLinkStyleClass . '"><nobr>' . $name . '</nobr></a>';
}
}
$sLocation = implode($seperator, $aLocation);
$sLocation = '<span class="' . $sTextStyleClass . '">' . $sLocation . '</span>';
return $sLocation;
}
/**
*
* get subtree by a given id
*
* @param int $idcat Id of category
* @return array Array with all deeper categories
*
* @copyright four for business AG <www.4fb.de>
*/
function getSubTree($idcat_start, $db) {
global $client, $cfg;
// SECURITY-FIX
$sql = "SELECT
B.idcat, A.level
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B
WHERE
A.idcat = B.idcat AND
idclient = '" . Contenido_Security::escapeDB($client, $db) . "'
ORDER BY
idtree";
$db->query($sql);
$subCats = false;
$curLevel = 0;
while ($db->next_record()) {
if ($db->f("idcat") == $idcat_start) {
$curLevel = $db->f("level");
$subCats = true;
} else if ($db->f("level") <= $curLevel) { // ending part of tree
$subCats = false;
}
if ($subCats == true) { //echo "true"; echo $db->f("idcat"); echo "<br>";
$deeper_cats[] = $db->f("idcat");
}
}
return $deeper_cats;
}
function getTeaserDeeperCategories($iIdcat, $db) {
global $client, $cfg, $lang;
// SECURITY-FIX
$sql = "SELECT
B.parentid, B.idcat
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
C.visible = '1' AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "'
ORDER BY
idtree";
$db->query($sql);
$subCats = false;
$curLevel = 0;
while ($db->next_record()) {
if ($db->f("idcat") == $iIdcat) {
$curLevel = $db->f("level");
$subCats = true;
} else if ($curLevel == $db->f("level")) { // ending part of tree
$subCats = false;
}
if ($subCats == true) {
$deeper_cats[] = $db->f("idcat");
}
}
return $deeper_cats;
}
/**
*
* get subtree by a given id, without protected and invisible categories
*
* @param int $idcat Id of category
* @return array Array with all deeper categories
*
* @copyright four for business AG <www.4fb.de>
*/
function getProtectedSubTree($idcat_start, $db) {
global $client, $cfg, $lang;
// SECURITY-FIX
$sql = "SELECT
B.parentid, B.idcat
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
C.visible = '1' AND
C.public = '1' AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "'
ORDER BY
idtree";
$db->query($sql);
$subCats = false;
$curLevel = 0;
while ($db->next_record()) {
if ($db->f("idcat") == $idcat_start) {
$curLevel = $db->f("level");
$subCats = true;
} else if ($curLevel == $db->f("level")) { // ending part of tree
$subCats = false;
}
if ($subCats == true) { //echo "true"; echo $db->f("idcat"); echo "<br>";
$deeper_cats[] = $db->f("idcat");
}
}
return $deeper_cats;
}
/**
* Return category name
*/
function getCategoryName($cat_id, &$db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
*
FROM
" . $cfg["tab"]["cat"] . " AS A,
" . $cfg["tab"]["cat_lang"] . " AS B
WHERE
A.idcat = B.idcat AND
A.idcat = '" . Contenido_Security::escapeDB($cat_id, $db) . "' AND
A.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
B.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "'
";
$db->query($sql);
if ($db->next_record()) {
$cat_name = $db->f("name");
return $cat_name;
} else {
return '';
}
}
// end function
// get direct subcategories of a given category
function getSubCategories($parent_id, $db) {
$subcategories = array();
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
A.idcat
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
C.visible = '1' AND
C.public = '1' AND
B.parentid = '" . Contenido_Security::escapeDB($parent_id, $db) . "'
ORDER BY
A.idtree";
$db->query($sql);
while ($db->next_record()) {
$subcategories[] = $db->f("idcat");
} // end while
return $subcategories;
}
// end function
// get direct subcategories with protected categories
function getProtectedSubCategories($parent_id, $db) {
$subcategories = array();
unset($subcategories);
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
A.idcat
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
B.parentid = '" . Contenido_Security::escapeDB($parent_id, $db) . "'
ORDER BY
A.idtree";
$db->query($sql);
while ($db->next_record()) {
$subcategories[] = $db->f("idcat");
} // end while
return $subcategories;
}
// end function
function checkCatPermission($idcatlang, $public) {
#Check if current user has permissions to access cat
global $auth;
$oDB = new DB_ConLite();
$FrontendPermissionCollection = new FrontendPermissionCollection;
$visible = false;
if ($public != 0) {
$visible = true;
$groups = array();
} elseif (($auth->auth['uid'] != '') && ($auth->auth['uid'] != 'nobody')) {
$FrontendGroupMemberCollection = new FrontendGroupMemberCollection;
$FrontendGroupMemberCollection->setWhere("idfrontenduser", $auth->auth['uid']);
$FrontendGroupMemberCollection->query();
$groups = array();
while ($member = $FrontendGroupMemberCollection->next()) {
$groups[] = $member->get("idfrontendgroup");
}
}
if (count($groups) > 0) {
for ($i = 0; $i < count($groups); $i++) {
if ($FrontendPermissionCollection->checkPerm($groups[$i], 'category', 'access', $idcatlang, true)) {
$visible = true;
}
}
}
return $visible;
}

Datei anzeigen

@ -0,0 +1,59 @@
<?php
function myfile($url) {
// URL zerlegen
$parsedurl = @parse_url($url);
// Host ermitteln, ungültigen Aufruf abfangen
if (empty($parsedurl['host'])) {
return null;
}
$host = $parsedurl['host'];
// Pfadangabe ermitteln
if (empty($parsedurl['path'])) {
$documentpath = '/';
} else {
$documentpath = $parsedurl['path'];
}
// Parameter ermitteln
if (!empty($parsedurl['query'])) {
$documentpath .= '?' . $parsedurl['query'];
}
// Port ermitteln
if (!empty($parsedurl['port'])) {
$port = $parsedurl['port'];
} else {
$port = 80;
}
// Socket öffnen
$fp = @fsockopen($host, $port, $errno, $errstr, 30);
if (!$fp) {
return null;
}
// Request senden
fputs ($fp, "GET {$documentpath} HTTP/1.0\r\nHost: {$host}\r\n\r\n");
// Header auslesen
do {
$line = chop(fgets($fp));
} while ((!empty($line)) && (!feof($fp)));
// Daten auslesen
$result = Array();
while (!feof($fp)) {
$result[] = fgets($fp);
}
// Socket schliessen
fclose($fp);
// Ergebnis-Array zurückgeben
return $result;
}
function prepareStringForOutput($sIn, $sCode = 'ISO-8859-1') {
global $encoding, $lang;
if ((strtoupper($sCode) == 'UTF-8') && (strtoupper($encoding[$lang]) != 'UTF-8')) {
$sOut = utf8_decode($sIn);
} elseif ((strtoupper($encoding[$lang]) == 'UTF-8') && (strtoupper($sCode) != 'UTF-8')) {
$sOut = utf8_encode($sIn);
} else {
$sOut = $sIn;
}
return $sOut;
}
?>

Datei anzeigen

@ -0,0 +1,160 @@
<?php
/*
RSS_PHP - the PHP DOM based RSS Parser
Author: <rssphp.net>
Published: 200801 :: blacknet :: via rssphp.net
RSS_PHP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
Usage:
See the documentation at http://rssphp.net/documentation
Examples:
Can be found online at http://rssphp.net/examples
*/
class rss_php {
public $document;
public $channel;
public $items;
/****************************
public load methods
***/
# load RSS by URL
public function load($url=false, $unblock=true) {
if($url) {
if($unblock) {
$this->loadParser(file_get_contents($url, false, $this->randomContext()));
} else {
$this->loadParser(file_get_contents($url));
}
}
}
# load raw RSS data
public function loadRSS($rawxml=false) {
if($rawxml) {
$this->loadParser($rawxml);
}
}
/****************************
public load methods
@param $includeAttributes BOOLEAN
return array;
***/
# return full rss array
public function getRSS($includeAttributes=false) {
if($includeAttributes) {
return $this->document;
}
return $this->valueReturner();
}
# return channel data
public function getChannel($includeAttributes=false) {
if($includeAttributes) {
return $this->channel;
}
return $this->valueReturner($this->channel);
}
# return rss items
public function getItems($includeAttributes=false) {
if($includeAttributes) {
return $this->items;
}
return $this->valueReturner($this->items);
}
/****************************
internal methods
***/
private function loadParser($rss=false) {
if($rss) {
$this->document = array();
$this->channel = array();
$this->items = array();
$DOMDocument = new DOMDocument;
$DOMDocument->strictErrorChecking = false;
$DOMDocument->loadXML($rss);
$this->document = $this->extractDOM($DOMDocument->childNodes);
}
}
private function valueReturner($valueBlock=false) {
if(!$valueBlock) {
$valueBlock = $this->document;
}
foreach($valueBlock as $valueName => $values) {
if(isset($values['value'])) {
$values = $values['value'];
}
if(is_array($values)) {
$valueBlock[$valueName] = $this->valueReturner($values);
} else {
$valueBlock[$valueName] = $values;
}
}
return $valueBlock;
}
private function extractDOM($nodeList,$parentNodeName=false) {
$itemCounter = 0;
foreach($nodeList as $values) {
if(substr($values->nodeName,0,1) != '#') {
if($values->nodeName == 'item') {
$nodeName = $values->nodeName.':'.$itemCounter;
$itemCounter++;
} else {
$nodeName = $values->nodeName;
}
$tempNode[$nodeName] = array();
if($values->attributes) {
for($i=0;$values->attributes->item($i);$i++) {
$tempNode[$nodeName]['properties'][$values->attributes->item($i)->nodeName] = $values->attributes->item($i)->nodeValue;
}
}
if(!$values->firstChild) {
$tempNode[$nodeName]['value'] = $values->textContent;
} else {
$tempNode[$nodeName]['value'] = $this->extractDOM($values->childNodes, $values->nodeName);
}
if(in_array($parentNodeName, array('channel','rdf:RDF'))) {
if($values->nodeName == 'item') {
$this->items[] = $tempNode[$nodeName]['value'];
} elseif(!in_array($values->nodeName, array('rss','channel'))) {
$this->channel[$values->nodeName] = $tempNode[$nodeName];
}
}
} elseif(substr($values->nodeName,1) == 'text') {
$tempValue = trim(preg_replace('/\s\s+/',' ',str_replace("\n",' ', $values->textContent)));
if($tempValue) {
$tempNode = $tempValue;
}
} elseif(substr($values->nodeName,1) == 'cdata-section'){
$tempNode = $values->textContent;
}
}
return $tempNode;
}
private function randomContext() {
$headerstrings = array();
$headerstrings['User-Agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.'.rand(0,2).'; en-US; rv:1.'.rand(2,9).'.'.rand(0,4).'.'.rand(1,9).') Gecko/2007'.rand(10,12).rand(10,30).' Firefox/2.0.'.rand(0,1).'.'.rand(1,9);
$headerstrings['Accept-Charset'] = rand(0,1) ? 'en-gb,en;q=0.'.rand(3,8) : 'en-us,en;q=0.'.rand(3,8);
$headerstrings['Accept-Language'] = 'en-us,en;q=0.'.rand(4,6);
$setHeaders = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'."\r\n".
'Accept-Charset: '.$headerstrings['Accept-Charset']."\r\n".
'Accept-Language: '.$headerstrings['Accept-Language']."\r\n".
'User-Agent: '.$headerstrings['User-Agent']."\r\n";
$contextOptions = array(
'http'=>array(
'method'=>"GET",
'header'=>$setHeaders
)
);
return stream_context_create($contextOptions);
}
}
?>

Datei anzeigen

@ -0,0 +1,2 @@
This folder is marked as deprecated and will be deleted in next versions of ConLite.
Please use folders in data-directory instead!

Datei anzeigen

@ -112,7 +112,7 @@ class cTinyMCEEditor extends cWYSIWYGEditor {
}
// GZIP
if ($this->_aSettings["contenido_gzip"] == "true") {
if (isset($this->_aSettings["contenido_gzip"]) && $this->_aSettings["contenido_gzip"] == "true") {
$this->setGZIPMode(true);
} else {
$this->setGZIPMode(false);

Datei anzeigen

@ -31,6 +31,8 @@ if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
$bDebug = false;
if (!$idcat) {
$idcat = Contenido_Security::toInteger($_REQUEST['idcat']);
}

Datei anzeigen

@ -89,12 +89,12 @@ class FrontendList
* @param $endwrap Wrap for the list end
* @param $itemwrap Wrap for a single item
*/
function FrontendList ($startwrap, $endwrap, $itemwrap)
function __construct($startwrap, $endwrap, $itemwrap)
{
$this->resultsPerPage = 0;
$this->listStart = 1;
$this->itemwrap = $itemwrap;
$this->itemwrap = (is_null($itemwrap))?'':$itemwrap;
$this->startwrap = $startwrap;
$this->endwrap = $endwrap;
}

Datei anzeigen

@ -264,11 +264,10 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$template = $db->f("template");
$a_c[$value] = preg_replace("/(&\$)/", "", $a_c[$value]);
$tmp1 = preg_split("/&/", $a_c[$value]);
$varstring = array();
if (!empty($a_c[$value])) {
$a_c[$value] = preg_replace("/(&\$)/", "", $a_c[$value]);
$tmp1 = preg_split("/&/", $a_c[$value]);
foreach ($tmp1 as $key1 => $value1) {
@ -277,7 +276,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$varstring["$tmp2[0]"] = $tmp2[1];
}
}
}
$CiCMS_Var = '$C' . $value . 'CMS_VALUE';
$CiCMS_VALUE = '';
@ -305,7 +304,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$output = '<?php $modstart' . $value . ' = getmicrotime(); ?' . '>' . $output . '<?php $modend' . $value . ' = getmicrotime()+0.001; $modtime' . $value . ' = $modend' . $value . ' - $modstart' . $value . '; ?' . '>';
}
if ($fedebug != "") {
if (!empty($fedebug)) {
$output = addslashes('<?php echo \'<img onclick="javascript:showmod' . $value . '();" src="' . $cfg['path']['contenido_fullhtml'] . 'images/but_preview.gif">\'; ?' . '>' . "<br>") . $output;
$output = $output . addslashes('<?php echo \'<script language="javascript">function showmod' . $value . ' () { window.alert(\\\'\'. "' . addslashes($fedebug) . '".\'\\\');} </script>\'; ?' . '>');
}
@ -471,7 +470,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
}
//add system meta tag if there is no user meta tag
if ($bExists == false && strlen($aAutValue['content']) > 0) {
if ($bExists == false && isset($aAutValue['content']) && strlen($aAutValue['content']) > 0) {
array_push($metatags, $aAutValue);
}
}
@ -481,7 +480,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
foreach ($metatags as $value) {
if (getEffectiveSetting('generator', 'html5', "false") == "true") {
if ($value['name'] == 'date')
if (isset($value['name']) && $value['name'] == 'date')
continue;
}
if (!empty($value['content'])) {
@ -497,7 +496,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$oMetaTagGen->removeAttribute("id");
/* Check if metatag already exists */
if (preg_match('/(<meta(?:\s+)name(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)' . $value["name"] . '(?:\s*)(?:\\\\"|\\\\\')(?:[^>]+)>\r?\n?)/i', $code, $aTmetatagfound)) {
if (isset($value["name"]) && preg_match('/(<meta(?:\s+)name(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)' . $value["name"] . '(?:\s*)(?:\\\\"|\\\\\')(?:[^>]+)>\r?\n?)/i', $code, $aTmetatagfound)) {
$code = str_replace($aTmetatagfound[1], $oMetaTagGen->render() . "\n", $code);
} else if (array_key_exists("charset", $value)
&& preg_match('/(<meta(?:\s+)charset(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(.*)(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(?:\s*|\/)(?:[\^\>]+)\r?\n?)/i', $code, $aTmetatagfound)) {

Datei anzeigen

@ -210,7 +210,8 @@ function fileEdit($filename, $sCode, $path) {
if (is_writable($path . $filename)) {
if (strlen(stripslashes(trim($sCode))) > 0) {
if (!empty($sCode)) {
$sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING');
mb_detect_encoding($sCode);
$sCode = mb_convert_encoding($sCode, 'UTF-8',mb_detect_encoding($sCode));
}
cFileHandler::write($path . $filename, $sCode);
return true;
@ -235,7 +236,8 @@ function fileEdit($filename, $sCode, $path) {
function getFileContent($filename, $path) {
$sCode = cFileHandler::read($path . $filename);
if (!empty($sCode)) {
$sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING');
mb_detect_encoding($sCode);
$sCode = mb_convert_encoding($sCode, 'UTF-8', mb_detect_encoding($sCode));
}
return $sCode;
}

Datei anzeigen

@ -1732,6 +1732,9 @@ function sendPostRequest($host, $path, $data, $referer = "", $port = 80) {
}
function is_dbfs($file) {
if(is_null($file)) {
$file = '';
}
if (substr($file, 0, 5) == "dbfs:") {
return true;
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* functions.system.php
*
@ -20,8 +21,7 @@
* @link http://www.contenido.org
* @since file available since contenido release <= 4.6
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -39,19 +39,19 @@ function emptyLogFile() {
global $cfg, $notification;
$tmp_notification = '';
if($_GET['log'] == 1) {
$sNewLogPath = $cfg['path']['conlite_logs']."errorlog.txt";
$sOldLogPath = $cfg['path']['contenido']."logs/errorlog.txt";
} else if($_GET['log'] == 2) {
$sNewLogPath = $cfg['path']['conlite_logs']."errorlog.txt";
$sOldLogPath = $cfg['path']['contenido']."logs/errorlog.txt";
if ($_GET['log'] == 1) {
$sNewLogPath = $cfg['path']['conlite_logs'] . "errorlog.txt";
$sOldLogPath = $cfg['path']['contenido'] . "logs/errorlog.txt";
} else if ($_GET['log'] == 2) {
$sNewLogPath = $cfg['path']['conlite_logs'] . "errorlog.txt";
$sOldLogPath = $cfg['path']['contenido'] . "logs/errorlog.txt";
}
if(file_exists($sNewLogPath) && is_writable($sNewLogPath)) {
if (file_exists($sNewLogPath) && is_writable($sNewLogPath)) {
$sDelFile = $sNewLogPath;
} else if(file_exists($sOldLogPath) && is_writable($sOldLogPath)) {
} else if (file_exists($sOldLogPath) && is_writable($sOldLogPath)) {
$sDelFile = $sOldLogPath;
} else if(file_exists($sNewLogPath) || file_exists($sOldLogPath)) {
} else if (file_exists($sNewLogPath) || file_exists($sOldLogPath)) {
return $notification->returnNotification("error", i18n("Can't clear install error log : Access is denied!"));
}
@ -68,8 +68,7 @@ function emptyLogFile() {
* @return string returns phpinfo() HTML output
* @author Marco Jahn
*/
function phpInfoToHtml()
{
function phpInfoToHtml() {
/* get output */
ob_start();
phpinfo();
@ -89,45 +88,36 @@ function phpInfoToHtml()
* @return boolean wether user has access or not
* @author Marco Jahn
*/
function system_have_perm($client)
{
function system_have_perm($client) {
global $auth;
if (!isset ($auth->perm['perm']))
{
if (!isset($auth->perm['perm'])) {
$auth->perm['perm'] = '';
}
$userPerm = explode(',', $auth->auth['perm']);
if (in_array('sysadmin', $userPerm))
{ // is user sysadmin ?
if (in_array('sysadmin', $userPerm)) { // is user sysadmin ?
return true;
}
elseif (in_array('admin['.$client.']', $userPerm))
{ // is user admin for this client ?
} elseif (in_array('admin[' . $client . ']', $userPerm)) { // is user admin for this client ?
return true;
}
elseif (in_array('client['.$client.']', $userPerm))
{ // has user access to this client ?
} elseif (in_array('client[' . $client . ']', $userPerm)) { // has user access to this client ?
return true;
}
return false;
}
/**
* check for valid ip adress
*
* @param string ip adress
*
* @return boolean if string is a valid ip or not
*/
function isIPv4($strHostAdress)
{
* check for valid ip adress
*
* @param string ip adress
*
* @return boolean if string is a valid ip or not
*/
function isIPv4($strHostAdress) {
// ip pattern needed for validation
$ipPattern = "([0-9]|1?\d\d|2[0-4]\d|25[0-5])";
if (preg_match("/^$ipPattern\.$ipPattern\.$ipPattern\.$ipPattern?$/", $strHostAdress))
{ // ip is valid
if (preg_match("/^$ipPattern\.$ipPattern\.$ipPattern\.$ipPattern?$/", $strHostAdress)) { // ip is valid
return true;
}
return false;
@ -139,64 +129,50 @@ function isIPv4($strHostAdress)
* @param string $strBrowserUrl current browser string
* @return boolean|string status of path comparement or false
*/
function checkPathInformation($strConUrl, $strBrowserUrl)
{
function checkPathInformation($strConUrl, $strBrowserUrl) {
// parse url
$arrConUrl = parse_url($strConUrl);
$arrBrowserUrl = parse_url($strBrowserUrl);
if($arrConUrl === FALSE || $arrBrowserUrl === FALSE) {
if ($arrConUrl === FALSE || $arrBrowserUrl === FALSE) {
return false;
}
if (isIPv4($arrConUrl['host']))
{ // is
if (isIPv4($arrBrowserUrl['host']))
{ // is
if (compareUrlStrings($arrConUrl, $arrBrowserUrl))
{
if (isIPv4($arrConUrl['host'])) { // is
if (isIPv4($arrBrowserUrl['host'])) { // is
if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
return '1';
}
return '2';
} else
{ // isn't
} else { // isn't
$arrBrowserUrl['host'] = gethostbyname($arrBrowserUrl['host']);
if (!isIPv4($arrBrowserUrl['host']))
{
if (!isIPv4($arrBrowserUrl['host'])) {
return '3';
}
if (compareUrlStrings($arrConUrl, $arrBrowserUrl))
{
if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
return '1';
}
return '2';
}
} else
{ // isn't
if (isIPv4($arrBrowserUrl['host']))
{ //is
} else { // isn't
if (isIPv4($arrBrowserUrl['host'])) { //is
$tmpAddr = gethostbyaddr($arrBrowserUrl['host']);
$arrBrowserUrl['host'] = str_replace('-', '.', substr($tmpAddr, 0, strpos($tmpAddr, ".")));
if (isIPv4($arrBrowserUrl['host']))
{
if (isIPv4($arrBrowserUrl['host'])) {
return '3';
}
if (compareUrlStrings($arrConUrl, $arrBrowserUrl, true))
{
if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
return '1';
}
return '2';
} else
{ // isn't
if (compareUrlStrings($arrConUrl, $arrBrowserUrl))
{
} else { // isn't
if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
return '1';
}
@ -210,30 +186,44 @@ function checkPathInformation($strConUrl, $strBrowserUrl)
*
* @param array $arrConUrl
* @param array $arrBrowserUrl
* @param boolean $isIP not used, don' t know if needed
* @return boolean
*/
function compareUrlStrings($arrConUrl, $arrBrowserUrl, $isIP = false)
{
// && $isIP == false
function compareUrlStrings($arrConUrl, $arrBrowserUrl) {
// remove 'www.' if needed
if (strpos($arrConUrl['host'], 'www.') == 0 || strpos($arrBrowserUrl['host'], 'www.') == 0)
{
if (strpos($arrConUrl['host'], 'www.') == 0 || strpos($arrBrowserUrl['host'], 'www.') == 0) {
$arrConUrl['host'] = str_replace('www.', '', $arrConUrl);
$arrBrowserUrl['host'] = str_replace('www.', '', $arrBrowserUrl);
}
$strConUrl = $arrConUrl['scheme'].'://'.$arrConUrl['host'].$arrConUrl['path'];
$strBrowserUrl = $arrBrowserUrl['scheme'].'://'.$arrBrowserUrl['host'].$arrBrowserUrl['path'];
$strConUrl = unparse_url($arrConUrl);
$strBrowserUrl = unparse_url($arrBrowserUrl);
if (strcmp($strConUrl, $strBrowserUrl) != 0)
{
if (strcmp($strConUrl, $strBrowserUrl) != 0) {
return false;
}
return true;
}
/**
* Convert parse_url array to string
*
* @param array $parsed_url
* @return string URL
*/
function unparse_url($parsed_url) {
$scheme = isset($parsed_url['scheme']) && is_string($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
$host = isset($parsed_url['host']) && is_string($parsed_url['host']) ? $parsed_url['host'] : '';
$port = isset($parsed_url['port']) && is_string($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
$user = isset($parsed_url['user']) && is_string($parsed_url['user']) ? $parsed_url['user'] : '';
$pass = isset($parsed_url['pass']) && is_string($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
$pass = ($user || $pass) ? "$pass@" : '';
$path = isset($parsed_url['path']) && is_string($parsed_url['path']) ? $parsed_url['path'] : '';
$query = isset($parsed_url['query']) && is_string($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
$fragment = isset($parsed_url['fragment']) && is_string($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
return "$scheme$user$pass$host$port$path$query$fragment";
}
/**
* writeSystemValuesOutput - get several server and Contenido settings
*
@ -242,68 +232,59 @@ function compareUrlStrings($arrConUrl, $arrBrowserUrl, $isIP = false)
* @return string returns a string containing several server and Contenido settings
* @author Marco Jahn
*/
function writeSystemValuesOutput($usage)
{
function writeSystemValuesOutput($usage) {
global $db, $_SERVER, $cfg, $i18n, $tpl;
/* variables to proof against each other*/
/* variables to proof against each other */
$contenidoFullHtml = $cfg['path']['contenido_fullhtml'];
$browserPath = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http';
$browserPath .= "://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$browserPath .= "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$browserPath = substr($browserPath, 0, strrpos($browserPath, "/") + 1);
$status = checkPathInformation($contenidoFullHtml, $browserPath);
if ($status == 1)
{ // green
$contenidoFullHtml = "<span style=\"color:green;\">".$contenidoFullHtml."</span><br>";
$browserPath = "<span style=\"color:green;\">".$browserPath."</span>";
}
elseif ($status == 2)
{ // red
$contenidoFullHtml = "<span style=\"color:red;\">".$contenidoFullHtml."</span><br>";
$browserPath = "<span style=\"color:red;\">".$browserPath."</span>";
}
elseif ($status == 3)
{ //orange
$contenidoFullHtml = "<span style=\"color:orange;\">".$contenidoFullHtml."</span><br>";
$browserPath = "<span style=\"color:orange;\">".$browserPath."</span>";
if ($status == 1) { // green
$contenidoFullHtml = "<span style=\"color:green;\">" . $contenidoFullHtml . "</span><br>";
$browserPath = "<span style=\"color:green;\">" . $browserPath . "</span>";
} elseif ($status == 2) { // red
$contenidoFullHtml = "<span style=\"color:red;\">" . $contenidoFullHtml . "</span><br>";
$browserPath = "<span style=\"color:red;\">" . $browserPath . "</span>";
} elseif ($status == 3) { //orange
$contenidoFullHtml = "<span style=\"color:orange;\">" . $contenidoFullHtml . "</span><br>";
$browserPath = "<span style=\"color:orange;\">" . $browserPath . "</span>";
}
/* generate sysvalue output */
$i = 0; // array start value
// current Contenido version
$sysvalues[$i]['variable'] = i18n('Contenido version');
$sysvalues[$i ++]['value'] = $cfg['version'];
$sysvalues[$i++]['value'] = $cfg['version'];
// paths from config.php
$sysvalues[$i]['variable'] = i18n('Contenido path');
$sysvalues[$i ++]['value'] = $cfg['path']['contenido'];
$sysvalues[$i++]['value'] = $cfg['path']['contenido'];
$sysvalues[$i]['variable'] = i18n('Contenido HTML path');
$sysvalues[$i ++]['value'] = $cfg['path']['contenido_html'];
$sysvalues[$i++]['value'] = $cfg['path']['contenido_html'];
$sysvalues[$i]['variable'] = i18n('Contenido full HTML path');
$sysvalues[$i ++]['value'] = $contenidoFullHtml;
$sysvalues[$i++]['value'] = $contenidoFullHtml;
$sysvalues[$i]['variable'] = i18n('Contenido frontend path');
$sysvalues[$i ++]['value'] = $cfg['path']['frontend'];
$sysvalues[$i++]['value'] = $cfg['path']['frontend'];
$sysvalues[$i]['variable'] = i18n('Contenido PHPLIB path');
$sysvalues[$i ++]['value'] = $cfg['path']['phplib'];
$sysvalues[$i++]['value'] = $cfg['path']['phplib'];
$sysvalues[$i]['variable'] = i18n('Contenido wysiwyg path');
$sysvalues[$i ++]['value'] = $cfg['path']['wysiwyg'];
$sysvalues[$i++]['value'] = $cfg['path']['wysiwyg'];
$sysvalues[$i]['variable'] = i18n('Contenido wysiwyg HTML path');
$sysvalues[$i ++]['value'] = $cfg['path']['wysiwyg_html'];
$sysvalues[$i++]['value'] = $cfg['path']['wysiwyg_html'];
// host name
$sysvalues[$i]['variable'] = i18n('Host name');
$sysvalues[$i ++]['value'] = $_SERVER['HTTP_HOST'];
$sysvalues[$i++]['value'] = $_SERVER['HTTP_HOST'];
// Contenido browser path
$sysvalues[$i]['variable'] = i18n('Browser path');
/* cut of file information */
$sysvalues[$i ++]['value'] = $browserPath;
$sysvalues[$i++]['value'] = $browserPath;
// get number of clients
$sql = "SELECT count(name) clientcount FROM ".$cfg["tab"]["clients"];
$sql = "SELECT count(name) clientcount FROM " . $cfg["tab"]["clients"];
$db->query($sql);
$db->next_record();
$clientcount = $db->f("clientcount");
@ -313,7 +294,7 @@ function writeSystemValuesOutput($usage)
a.name clientname,
a.idclient
FROM
".$cfg["tab"]["clients"]." a
" . $cfg["tab"]["clients"] . " a
GROUP BY a.name,
a.idclient";
$db->query($sql);
@ -322,15 +303,13 @@ function writeSystemValuesOutput($usage)
$db2 = new DB_ConLite;
$clientInformation = "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">
<tr class=\"textw_medium\" style=\"background-color: #E2E2E2\">
<td width=\"20%\" class=\"textg_medium\" style=\"border:1px; border-color:#B3B3B3; border-style:solid;; border-bottom: none;\" nowrap=\"nowrap\">".i18n("client settings")."</td>
<td class=\"textg_medium\" style=\"border:1px; border-left:0px; border-color: #B3B3B3; border-style: solid;border-bottom: none;\" nowrap=\"nowrap\">".i18n("values")."</td>
<td width=\"20%\" class=\"textg_medium\" style=\"border:1px; border-color:#B3B3B3; border-style:solid;; border-bottom: none;\" nowrap=\"nowrap\">" . i18n("client settings") . "</td>
<td class=\"textg_medium\" style=\"border:1px; border-left:0px; border-color: #B3B3B3; border-style: solid;border-bottom: none;\" nowrap=\"nowrap\">" . i18n("values") . "</td>
</tr>";
$clientPermCount = 0;
while ($db->next_record())
{
if (system_have_perm($db->f("idclient")))
{
while ($db->next_record()) {
if (system_have_perm($db->f("idclient"))) {
$clientlang = "";
// get client name
@ -341,155 +320,149 @@ function writeSystemValuesOutput($usage)
$clientlang = "";
// select languages belong to a client
$sql = "SELECT c.name clientlang
FROM ".$cfg["tab"]["clients"]." a
LEFT JOIN ".$cfg["tab"]["clients_lang"]." b ON a.idclient = b.idclient
LEFT JOIN ".$cfg["tab"]["lang"]." c ON b.idlang = c.idlang
WHERE a.idclient=".Contenido_Security::toInteger($db->f("idclient"))." AND c.name IS NOT NULL";
FROM " . $cfg["tab"]["clients"] . " a
LEFT JOIN " . $cfg["tab"]["clients_lang"] . " b ON a.idclient = b.idclient
LEFT JOIN " . $cfg["tab"]["lang"] . " c ON b.idlang = c.idlang
WHERE a.idclient=" . Contenido_Security::toInteger($db->f("idclient")) . " AND c.name IS NOT NULL";
$db2->query($sql);
while ($db2->next_record())
{
$clientlang .= $db2->f("clientlang").", ";
while ($db2->next_record()) {
$clientlang .= $db2->f("clientlang") . ", ";
}
// cut off last ","
$clientlang = substr($clientlang, 0, strlen($clientlang) - 2);
$clientInformation .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" >
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid; \" nowrap=\"nowrap\" align=\"left\" valign=\"top\">".i18n("language(s)")."</td>
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid; \" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . i18n("language(s)") . "</td>
<td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid; \" nowrap=\"nowrap\">$clientlang&nbsp;</td>
</tr>";
$sql = "SELECT frontendpath, htmlpath FROM ".$cfg["tab"]["clients"]." WHERE idclient='".Contenido_Security::toInteger($db->f("idclient"))."'";
$sql = "SELECT frontendpath, htmlpath FROM " . $cfg["tab"]["clients"] . " WHERE idclient='" . Contenido_Security::toInteger($db->f("idclient")) . "'";
$db2->query($sql);
while ($db2->next_record())
{
while ($db2->next_record()) {
$clientInformation .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" >
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">".i18n("htmlpath")."</td>
<td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">".$db2->f("htmlpath")."&nbsp;</td>
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . i18n("htmlpath") . "</td>
<td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">" . $db2->f("htmlpath") . "&nbsp;</td>
</tr>";
$clientInformation .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" >
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">".i18n("frontendpath")."</td>
<td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">".$db2->f("frontendpath")."&nbsp;</td>
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . i18n("frontendpath") . "</td>
<td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">" . $db2->f("frontendpath") . "&nbsp;</td>
</tr>";
}
$clientPermCount ++;
$clientPermCount++;
}
}
}
if ($clientPermCount == 0)
{
if ($clientPermCount == 0) {
$clientInformation .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" >
<td colspan=\"2\" class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid; \" nowrap=\"nowrap\" align=\"left\" valign=\"top\">".i18n("No permissions!")."</td>
<td colspan=\"2\" class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid; \" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . i18n("No permissions!") . "</td>
</tr>";
}
$clientInformation .= '</table>';
$clientdata = i18n('Number of installed clients: ').$clientcount."<br>".$clientInformation;
$clientdata = i18n('Number of installed clients: ') . $clientcount . "<br>" . $clientInformation;
// client quantity and their assigned language and are they online
$sysvalues[$i]['variable'] = i18n('Client informations');
$sysvalues[$i ++]['value'] = "$clientdata";
$sysvalues[$i++]['value'] = "$clientdata";
// get number of users installed
$sql = "SELECT count(user_id) usercount FROM ".$cfg["tab"]["phplib_auth_user_md5"];
$sql = "SELECT count(user_id) usercount FROM " . $cfg["tab"]["phplib_auth_user_md5"];
$db->query($sql);
$db->next_record();
// number of users
$sysvalues[$i]['variable'] = i18n('Number of users');
$sysvalues[$i ++]['value'] = $db->f("usercount");
$sysvalues[$i++]['value'] = $db->f("usercount");
//get number of articles
$sql = "SELECT count(idart) articlecount FROM ".$cfg["tab"]["art"];
$sql = "SELECT count(idart) articlecount FROM " . $cfg["tab"]["art"];
$db->query($sql);
$db->next_record();
// number of articles
$sysvalues[$i]['variable'] = i18n('Number of articles');
$sysvalues[$i ++]['value'] = $db->f("articlecount");
$sysvalues[$i++]['value'] = $db->f("articlecount");
// server operating system
$sysvalues[$i]['variable'] = i18n('Server operating system');
$sysvalues[$i ++]['value'] = $_SERVER['SERVER_SOFTWARE'];
$sysvalues[$i++]['value'] = $_SERVER['SERVER_SOFTWARE'];
// SQL version
$sql_server_info = $db->server_info();
$sysvalues[$i]['variable'] = i18n('PHP database extension');
$sysvalues[$i ++]['value'] = $cfg["database_extension"];
$sysvalues[$i++]['value'] = $cfg["database_extension"];
$sysvalues[$i]['variable'] = i18n('Database server version');
$sysvalues[$i ++]['value'] = $sql_server_info['description'];
$sysvalues[$i++]['value'] = $sql_server_info['description'];
// php version
$sysvalues[$i]['variable'] = i18n('Installed PHP version');
$sysvalues[$i ++]['value'] = phpversion();
$sysvalues[$i++]['value'] = phpversion();
// php config values
// config values
// php safe_mode
(ini_get('safe_mode') == 1) ? $safe_mode = "<span stlye=\"color:red;\">".i18n('activated')."</span>" : $safe_mode = "<span style=\"color:green;\">".i18n('deactivated')."</span>";
(ini_get('safe_mode') == 1) ? $safe_mode = "<span stlye=\"color:red;\">" . i18n('activated') . "</span>" : $safe_mode = "<span style=\"color:green;\">" . i18n('deactivated') . "</span>";
$sysvalues[$i]['variable'] = "safe_mode";
$sysvalues[$i ++]['value'] = $safe_mode;
$sysvalues[$i++]['value'] = $safe_mode;
// magig quotes GPC
(ini_get('magic_quotes_gpc') == 1) ? $magic_quotes_gpc = i18n('activated') : $magic_quotes_gpc = i18n('deactivated');
$sysvalues[$i]['variable'] = "magic_quotes_gpc";
$sysvalues[$i ++]['value'] = $magic_quotes_gpc;
$sysvalues[$i++]['value'] = $magic_quotes_gpc;
// magic quotes runtime
(ini_get('magic_quotes_runtime') == 1) ? $magic_quotes_runtime = i18n('activated') : $magic_quotes_runtime = i18n('deactivated');
$sysvalues[$i]['variable'] = "magic_quotes_runtime";
$sysvalues[$i ++]['value'] = $magic_quotes_runtime;
$sysvalues[$i++]['value'] = $magic_quotes_runtime;
// GPC order
$sysvalues[$i]['variable'] = "gpc_order";
$sysvalues[$i ++]['value'] = ini_get('gpc_order');
$sysvalues[$i++]['value'] = ini_get('gpc_order');
// memory limit
$sysvalues[$i]['variable'] = "memory_limit";
$sysvalues[$i ++]['value'] = ini_get('memory_limit');
$sysvalues[$i++]['value'] = ini_get('memory_limit');
// max execution time
$sysvalues[$i]['variable'] = "max_execution_time";
$sysvalues[$i ++]['value'] = ini_get('max_execution_time');
$sysvalues[$i++]['value'] = ini_get('max_execution_time');
// disabled functions
(strlen(ini_get('disable_functions')) > 0) ? $disable_functions = "<span style=\"color:red;\">". str_replace(",", ", ", ini_get('disable_functions'))."</span>" : $disable_functions = "<span style=\"color:green\">".i18n('nothing disabled')."</span>";
(strlen(ini_get('disable_functions')) > 0) ? $disable_functions = "<span style=\"color:red;\">" . str_replace(",", ", ", ini_get('disable_functions')) . "</span>" : $disable_functions = "<span style=\"color:green\">" . i18n('nothing disabled') . "</span>";
$sysvalues[$i]['variable'] = i18n('Disabled functions');
$sysvalues[$i ++]['value'] = $disable_functions;
$sysvalues[$i++]['value'] = $disable_functions;
// gettext loaded
(extension_loaded('gettext') == true) ? $gettext = "<span style=\"color:green;\">".i18n('loaded')."</span>" : $gettext = "<span stlye=\"color:red;\">".i18n('not loaded')."</span>";
(extension_loaded('gettext') == true) ? $gettext = "<span style=\"color:green;\">" . i18n('loaded') . "</span>" : $gettext = "<span stlye=\"color:red;\">" . i18n('not loaded') . "</span>";
$sysvalues[$i]['variable'] = i18n('Gettext extension');
$sysvalues[$i ++]['value'] = $gettext;
$sysvalues[$i++]['value'] = $gettext;
// sql.safe_mode
(ini_get('sql.safe_mode') == 1) ? $sql_safe_mode = "<span style=\"color:red;\">".i18n('activated')."</span>" : $sql_safe_mode = "<span style=\"color:green;\">".i18n('deactivated')."</span>";
(ini_get('sql.safe_mode') == 1) ? $sql_safe_mode = "<span style=\"color:red;\">" . i18n('activated') . "</span>" : $sql_safe_mode = "<span style=\"color:green;\">" . i18n('deactivated') . "</span>";
$sysvalues[$i]['variable'] = "sql.safe_mode";
$sysvalues[$i ++]['value'] = $sql_safe_mode;
$sysvalues[$i++]['value'] = $sql_safe_mode;
// gdlib with installed features
$gdLib = array();
$gdLib = getPhpModuleInfo($moduleName = 'gd');
$gdLibFeatures = "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">
<tr class=\"textg_medium\" style=\"background-color: #E2E2E2\">
<td width=\"20%\" class=\"textg_medium\" style=\"border:1px; border-color:#B3B3B3; border-style:solid;border-bottom:none\" nowrap=\"nowrap\">".i18n("Settings")."</td>
<td class=\"textg_medium\" style=\"border:1px; border-left:0px; border-color: #B3B3B3; border-style: solid; border-bottom:none\" nowrap=\"nowrap\">".i18n("Values")."</td>
<td width=\"20%\" class=\"textg_medium\" style=\"border:1px; border-color:#B3B3B3; border-style:solid;border-bottom:none\" nowrap=\"nowrap\">" . i18n("Settings") . "</td>
<td class=\"textg_medium\" style=\"border:1px; border-left:0px; border-color: #B3B3B3; border-style: solid; border-bottom:none\" nowrap=\"nowrap\">" . i18n("Values") . "</td>
</tr>";
foreach ($sysvalues as $key => $value) {
if (trim ($value['value']) == '') {
if (trim($value['value']) == '') {
$sysvalues[$key]['value'] = '&nbsp;';
}
}
foreach ($gdLib as $setting => $value)
{
foreach ($gdLib as $setting => $value) {
$gdLibFeatures .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" >
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">".$setting."</td>
<td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">".$value[0]."</td>
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . $setting . "</td>
<td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">" . $value[0] . "</td>
</tr>";
}
$gdLibFeatures .= '</table>';
$sysvalues[$i]['variable'] = i18n('GD library');
$sysvalues[$i ++]['value'] = $gdLibFeatures;
$sysvalues[$i++]['value'] = $gdLibFeatures;
// include path settings
$sysvalues[$i]['variable'] = "include_path";
$sysvalues[$i ++]['value'] = ini_get('include_path');
$sysvalues[$i++]['value'] = ini_get('include_path');
$iRowId = 1;
$sRowBgColor2 = $sRowBgColor1 = "#fff";
$iRowId = 1;
$sRowBgColor2 = $sRowBgColor1 = "#fff";
//loop array for every parameter
foreach ($sysvalues AS $sysvalue)
{
foreach ($sysvalues AS $sysvalue) {
$tpl->set('d', 'VARIABLE', $sysvalue['variable']);
$tpl->set('d', 'LOCALVALUE', $sysvalue['value']);
$tpl->set('d', 'ROWID', 'sysrow_'.$iRowId);
if($iRowId % 2) {
$tpl->set('d', 'ROWID', 'sysrow_' . $iRowId);
if ($iRowId % 2) {
$tpl->set('d', 'BGCOLOR', $sRowBgColor1);
} else {
$tpl->set('d', 'BGCOLOR', $sRowBgColor2);
@ -499,15 +472,11 @@ $sRowBgColor2 = $sRowBgColor1 = "#fff";
}
/* irgendwas sinnvolles :) */
if ($usage == 'mail')
{
return $tpl->generate($cfg['path']['templates'].$cfg['templates']['systam_variables_mailattach'], true);
}
elseif ($usage == 'output')
{
if ($usage == 'mail') {
return $tpl->generate($cfg['path']['templates'] . $cfg['templates']['systam_variables_mailattach'], true);
} elseif ($usage == 'output') {
// do nothing
}
}
/**
@ -535,51 +504,43 @@ $sRowBgColor2 = $sRowBgColor1 = "#fff";
* @return string returns several server and Contenido settings
* @author Marco Jahn
*/
function sendBugReport()
{
function sendBugReport() {
global $_POST, $notification, $cfg;
/* will be set to another value than 0 if an error attempts */
$mailSendError = 0;
/* check if email is filled out */
if (strlen($_POST['sender']) == 0)
{
if (strlen($_POST['sender']) == 0) {
$mailSendError = 1;
}
/* check if forename is filled out */
if (strlen($_POST['forename']) == 0)
{
if (strlen($_POST['forename']) == 0) {
$mailSendError = 1;
}
/* check if surname is filled out */
if (strlen($_POST['surname']) == 0)
{
if (strlen($_POST['surname']) == 0) {
$mailSendError = 1;
}
/* check if bugreport is filled out */
if (strlen($_POST['bugreport']) == 0)
{
if (strlen($_POST['bugreport']) == 0) {
$mailSendError = 1;
}
/* check if email adress is valid */
if (isValidMail($_POST['sender']) == false)
{
if (isValidMail($_POST['sender']) == false) {
$mailSendError = 2;
}
/* user has not agreed */
if ($_POST['agreement'] != 'on')
{
if ($_POST['agreement'] != 'on') {
$mailSendError = 3;
}
if ($mailSendError == 0)
{
if ($mailSendError == 0) {
/* send mail */
/* initialize mail class */
@ -587,7 +548,7 @@ function sendBugReport()
/* set sender information */
$mail->From = strip_tags($_POST['sender']);
$mail->FromName = strip_tags($_POST['forename']." ".$_POST['surname']);
$mail->FromName = strip_tags($_POST['forename'] . " " . $_POST['surname']);
/* set recipient */
$mail->AddAddress($cfg['bugreport']['targetemail'], "Bugreport recipient");
@ -597,65 +558,50 @@ function sendBugReport()
/* generate subject & body */
$mail->Subject = "Bugreport";
$mail->Body = "Fehlerbereich: ".$_POST['selectarea']."<br><br>".nl2br(strip_tags($_POST['bugreport']));
$mail->AltBody = "Fehlerbereich: ".$_POST['selectarea']."\n\n".strip_tags($_POST['bugreport']);
$mail->Body = "Fehlerbereich: " . $_POST['selectarea'] . "<br><br>" . nl2br(strip_tags($_POST['bugreport']));
$mail->AltBody = "Fehlerbereich: " . $_POST['selectarea'] . "\n\n" . strip_tags($_POST['bugreport']);
/* add attachements */
if ($_POST['errorlog'] == 'on')
{
if (filesize($cfg['path']['contenido']."logs/errorlog.txt") > 0)
{ //filesize > 0 send alternative attachement
$mail->AddAttachment($cfg['path']['contenido']."logs/errorlog.txt", "errorlog.txt");
} else
{
if ($_POST['errorlog'] == 'on') {
if (filesize($cfg['path']['contenido'] . "logs/errorlog.txt") > 0) { //filesize > 0 send alternative attachement
$mail->AddAttachment($cfg['path']['contenido'] . "logs/errorlog.txt", "errorlog.txt");
} else {
$mail->AddStringAttachment("No error log entries found\n", "errorlog.txt");
}
}
if ($_POST['upgradeerrorlog'] == 'on')
{
if (filesize($cfg['path']['contenido']."logs/install.log.txt") > 0)
{ //filesize > 0 send alternative attachement
$mail->AddAttachment($cfg['path']['contenido']."logs/install.log.txt", "install.log.txt");
} else
{
if ($_POST['upgradeerrorlog'] == 'on') {
if (filesize($cfg['path']['contenido'] . "logs/install.log.txt") > 0) { //filesize > 0 send alternative attachement
$mail->AddAttachment($cfg['path']['contenido'] . "logs/install.log.txt", "install.log.txt");
} else {
$mail->AddStringAttachment("No install error log entries found\n", "install.log.txt");
}
}
if ($_POST['sysvalues'] == 'on')
{
if ($_POST['sysvalues'] == 'on') {
//send sysvalue output
$mail->AddStringAttachment(writeSystemValuesOutput($usage = 'mail'), "systemvariables.html");
}
if ($_POST['phpinfo'] == 'on')
{
if ($_POST['phpinfo'] == 'on') {
//send phpinfo output
$mail->AddStringAttachment(phpInfoToHtml(), "phpinfo.html");
}
if (!$mail->Send())
{
if (!$mail->Send()) {
$tmp_notification = $notification->returnNotification("error", i18n("an error occured while sending your bug report! Please try again"));
} else
{
} else {
$tmp_notification = $notification->returnNotification("info", i18n("bug report forwarded"));
}
}
elseif ($mailSendError == 1)
{
} elseif ($mailSendError == 1) {
/* user should fill all fields */
$tmp_notification = $notification->returnNotification("warning", i18n("please fill out all mandatory fields"));
}
elseif ($mailSendError == 2)
{ /* email adress is not valid */
} elseif ($mailSendError == 2) { /* email adress is not valid */
$tmp_notification = $notification->returnNotification("warning", i18n("please enter a valid E-Mail adress"));
}
elseif ($mailSendError == 3)
{ /* user hasn't agreed to the declaration of consent */
} elseif ($mailSendError == 3) { /* user hasn't agreed to the declaration of consent */
$tmp_notification = $notification->returnNotification("warning", i18n("you must agree the declaration of consent"));
}
return $mailSendError."||".$tmp_notification;
return $mailSendError . "||" . $tmp_notification;
}
?>

Datei anzeigen

@ -208,7 +208,7 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) {
preg_match_all("/CMS_CONTAINER\[([0-9]*)\]/", $code, $a_container);
$iPosBody = stripos($code, '<body>');
$sCodeBeforeHeader = substr($code, 0, $iPosBody);
if (!empty($a_container)) {
foreach ($a_container[1] as $value) {
if (preg_match("/CMS_CONTAINER\[$value\]/", $sCodeBeforeHeader)) {
$containerinf[$idlay][$value]["is_body"] = false;
@ -216,6 +216,7 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) {
$containerinf[$idlay][$value]["is_body"] = true;
}
}
}
if (is_array($containerinf[$idlay])) {
foreach ($containerinf[$idlay] as $key => $value) {
@ -233,8 +234,10 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) {
asort($container);
if (is_array($container)) {
if (is_array($container) && !empty($container)) {
$tmp_returnstring = implode("&", $container);
} else {
$tmp_returnstring = "";
}
return $tmp_returnstring;
}
@ -359,16 +362,14 @@ function tplPreparseLayout($idlay, $raw_code = NULL) {
if ($parser->iNodeName == "container" && $parser->iNodeType == NODE_TYPE_ELEMENT) {
$idcontainer = $parser->iNodeAttributes["id"];
$mode = $parser->iNodeAttributes["mode"];
if ($mode == "") {
$mode = "optional";
}
$sMode = (isset($parser->iNodeAttributes["mode"]))?$parser->iNodeAttributes["mode"]:'optional';
$sDefault = (isset($parser->iNodeAttributes["default"]))?$parser->iNodeAttributes["default"]:'';
$sTypes = (isset($parser->iNodeAttributes["types"]))?$parser->iNodeAttributes["types"]:'';
$containerinf[$idlay][$idcontainer]["name"] = $parser->iNodeAttributes["name"];
$containerinf[$idlay][$idcontainer]["mode"] = $mode;
$containerinf[$idlay][$idcontainer]["default"] = $parser->iNodeAttributes["default"];
$containerinf[$idlay][$idcontainer]["types"] = $parser->iNodeAttributes["types"];
$containerinf[$idlay][$idcontainer]["mode"] = $sMode;
$containerinf[$idlay][$idcontainer]["default"] = $sDefault;
$containerinf[$idlay][$idcontainer]["types"] = $sTypes;
$containerinf[$idlay][$idcontainer]["is_body"] = $bIsBody;
}
}
@ -726,7 +727,6 @@ function tplAutoFillModules($idtpl) {
if ($db_autofill->next_record()) {
$idmod = $db_autofill->f("idmod");
$sql = "SELECT idcontainer FROM " . $cfg["tab"]["container"] . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'";
$db_autofill->query($sql);
@ -760,7 +760,6 @@ function tplAutoFillModules($idtpl) {
if ($db_autofill->next_record()) {
$idmod = $db_autofill->f("idmod");
$sql = "SELECT idcontainer, idmod FROM " . $cfg["tab"]["container"]
. " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'";

Datei anzeigen

@ -46,9 +46,13 @@ if (!defined('CON_FRAMEWORK')) {
* string is shorter there will be no tooltipp
* @return string - string, which contains short path name and tooltipp if neccessary
*/
function generateDisplayFilePath($sDisplayPath, $iLimit) {
$sDisplayPath = (string) trim($sDisplayPath);
$iLimit = (int) $iLimit;
function generateDisplayFilePath($mDisplayPath, $mLimit) {
if(is_null($mDisplayPath)) {
$sDisplayPath = '';
} else {
$sDisplayPath = (string) trim($mDisplayPath);
}
$iLimit = intval($mLimit);
if (strlen($sDisplayPath) > $iLimit) {
$sDisplayPathShort = capiStrTrimHard($sDisplayPath, $iLimit);
@ -58,12 +62,13 @@ function generateDisplayFilePath($sDisplayPath, $iLimit) {
$aPathFragments = explode('/', $sDisplayPath);
foreach ($aPathFragments as $sFragment) {
if ($sFragment != '') {
if (strlen($sFragment) > ($iLimit - 5)) {
$sFragment = capiStrTrimHard($sFragment, $iLimit);
if (empty($sFragment)) {
continue;
}
if ($iCharcount + strlen($sFragment) + 1 > $iLimit) {
if (strlen($sFragment) > ($iLimit - 5)) {
$sFragment = capiStrTrimHard($sFragment, $iLimit);
} else if ($iCharcount + strlen($sFragment) + 1 > $iLimit) {
$sTooltippString .= '<br>' . $sFragment . '/';
$iCharcount = strlen($sFragment);
} else {
@ -71,7 +76,6 @@ function generateDisplayFilePath($sDisplayPath, $iLimit) {
$sTooltippString .= $sFragment . '/';
}
}
}
$sDisplayPath = '<span onmouseover="Tip(\'' . $sTooltippString . '\', BALLOON, true, ABOVE, true);">' . $sDisplayPathShort . '</span>';
}
@ -111,8 +115,7 @@ function uplDirectoryListRecursive($currentdir, $startdir = NULL, $files = array
foreach ($sorted_files as $file) {
if ($file != ".." && $file != ".") {
if ((filetype(getcwd() . "/" . $file) == "dir") &&
(opendir(getcwd() . "/" . $file) !== false)) {
if ((filetype(getcwd() . "/" . $file) == "dir") && (opendir(getcwd() . "/" . $file) !== false)) {
$a_file['name'] = $file;
$a_file['depth'] = $depth;
$a_file['pathstring'] = $pathstring . $file . '/';
@ -802,7 +805,7 @@ function uplCreateFriendlyName($filename, $spacer = "_") {
$newfilename = "";
if (!is_array($cfg['upl']['allow_additional_chars'])) {
if (!isset($cfg['upl']['allow_additional_chars']) || !is_array($cfg['upl']['allow_additional_chars'])) {
$filename = str_replace(" ", $spacer, $filename);
} elseif (in_array(' ', $cfg['upl']['allow_additional_chars']) === FALSE) {
$filename = str_replace(" ", $spacer, $filename);
@ -823,7 +826,7 @@ function uplCreateFriendlyName($filename, $spacer = "_") {
}
#Check for additionally allowed charcaters in $cfg['upl']['allow_additional_chars'] (must be array of chars allowed)
if (is_array($cfg['upl']['allow_additional_chars']) && !$bFound) {
if (isset($cfg['upl']['allow_additional_chars']) && is_array($cfg['upl']['allow_additional_chars']) && !$bFound) {
if (in_array($atom, $cfg['upl']['allow_additional_chars'])) {
$newfilename .= $atom;
}

Datei anzeigen

@ -475,7 +475,7 @@ if (is_numeric($idcat) && ($idcat >= 0)) {
}
$imgsrc .= '.gif';
$tmp_img = '';
if (($perm->have_perm_area_action("con", "con_makestart") || $perm->have_perm_area_action_item("con", "con_makestart", $idcat)) && $idcat != 0) {
if ($is_start == false) {
$tmp_link = '<a href="' . $sess->url("main.php?area=con&amp;idcat=$idcat&amp;action=con_makestart&amp;idcatart=$idcatart&amp;frame=4&is_start=1&amp;next=$next") . '" title="' . i18n("Flag as start article") . '"><img src="images/' . $imgsrc . '" border="0" title="' . i18n("Flag as start article") . '" alt="' . i18n("Flag as start article") . '" style="margin-left:3px;"></a>';

Datei anzeigen

@ -596,7 +596,8 @@ if ($action == "con_newart" && $newart != true) {
</script>';
foreach ($availableTags as $key => $value) {
$tpl->set('d', 'METAINPUT', 'META' . $value);
// @todo seems to be unused, check if we can delete it (op 17.05.2022)
//$tpl->set('d', 'METAINPUT', 'META' . $value);
switch ($value["fieldtype"]) {
case "text":

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -32,16 +33,15 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
cInclude("includes","functions.str.php");
cInclude("includes","functions.tpl.php");
cInclude("includes", "functions.str.php");
cInclude("includes", "functions.tpl.php");
cInclude('includes', 'functions.lang.php');
if(!isset($oTpl) || !is_object($oTpl)) {
if (!isset($oTpl) || !is_object($oTpl)) {
$oTpl = new Template();
}
$oTpl->reset();
@ -50,14 +50,12 @@ global $sess, $frame, $area;
$idcat = ( isset($_GET['idcat']) && is_numeric($_GET['idcat'])) ? $_GET['idcat'] : -1;
//Get sync options
if (isset($syncoptions))
{
if (isset($syncoptions)) {
$syncfrom = (int) $syncoptions;
$remakeCatTable = true;
}
if (!isset($syncfrom))
{
if (!isset($syncfrom)) {
$syncfrom = -1;
}
@ -65,22 +63,19 @@ $syncoptions = $syncfrom;
$oTpl->set('s', 'SYNC_LANG', $syncfrom);
##########################################
# Delete a saved search
##########################################
$bShowArticleSearch = false;
if( isset($_GET['delsavedsearch']) )
{
if( isset($_GET['itemtype']) && sizeof($_GET['itemtype'])>0 && isset($_GET['itemid']) && sizeof($_GET['itemid'])>0 )
{
if (isset($_GET['delsavedsearch'])) {
if (isset($_GET['itemtype']) && sizeof($_GET['itemtype']) > 0 && isset($_GET['itemid']) && sizeof($_GET['itemid']) > 0) {
$propertyCollection = new PropertyCollection;
$propertyCollection->deleteProperties($_GET['itemtype'], $_GET['itemid']);
$bShowArticleSearch = true;
}
}
if( isset($_GET['save_search']) && $_GET['save_search'] == 'true') {
if (isset($_GET['save_search']) && $_GET['save_search'] == 'true') {
$bShowArticleSearch = true;
}
@ -91,7 +86,7 @@ if( isset($_GET['save_search']) && $_GET['save_search'] == 'true') {
# modified 20/04/2007 by H. Librenz for backend search
$arrDays = array();
for ($i = 0; $i < 32; $i ++) {
for ($i = 0; $i < 32; $i++) {
if ($i == 0) {
$arrDays[$i] = '--';
} else {
@ -114,13 +109,13 @@ $arrYears = array();
$arrYears[0] = '-----';
$sActualYear = (int) date("Y");
for ($i = $sActualYear-10; $i < $sActualYear+30; $i++) {
for ($i = $sActualYear - 10; $i < $sActualYear + 30; $i++) {
$arrYears[$i] = $i;
}
$arrUsers = array();
$query = "SELECT * FROM ".$cfg['tab']['phplib_auth_user_md5']." ORDER BY realname";
$query = "SELECT * FROM " . $cfg['tab']['phplib_auth_user_md5'] . " ORDER BY realname";
$arrUsers['n/a'] = '-';
@ -137,16 +132,16 @@ $arrDateTypes['created'] = i18n('Date created');
$arrDateTypes['lastmodified'] = i18n('Date modified');
$arrDateTypes['published'] = i18n('Date published');
$articleLink="editarticle";
$articleLink = "editarticle";
$oListOptionRow = new cFoldingRow("3498dbba-ed4a-4618-8e49-3a3635396e22", i18n("Article Search"), $articleLink, $bShowArticleSearch);
$oTpl->set('s', 'ARTICLELINK', $articleLink);
#Textfeld
$oTextboxArtTitle = new cHTMLTextbox("bs_search_text", (isset($_REQUEST["bs_search_text"])?$_REQUEST["bs_search_text"]:''), 10);
$oTextboxArtTitle = new cHTMLTextbox("bs_search_text", (isset($_REQUEST["bs_search_text"]) ? $_REQUEST["bs_search_text"] : ''), 10);
$oTextboxArtTitle->setStyle('width:135px;');
#Artikel_ID-Feld
$oTextboxArtID = new cHTMLTextbox("bs_search_id", (isset($_REQUEST["bs_search_id"])?$_REQUEST["bs_search_id"]:''), 10);
$oTextboxArtID = new cHTMLTextbox("bs_search_id", (isset($_REQUEST["bs_search_id"]) ? $_REQUEST["bs_search_id"] : ''), 10);
$oTextboxArtID->setStyle('width:135px;');
#Date type
@ -155,7 +150,7 @@ $oSelectArtDateType->autoFill($arrDateTypes);
$oSelectArtDateType->setStyle('width:135px;');
$oSelectArtDateType->setEvent("Change", "toggle_tr_visibility('tr_date_from');toggle_tr_visibility('tr_date_to');");
if (isset($_REQUEST["bs_search_date_type"]) && $_REQUEST["bs_search_date_type"] !='') {
if (isset($_REQUEST["bs_search_date_type"]) && $_REQUEST["bs_search_date_type"] != '') {
$oSelectArtDateType->setDefault($_REQUEST["bs_search_date_type"]);
} else {
$oSelectArtDateType->setDefault('n/a');
@ -228,7 +223,7 @@ $oSelectArtAuthor = new cHTMLSelectElement("bs_search_author");
$oSelectArtAuthor->setStyle('width:135px;');
$oSelectArtAuthor->autoFill($arrUsers);
if (isset($_REQUEST["bs_search_author"]) && $_REQUEST["bs_search_author"] !='') {
if (isset($_REQUEST["bs_search_author"]) && $_REQUEST["bs_search_author"] != '') {
$oSelectArtAuthor->setDefault($_REQUEST["bs_search_author"]);
} else {
$oSelectArtAuthor->setDefault('n/a');
@ -236,49 +231,48 @@ if (isset($_REQUEST["bs_search_author"]) && $_REQUEST["bs_search_author"] !='')
$oSubmit = new cHTMLButton("submit", i18n("Search"));
$content = '<div id="artsearch" style="border: 1px solid #B3B3B3; border-top: none; margin:0;padding:0; padding-bottom: 10px;background: '.$cfg['color']['table_dark'].';">';
$content = '<div id="artsearch" style="border: 1px solid #B3B3B3; border-top: none; margin:0;padding:0; padding-bottom: 10px;background: ' . $cfg['color']['table_dark'] . ';">';
$content .= '<form action="backend_search.php" method="post" name="backend_search" target="right_bottom" id="backend_search">';
$content .= '<table dir="'.langGetTextDirection($lang).'">';
$content .= '<input type="hidden" name="area" value="'.$area.'">';
$content .= '<input type="hidden" name="frame" value="'.$frame.'">';
$content .= '<input type="hidden" name="contenido" value="'.$sess->id.'">';
$content .= '<input type="hidden" name="speach" value="'.$lang.'">';
$content .= '<table dir="' . langGetTextDirection($lang) . '">';
$content .= '<input type="hidden" name="area" value="' . $area . '">';
$content .= '<input type="hidden" name="frame" value="' . $frame . '">';
$content .= '<input type="hidden" name="contenido" value="' . $sess->id . '">';
$content .= '<input type="hidden" name="speach" value="' . $lang . '">';
$content .= '<tr>';
$content .= '<td style="padding-left: 15px;">'. i18n("Title/Content").'</td>';
$content .= '<td>'.$oTextboxArtTitle->render().'</td>';
$content .= '<td style="padding-left: 15px;">' . i18n("Title/Content") . '</td>';
$content .= '<td>' . $oTextboxArtTitle->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td style="padding-left: 15px;">'. i18n("Article ID").'</td>';
$content .= '<td>'.$oTextboxArtID->render().'</td>';
$content .= '<td style="padding-left: 15px;">' . i18n("Article ID") . '</td>';
$content .= '<td>' . $oTextboxArtID->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td style="padding-left: 15px;">'. i18n("Datum").'</td>';
$content .= '<td><nobr>'.$oSelectArtDateType->render().'</nobr></td>';
$content .= '<td style="padding-left: 15px;">' . i18n("Datum") . '</td>';
$content .= '<td><nobr>' . $oSelectArtDateType->render() . '</nobr></td>';
$content .= '</tr>';
$content .= '<tr id="tr_date_from" style="display:none;">';
$content .= '<td>'. i18n("Date from").'</td>';
$content .= '<td><nobr>'.$oSelectArtDateFromDay->render().$oSelectArtDateFromMonth->render().$oSelectArtDateFromYear->render().'</nobr></td>';
$content .= '<td>' . i18n("Date from") . '</td>';
$content .= '<td><nobr>' . $oSelectArtDateFromDay->render() . $oSelectArtDateFromMonth->render() . $oSelectArtDateFromYear->render() . '</nobr></td>';
$content .= '</tr>';
$content .= '<tr id="tr_date_to" style="display:none;">';
$content .= '<td>'. i18n("Date to").'</td>';
$content .= '<td><nobr>'.$oSelectArtDateToDay->render().$oSelectArtDateToMonth->render().$oSelectArtDateToYear->render().'</nobr></td>';
$content .= '<td>' . i18n("Date to") . '</td>';
$content .= '<td><nobr>' . $oSelectArtDateToDay->render() . $oSelectArtDateToMonth->render() . $oSelectArtDateToYear->render() . '</nobr></td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td style="padding-left: 15px;">'. i18n("Author").'</td>';
$content .= '<td><nobr>'.$oSelectArtAuthor->render().'</nobr></td>';
$content .= '<td style="padding-left: 15px;">' . i18n("Author") . '</td>';
$content .= '<td><nobr>' . $oSelectArtAuthor->render() . '</nobr></td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>&nbsp;</td>';
$content .= '<td>'.$oSubmit->render().'</td>';
$content .= '<td>' . $oSubmit->render() . '</td>';
$content .= '</tr>';
$content .= '</table>';
$content .= '</form>';
@ -288,7 +282,7 @@ $content .= '</form>';
*/
$content .= '<div class="artikel_search">';
$content .= '<div style="font-weight:bold; margin-bottom: 10px;">'.i18n("Saved Searches").':</div>';
$content .= '<div style="font-weight:bold; margin-bottom: 10px;">' . i18n("Saved Searches") . ':</div>';
$proppy = new PropertyCollection();
$savedSearchList = $proppy->getAllValues('type', 'savedsearch', $auth);
@ -298,37 +292,34 @@ $init_itemtype = '';
$content .= '<ul class="artikel_search">';
// Recently edited articles search - predefined, not deleteable
$searchRecentlyEdited = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=".$area."&frame=4&contenido=".$sess->id."&recentedit=true'); resetSearchForm();";
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle; padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="'.$searchRecentlyEdited.'">'.i18n("Recently edited articles").'</a></li>';
$searchRecentlyEdited = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=" . $area . "&frame=4&contenido=" . $sess->id . "&recentedit=true'); resetSearchForm();";
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle; padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="' . $searchRecentlyEdited . '">' . i18n("Recently edited articles") . '</a></li>';
// My articles search - predefined, not deleteable
$searchMyArticles = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=".$area."&frame=4&contenido=".$sess->id."&myarticles=true'); resetSearchForm();";
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="'.$searchMyArticles.'">'.i18n("My articles").'</a></li>';
$searchMyArticles = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=" . $area . "&frame=4&contenido=" . $sess->id . "&myarticles=true'); resetSearchForm();";
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="' . $searchMyArticles . '">' . i18n("My articles") . '</a></li>';
// Workflow
$link = $sess->url("main.php?area=con_workflow&frame=4");
$sWorflowLink = 'conMultiLink(\'right_bottom\', \''.$link.'\'); resetSearchForm();';
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="javascript:'.$sWorflowLink.'">'.i18n("Workflow").'</a></li>';
$sWorflowLink = 'conMultiLink(\'right_bottom\', \'' . $link . '\'); resetSearchForm();';
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="javascript:' . $sWorflowLink . '">' . i18n("Workflow") . '</a></li>';
foreach ($savedSearchList as $value)
{
if( ($init_itemid != $value['itemid']) && ($init_itemtype != $value['itemtype']) )
{
foreach ($savedSearchList as $value) {
if (($init_itemid != $value['itemid']) && ($init_itemtype != $value['itemtype'])) {
$init_itemid = $value['itemid'];
$init_itemtype = $value['itemtype'];
// Create delete icon
$deleteSearch = "javascript:conMultiLink('left_top', 'main.php?area=".$area."&frame=1&delsavedsearch=true&contenido=".$sess->id."&itemid=".$value['itemid']."&itemtype=".$value['itemtype']."')";
$deleteSearch = "javascript:conMultiLink('left_top', 'main.php?area=" . $area . "&frame=1&delsavedsearch=true&contenido=" . $sess->id . "&itemid=" . $value['itemid'] . "&itemtype=" . $value['itemtype'] . "')";
$content .= '<li style="margin-bottom: 3px;">';
$content .= '<a href="'.$deleteSearch.'"><img style="padding-left: 3px; vertical-align:middle;" src="images/delete.gif" /></a>';
$content .= '<a href="' . $deleteSearch . '"><img style="padding-left: 3px; vertical-align:middle;" src="images/delete.gif" /></a>';
// create new link
$savedSearchLink = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=".$area."&frame=4&contenido=".$sess->id."&itemid=".$value['itemid']."&itemtype=".$value['itemtype']."')";
$content .= '<a style="padding-left: 3px;" href="'.$savedSearchLink.'">';
$savedSearchLink = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=" . $area . "&frame=4&contenido=" . $sess->id . "&itemid=" . $value['itemid'] . "&itemtype=" . $value['itemtype'] . "')";
$content .= '<a style="padding-left: 3px;" href="' . $savedSearchLink . '">';
}
// Name the link
if($value['name'] == 'save_name')
{
if ($value['name'] == 'save_name') {
$content .= $value['value'] . '</a>';
$content .= '</li>';
}
@ -351,9 +342,9 @@ $sql = "SELECT
idtpl,
name
FROM
".$cfg['tab']['tpl']."
" . $cfg['tab']['tpl'] . "
WHERE
idclient = '".Contenido_Security::toInteger($client)."'
idclient = '" . Contenido_Security::toInteger($client) . "'
ORDER BY
name";
@ -371,18 +362,17 @@ $oTpl->set('d', 'SELECTED', '');
$oTpl->next();
$oTpl->set('d', 'VALUE', '0');
$oTpl->set('d', 'CAPTION', '--- '. i18n("none"). ' ---');
$oTpl->set('d', 'CAPTION', '--- ' . i18n("none") . ' ---');
$oTpl->set('d', 'SELECTED', '');
$oTpl->next();
$categoryLink="editcat";
$categoryLink = "editcat";
$editCategory = new cFoldingRow("3498dbbb-ed4a-4618-8e49-3a3635396e22", i18n("Edit Category"), $categoryLink);
while ($db->next_record()) {
$oTplname = $db->f('name');
if (strlen($oTplname) > 18)
{
if (strlen($oTplname) > 18) {
$oTplname = substr($oTplname, 0, 15) . "...";
}
$oTpl->set('d', 'VALUE', $db->f('idtpl'));
@ -395,20 +385,20 @@ $editCat = '<div style="height:110px;padding-top:5px; padding-left: 17px; margi
$editCat .= i18n("Template:") . "<br />";
$editCat .= '<div style="">';
$editCat .= $oTpl->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true);
$editCat .='<a id="changetpl" href="#"><img style="vertical-align: middle;" src="images/submit.gif" border="0"></a><br />';
$editCat .= '<a id="changetpl" href="#"><img style="vertical-align: middle;" src="images/submit.gif" border="0"></a><br />';
$editCat .= '</div>';
// Category
$editCat .= '<div style="margin: 5px 0 5px 0;">';
$oTpl->set('s', 'CAT_HREF', $sess->url("main.php?area=con_tplcfg&action=tplcfg_edit&frame=4&mode=art").'&idcat=');
$oTpl->set('s', 'CAT_HREF', $sess->url("main.php?area=con_tplcfg&action=tplcfg_edit&frame=4&mode=art") . '&idcat=');
$oTpl->set('s', 'IDCAT', $idcat);
$editCat .= '<div id="oTemplatecfg_label"><a href="javascript:configureCategory();"><img style="vertical-align: middle;" id="oTemplatecfg" vspace="3" hspace="2" src="'.$cfg["path"]["images"].'but_cat_conf2.gif" border="0" title="'.i18n("Configure Category").'" alt="'.i18n("Configure Category").'"><a>';
$editCat .= '<a href="javascript:configureCategory();">'.i18n("Configure Category").'</a></div>';
$editCat .= '<div id="oTemplatecfg_label"><a href="javascript:configureCategory();"><img style="vertical-align: middle;" id="oTemplatecfg" vspace="3" hspace="2" src="' . $cfg["path"]["images"] . 'but_cat_conf2.gif" border="0" title="' . i18n("Configure Category") . '" alt="' . i18n("Configure Category") . '"><a>';
$editCat .= '<a href="javascript:configureCategory();">' . i18n("Configure Category") . '</a></div>';
// Online / Offline
$editCat .= '<div id="oOnline_label"><a href="#"><img style="vertical-align: middle;" id="oOnline" src="images/offline.gif" vspace="2" hspace="2" border="0" title="'.i18n("Online / Offline").'" alt="'.i18n("Online / Offline").'"></a>';
$editCat .= '<a href="#">'.i18n("Online / Offline").'</a></div>';
$editCat .= '<div id="oOnline_label"><a href="#"><img style="vertical-align: middle;" id="oOnline" src="images/offline.gif" vspace="2" hspace="2" border="0" title="' . i18n("Online / Offline") . '" alt="' . i18n("Online / Offline") . '"></a>';
$editCat .= '<a href="#">' . i18n("Online / Offline") . '</a></div>';
// Lock / Unlock
$editCat .= '<div id="oLock_label"><a href="#"><img style="vertical-align: middle;" id="oLock" src="images/folder_lock.gif" vspace="2" hspace="2" border="0" title="'.i18n("Lock / Unlock").'" alt="'.i18n("Lock / Unlock").'"></a>';
$editCat .= '<a href="#">'.i18n("Lock / Unlock").'</a></div>';
$editCat .= '<div id="oLock_label"><a href="#"><img style="vertical-align: middle;" id="oLock" src="images/folder_lock.gif" vspace="2" hspace="2" border="0" title="' . i18n("Lock / Unlock") . '" alt="' . i18n("Lock / Unlock") . '"></a>';
$editCat .= '<a href="#">' . i18n("Lock / Unlock") . '</a></div>';
$editCat .= '<br />';
$editCat .= '</div>';
$editCat .= '</div>';
@ -418,81 +408,78 @@ $editCategory->setContentData($editCat);
$oTpl->set('s', 'EDIT', $editCategory->render());
$oTpl->set('s', 'CATEGORYLINK', $categoryLink);
#####################################
# Collapse / Expand / Config Category
#####################################
$selflink = "main.php";
$expandlink = $sess->url($selflink . "?area=$area&frame=2&expand=all");
$collapselink = $sess->url($selflink . "?area=$area&frame=2&collapse=all");
$collapseimg = '<a target="left_bottom" class="black" id="collapser" href="'.$collapselink.'" alt="'.i18n("close all").'" title="'.i18n("Close all categories").'"><img src="images/close_all.gif" border="0">&nbsp;'.i18n("close all").'</a>';
$expandimg = '<a target="left_bottom"class="black" id="expander" href="'.$expandlink.'" alt="'.i18n("open all").'" title="'.i18n("Open all categories").'"><img src="images/open_all.gif" border="0">&nbsp;'.i18n("open all").'</a>';
$collapseimg = '<a target="left_bottom" class="black" id="collapser" href="' . $collapselink . '" alt="' . i18n("close all") . '" title="' . i18n("Close all categories") . '"><img src="images/close_all.gif" border="0">&nbsp;' . i18n("close all") . '</a>';
$expandimg = '<a target="left_bottom"class="black" id="expander" href="' . $expandlink . '" alt="' . i18n("open all") . '" title="' . i18n("Open all categories") . '"><img src="images/open_all.gif" border="0">&nbsp;' . i18n("open all") . '</a>';
$oTpl->set('s', 'MINUS', $collapseimg);
$oTpl->set('s', 'PLUS', $expandimg);
/**************/
/* * *********** */
/* SYNCSTUFF */
/**************/
/* * *********** */
$languages = getLanguageNamesByClient($client);
$sListId = '';
if (count($languages) > 1 && $perm->have_perm_area_action($area, "con_synccat")) {
$sListId = 'sync';
$oListOptionRow = new cFoldingRow("4808dbba-ed4a-4618-8e49-3a3635396e22", i18n("Synchronize from"), $sListId);
if (($syncoptions > 0) && ($syncoptions != $lang)) {
$oListOptionRow->setExpanded (true);
$oListOptionRow->setExpanded(true);
}
#'dir="' . langGetTextDirection($lang) . '"');
$selectbox = new cHTMLSelectElement("syncoptions");
$option = new cHTMLOptionElement("--- ".i18n("None")." ---", -1);
$option = new cHTMLOptionElement("--- " . i18n("None") . " ---", -1);
$selectbox->addOptionElement(-1, $option);
foreach ($languages as $languageid => $languagename)
{
if ($lang != $languageid && $perm->have_perm_client_lang($client, $languageid))
{
$option = new cHTMLOptionElement($languagename . " (".$languageid.")",$languageid);
foreach ($languages as $languageid => $languagename) {
if ($lang != $languageid && $perm->have_perm_client_lang($client, $languageid)) {
$option = new cHTMLOptionElement($languagename . " (" . $languageid . ")", $languageid);
$selectbox->addOptionElement($languageid, $option);
}
}
$selectbox->setDefault($syncoptions);
$form = new UI_Form("syncfrom");
$form->setVar("area",$area);
$form->setVar("area", $area);
$form->setVar("frame", $frame);
$form->add("sel", $selectbox->render());
$link = $sess->url("main.php?area=".$area."&frame=2").'&syncoptions=';
$sJsLink = 'conMultiLink(\'left_bottom\', \''.$link.'\'+document.getElementsByName(\'syncoptions\')[0].value+\'&refresh_syncoptions=true\');';
$link = $sess->url("main.php?area=" . $area . "&frame=2") . '&syncoptions=';
$sJsLink = 'conMultiLink(\'left_bottom\', \'' . $link . '\'+document.getElementsByName(\'syncoptions\')[0].value+\'&refresh_syncoptions=true\');';
$oTpl->set('s', 'UPDATE_SYNC_REFRESH_FRAMES', $sJsLink);
$form->add("submit", '<img style="vertical-align:middle; margin-left:5px;" onMouseover="this.style.cursor=\'pointer\'" onclick="updateCurLanguageSync();" src="'.$cfg["path"]["contenido_fullhtml"].$cfg['path']['images'].'submit.gif">');
$form->add("submit", '<img style="vertical-align:middle; margin-left:5px;" onMouseover="this.style.cursor=\'pointer\'" onclick="updateCurLanguageSync();" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'submit.gif">');
$sSyncButton = '<div id="sync_cat_single" style="display:none;"><a href="javascript:generateSyncAction(0);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="'.i18n("Copy to current language").'" alt="'.i18n("Copy to current language").'"></a>';
$sSyncButton .= '<a href="javascript:generateSyncAction(0);">'.i18n("Copy to current language").'</a></div>';
$sSyncButtonMultiple = '<div id="sync_cat_multiple" style="display:none;"><a href="javascript:generateSyncAction(1);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="'.i18n("Also copy subcategories").'" alt="'.i18n("Also copy subcategories").'"></a>';
$sSyncButtonMultiple .= '<a href="javascript:generateSyncAction(1);">'.i18n("Also copy subcategories").'</a></div>';
$sSyncButton = '<div id="sync_cat_single" style="display:none;"><a href="javascript:generateSyncAction(0);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="' . i18n("Copy to current language") . '" alt="' . i18n("Copy to current language") . '"></a>';
$sSyncButton .= '<a href="javascript:generateSyncAction(0);">' . i18n("Copy to current language") . '</a></div>';
$sSyncButtonMultiple = '<div id="sync_cat_multiple" style="display:none;"><a href="javascript:generateSyncAction(1);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="' . i18n("Also copy subcategories") . '" alt="' . i18n("Also copy subcategories") . '"></a>';
$sSyncButtonMultiple .= '<a href="javascript:generateSyncAction(1);">' . i18n("Also copy subcategories") . '</a></div>';
$content = '<table style="padding:3px; margin-left:12px; border-right: 1px solid #B3B3B3;" width="100%" border="0" dir="'.langGetTextDirection($lang).'">
$content = '<table style="padding:3px; margin-left:12px; border-right: 1px solid #B3B3B3;" width="100%" border="0" dir="' . langGetTextDirection($lang) . '">
<tr>
<td>'.$form->render().'</td>
<td>' . $form->render() . '</td>
</tr>
<tr>
<td>'.$sSyncButton.$sSyncButtonMultiple.'</td>
<td>' . $sSyncButton . $sSyncButtonMultiple . '</td>
</tr>
</table>';
$oListOptionRow->setContentData($content);
$oTpl->set('s', 'SYNCRONIZATION',$oListOptionRow->render());
$oTpl->set('s', 'SYNCRONIZATION', $oListOptionRow->render());
$oTpl->set('s', 'SYNCLINK', $sListId);
$sSyncLink = $sess->url($selflink . "?area=$area&frame=2&action=con_synccat");
$oTpl->set('s', 'SYNC_HREF', $sSyncLink);
} else {
$oTpl->set('s', 'SYNCRONIZATION','');
$oTpl->set('s', 'SYNCLINK',$sListId);
$oTpl->set('s', 'SYNCRONIZATION', '');
$oTpl->set('s', 'SYNCLINK', $sListId);
$oTpl->set('s', 'SYNC_HREF', '');
}
@ -501,12 +488,10 @@ if (count($languages) > 1 && $perm->have_perm_area_action($area, "con_synccat"))
*/
$oTpl->set('s', 'AREA', $area);
$oTpl->set('s', 'SESSION', $contenido);
$oTpl->set('s', 'AJAXURL', $cfg['path']['contenido_fullhtml'].'ajaxmain.php');
$oTpl->set('s', 'AJAXURL', $cfg['path']['contenido_fullhtml'] . 'ajaxmain.php');
##########################################
# Help
##########################################
$oTpl->set('s', 'HELPSCRIPT', setHelpContext("con"));
$oTpl->generate($cfg['path']['templates'] . $cfg['templates']['con_left_top']);
?>

Datei anzeigen

@ -158,7 +158,7 @@ if ($fegroup->virgin == false && $fegroup->get("idclient") == $client)
$fegroup->store();
}
if (count($messages) > 0)
if (is_array($messages) && count($messages) > 0)
{
$notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>";
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -29,32 +30,28 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// @TODO: check the code beneath is necessary
if ($_REQUEST['useplugin'] != "category") {
die ('Illegal call!');
die('Illegal call!');
}
$page = new cPage;
if (!in_array($useplugin, $cfg['plugins']['frontendlogic']))
{
if (!in_array($useplugin, $cfg['plugins']['frontendlogic'])) {
$page->setContent(i18n("Invalid plugin"));
} else {
cInclude("plugins", "frontendlogic/$useplugin/".$useplugin.".php");
cInclude("plugins", "frontendlogic/$useplugin/" . $useplugin . ".php");
$className = "frontendlogic_".$useplugin;
$className = "frontendlogic_" . $useplugin;
$class = new $className;
$perms = new FrontendPermissionCollection;
$rights = new UI_Table_Form("rights");
$rights->setVar("area", $area);
$rights->setVar("frame", $frame);
@ -65,65 +62,52 @@ if (!in_array($useplugin, $cfg['plugins']['frontendlogic']))
$actions = $class->listActions();
$items = $class->listItems();
if ($action == "fegroups_save_perm")
{
if ($action == "fegroups_save_perm") {
$myitems = $items;
$myitems["__GLOBAL__"] = "__GLOBAL__";
foreach ($actions as $action => $text)
{
foreach ($myitems as $item => $text)
{
foreach ($actions as $action => $text) {
foreach ($myitems as $item => $text) {
if ($item === "__GLOBAL__")
{
if ($item === "__GLOBAL__") {
$varname = "action_$action";
} else {
$varname = "item_".$item."_$action";
$varname = "item_" . $item . "_$action";
}
if ($_POST[$varname] == 1)
{
if ($_POST[$varname] == 1) {
$perms->setPerm($idfrontendgroup, $useplugin, $action, $item);
} else {
$perms->removePerm($idfrontendgroup, $useplugin, $action, $item);
}
}
}
}
$rights->addHeader(sprintf(i18n("Permissions for plugin '%s'"), $class->getFriendlyName()));
foreach ($actions as $key => $action)
{
foreach ($actions as $key => $action) {
$check[$key] = new cHTMLCheckbox("action_$key", 1);
$check[$key]->setLabelText($action." ".i18n("(All)"));
$check[$key]->setLabelText($action . " " . i18n("(All)"));
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, "__GLOBAL__"))
{
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, "__GLOBAL__")) {
$check[$key]->setChecked(true);
}
}
$rights->add(i18n("Global rights"), $check);
foreach ($actions as $key => $action)
{
foreach ($actions as $key => $action) {
unset($check);
if (count($items) > 0)
{
foreach ($items as $item => $value)
{
$check[$item] = new cHTMLCheckbox("item_".$item."_".$key, 1);
if (is_array($items) && count($items) > 0) {
foreach ($items as $item => $value) {
$check[$item] = new cHTMLCheckbox("item_" . $item . "_" . $key, 1);
$check[$item]->setLabelText($value);
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, $item))
{
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, $item)) {
$check[$item]->setChecked(true);
}
}
$rights->add($action, $check);
@ -136,4 +120,3 @@ if (!in_array($useplugin, $cfg['plugins']['frontendlogic']))
}
$page->render();
?>

Datei anzeigen

@ -162,7 +162,7 @@ if ($oFeUser->virgin == false && $oFeUser->get("idclient") == $client) {
if($bStore) $oFeUser->store();
}
if (count($messages) > 0) {
if (is_array($messages) && count($messages) > 0) {
$notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>";
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,8 +28,7 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -42,7 +42,6 @@ $tpl->set('s', 'SID', $sess->id);
$clients = $classclient->getAccessibleClients();
$tpl2 = new Template;
$tpl2->set('s', 'ID', 'editclient');
$tpl2->set('s', 'NAME', 'editclient');
@ -53,23 +52,20 @@ $iClientcount = count($clients);
foreach ($clients as $key => $value) {
if ($client == $key)
{
if ($client == $key) {
$selected = "selected";
} else {
$selected = "";
}
if (strlen($value['name']) > 15)
{
$value['name'] = substr($value['name'],0,12). "...";
if (strlen($value['name']) > 15) {
$value['name'] = substr($value['name'], 0, 12) . "...";
}
$tpl2->set('d', 'VALUE', $key);
$tpl2->set('d', 'CAPTION', $value['name']);
$tpl2->set('d', 'SELECTED', $selected);
$tpl2->next();
}
$select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true);
@ -77,7 +73,7 @@ $select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic
$tpl->set('s', 'CLIENTSELECT', $select);
if ($perm->have_perm_area_action($area, "lang_newlanguage") && $iClientcount > 0) {
$tpl->set('s', 'NEWLANG', '<a class="addfunction" href="javascript:languageNewConfirm()">'.i18n("Create language").'</a>');
$tpl->set('s', 'NEWLANG', '<a class="addfunction" href="javascript:languageNewConfirm()">' . i18n("Create language") . '</a>');
} else if ($iClientcount == 0) {
$tpl->set('s', 'NEWLANG', i18n('No Client selected'));
} else {
@ -85,5 +81,3 @@ if ($perm->have_perm_area_action($area, "lang_newlanguage") && $iClientcount > 0
}
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['lang_left_top']);
?>

Datei anzeigen

@ -107,7 +107,11 @@ if (!$layout->virgin) {
}
$types = array_unique($types);
if (version_compare(PHP_VERSION, '7.4.0', '>=')) {
$layout->setProperty("layout", "used-types", implode(";", $types));
} else {
$layout->setProperty("layout", "used-types", implode($types, ";"));
}
$msg = "";

Datei anzeigen

@ -49,7 +49,7 @@ while ($layout = $oLayouts->next()) {
}
$name = $layout->get('name');
$descr = $layout->get('description');
$descr = cString::nullToString($layout->get('description'));
$idlay = $layout->get('idlay');
if (strlen($descr) > 64) {
@ -102,7 +102,7 @@ while ($layout = $oLayouts->next()) {
$tpl->set('d', 'TODO', $todo->render());
if (stripslashes($_REQUEST['idlay']) == $idlay) {
if (filter_var($_REQUEST['idlay'], FILTER_SANITIZE_NUMBER_INT) == $idlay) {
$tpl->set('d', 'ID', 'marked');
} else {
$tpl->set('d', 'ID', '');

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,15 +28,17 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// check request
$_REQUEST["sortby"] = (empty($_REQUEST["sortby"]))?'': htmlspecialchars($_REQUEST["sortby"]);
$_REQUEST["sortorder"] = (empty($_REQUEST["sortorder"]))?'': htmlspecialchars($_REQUEST["sortorder"]);
$_REQUEST["filter"] = (empty($_REQUEST["filter"]))?'': htmlspecialchars($_REQUEST["filter"]);
$oUser = new cApiUser($auth->auth["uid"]);
if (!isset($elemperpage) || !is_numeric($elemperpage) || $elemperpage < 0)
{
if (!isset($elemperpage) || !is_numeric($elemperpage) || $elemperpage < 0) {
$elemperpage = $oUser->getProperty("itemsperpage", $area);
$_REQUEST['elemperpage'] = $elemperpage;
if ((int) $elemperpage <= 0) {
@ -66,7 +69,6 @@ $tpl->set('s', 'OPTIONS', '');
$tpl->set('s', 'SID', $sess->id);
$tpl->set('s', 'SESSID', $sess->id);
$tpl2 = new Template;
$tpl2->set('s', 'NAME', 'restrict');
$tpl2->set('s', 'CLASS', 'text_medium');
@ -79,8 +81,7 @@ $limit = array(
foreach ($limit as $key => $value) {
if ($restrict == $key)
{
if (!empty($restrict) && $restrict == $key) {
$selected = "selected";
} else {
$selected = "";
@ -90,7 +91,6 @@ foreach ($limit as $key => $value) {
$tpl2->set('d', 'CAPTION', $value);
$tpl2->set('d', 'SELECTED', $selected);
$tpl2->next();
}
$select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true);
@ -100,7 +100,7 @@ $tpl->set('s', 'ACTION', '');
$tmp_mstr = '<div style="margin: 0pt 0pt 0pt 17px; height: 2em; padding-bottom: 5px;">
<a class="addfunction" href="javascript:conMultiLink(\'%s\', \'%s\')">%s</a></div>';
$area = "user";
$mstr = sprintf($tmp_mstr, 'right_bottom',$sess->url("main.php?area=user_create&frame=4"),i18n("Create user"));
$mstr = sprintf($tmp_mstr, 'right_bottom', $sess->url("main.php?area=user_create&frame=4"), i18n("Create user"));
if ($perm->have_perm_area_action('user_create', "user_createuser")) {
$tpl->set('s', 'NEWUSER', $mstr);
@ -112,15 +112,15 @@ $tpl->set('s', 'CAPTION', '');
#################
# List Options
#################
$aSortByOptions = array( "username" => i18n("User name"),
$aSortByOptions = array("username" => i18n("User name"),
"realname" => i18n("Name"));
$aSortOrderOptions = array( "asc" => i18n("Ascending"),
$aSortOrderOptions = array("asc" => i18n("Ascending"),
"desc" => i18n("Descending"));
$listOptionId="listoption";
$listOptionId = "listoption";
$tpl->set('s', 'LISTOPLINK', $listOptionId);
$oListOptionRow = new cFoldingRow( "5498dbba-ed4a-4618-8e49-3a3635396e22", i18n("List options"), $listOptionId);
$oListOptionRow = new cFoldingRow("5498dbba-ed4a-4618-8e49-3a3635396e22", i18n("List options"), $listOptionId);
$oListOptionRow->setExpanded('true');
$oSelectItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelectItemsPerPage->autoFill(array(25 => 25, 50 => 50, 75 => 75, 100 => 100));
@ -137,31 +137,31 @@ $oSelectSortOrder->setDefault($_REQUEST["sortorder"]);
$oTextboxFilter = new cHTMLTextbox("filter", $_REQUEST["filter"], 20);
$oTextboxFilter->setStyle('width:114px;');
$content = '<div style="border-bottom: 1px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">';
$content .= '<form action="javascript:execFilter(\''.$sess->id.'\');" id="filter" name="filter" method="get">';
$content = '<div style="border-bottom: 1px solid #B3B3B3; padding-left: 17px; background: ' . $cfg['color']['table_dark'] . ';">';
$content .= '<form action="javascript:execFilter(\'' . $sess->id . '\');" id="filter" name="filter" method="get">';
$content .= '<table>';
$content .= '<input type="hidden" name="area" value="'.$area.'">';
$content .= '<input type="hidden" name="area" value="' . $area . '">';
$content .= '<input type="hidden" name="frame" value="1">';
$content .= '<input type="hidden" name="contenido" value="'.$sess->id.'">';
$content .= '<input type="hidden" name="contenido" value="' . $sess->id . '">';
$content .= '<tr>';
$content .= '<td>'. i18n("Items / page").'</td>';
$content .= '<td>'.$oSelectItemsPerPage->render().'</td>';
$content .= '<td>' . i18n("Items / page") . '</td>';
$content .= '<td>' . $oSelectItemsPerPage->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>'. i18n("Sort by").'</td>';
$content .= '<td>'.$oSelectSortBy->render().'</td>';
$content .= '<td>' . i18n("Sort by") . '</td>';
$content .= '<td>' . $oSelectSortBy->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>'. i18n("Sort order").'</td>';
$content .= '<td>'.$oSelectSortOrder->render().'</td>';
$content .= '<td>' . i18n("Sort order") . '</td>';
$content .= '<td>' . $oSelectSortOrder->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>'. i18n("Search for").'</td>';
$content .= '<td>'.$oTextboxFilter->render().'</td>';
$content .= '<td>' . i18n("Search for") . '</td>';
$content .= '<td>' . $oTextboxFilter->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>&nbsp;</td>';
$content .= '<td><input type="submit" value="'.i18n("Apply").'"></td>';
$content .= '<td><input type="submit" value="' . i18n("Apply") . '"></td>';
$content .= '</tr>';
$content .= '</table>';
$content .= '</form>';
@ -188,12 +188,12 @@ $oPagerLink->setCustom("area", $area);
$oPagerLink->enableAutomaticParameterAppend();
$oPagerLink->setCustom("contenido", $sess->id);
$pagerID="pager";
$pagerID = "pager";
$page = (isset($page))?$page:1;
$oPager = new cObjectPager("44b41691-0dd4-443c-a594-66a8164e25fd", $iItemCount, $elemperpage, $page, $oPagerLink, "page", $pagerID);
$oPager->setExpanded('true');
$tpl->set('s', 'PAGINGLINK', $pagerID);
$tpl->set('s', 'PAGING', $oPager->render());
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['rights_left_top']);
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,8 +29,7 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -40,25 +40,27 @@ $cApiUserCollection = new cApiUserCollection;
$cApiUserCollection->query();
$iSumUsers = $cApiUserCollection->count();
if (isset($_REQUEST["sortby"]) && $_REQUEST["sortby"] != "")
{
$cApiUserCollection->setOrder($_REQUEST["sortby"]. " ". $_REQUEST["sortorder"]);
} else {
if (empty($_REQUEST["sortby"])) {
$_REQUEST["sortby"] = 'username';
$_REQUEST["sortorder"] = 'asc';
$cApiUserCollection->setOrder("username asc");
}
if (isset($_REQUEST["filter"]) && $_REQUEST["filter"] != "")
{
$cApiUserCollection->setWhereGroup("default", "username", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "realname", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "email", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "telephone", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_street", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_zip", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_city", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_country", "%".$_REQUEST["filter"]."%", "LIKE");
$cApiUserCollection->setOrder($_REQUEST["sortby"] . " " . $_REQUEST["sortorder"]);
if (!empty($_REQUEST["filter"])) {
$cApiUserCollection->setWhereGroup("default", "username", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "realname", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "email", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "telephone", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_street", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_zip", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_city", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "address_country", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setInnerGroupCondition("default", "OR");
} else {
$_REQUEST["filter"] = '';
}
$cApiUserCollection->query();
@ -67,54 +69,37 @@ $aCurrentUserAccessibleClients = $classclient->getAccessibleClients();
$iMenu = 0;
$iItemCount = 0;
$mPage = $_REQUEST["page"];
$mPage = (isset($_REQUEST["page"])) ? (int) $_REQUEST["page"] : 1;
if ($mPage == 0)
{
$mPage = 1;
}
$elemperpage = $_REQUEST["elemperpage"];
if ($elemperpage == 0)
{
$elemperpage = 25;
}
$elemperpage = (isset($_REQUEST["elemperpage"])) ? (int) $_REQUEST["elemperpage"] : 25;
$mlist = new UI_Menu;
$sToday = date('Y-m-d');
if (($elemperpage*$mPage) >= $iSumUsers+$elemperpage && $mPage != 1) {
if (($elemperpage * $mPage) >= $iSumUsers + $elemperpage && $mPage != 1) {
$_REQUEST["page"]--;
$mPage--;
}
while ($cApiUser = $cApiUserCollection->next())
{
while ($cApiUser = $cApiUserCollection->next()) {
$userid = $cApiUser->get("user_id");
$aUserPermissions = explode(',', $cApiUser->get('perms'));
$bDisplayUser = false;
if (in_array("sysadmin", $aCurrentUserPermissions))
{
if (in_array("sysadmin", $aCurrentUserPermissions)) {
$bDisplayUser = true;
}
foreach ($aCurrentUserAccessibleClients as $key => $value)
{
if (in_array("client[$key]", $aUserPermissions))
{
foreach ($aCurrentUserAccessibleClients as $key => $value) {
if (in_array("client[$key]", $aUserPermissions)) {
$bDisplayUser = true;
}
}
foreach ($aUserPermissions as $sLocalPermission)
{
if (in_array($sLocalPermission, $aCurrentUserPermissions))
{
foreach ($aUserPermissions as $sLocalPermission) {
if (in_array($sLocalPermission, $aCurrentUserPermissions)) {
$bDisplayUser = true;
}
}
@ -123,18 +108,15 @@ while ($cApiUser = $cApiUserCollection->next())
$link->setMultiLink("user", "", "user_overview", "");
$link->setCustom("userid", $cApiUser->get("user_id"));
if ($bDisplayUser == true)
{
if ($bDisplayUser == true) {
$iItemCount++;
if ($iItemCount > ($elemperpage * ($mPage - 1)) && $iItemCount < (($elemperpage * $mPage) + 1))
{
if ($perm->have_perm_area_action('user',"user_delete") ) {
if ($iItemCount > ($elemperpage * ($mPage - 1)) && $iItemCount < (($elemperpage * $mPage) + 1)) {
if ($perm->have_perm_area_action('user', "user_delete")) {
$message = sprintf(i18n("Do you really want to delete the user %s?"), $cApiUser->get("username"));
$delTitle = i18n("Delete user");
$deletebutton = '<a title="'.$delTitle.'" href="javascript://" onclick="box.confirm(\''.$delTitle.'\', \''.$message.'\', \'deleteBackenduser(\\\''.$userid.'\\\')\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$delTitle.'" alt="'.$delTitle.'"></a>';
$deletebutton = '<a title="' . $delTitle . '" href="javascript://" onclick="box.confirm(\'' . $delTitle . '\', \'' . $message . '\', \'deleteBackenduser(\\\'' . $userid . '\\\')\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $delTitle . '" alt="' . $delTitle . '"></a>';
} else {
$deletebutton = "";
}
@ -149,26 +131,25 @@ while ($cApiUser = $cApiUserCollection->next())
&& $cApiUser->get("valid_to") != '0000-00-00'
&& $cApiUser->get("valid_to") != '1000-01-01'
&& $cApiUser->get("valid_from") != '')) {
$mlist->setTitle($iMenu, '<span style="color:#b3b3b8">'.$cApiUser->get("username")."<br>".$cApiUser->get("realname").'</span>');
$mlist->setTitle($iMenu, '<span style="color:#b3b3b8">' . $cApiUser->get("username") . "<br>" . $cApiUser->get("realname") . '</span>');
} else {
$mlist->setTitle($iMenu, $cApiUser->get("username")."<br>".$cApiUser->get("realname"));
$mlist->setTitle($iMenu, $cApiUser->get("username") . "<br>" . $cApiUser->get("realname"));
}
$mlist->setLink($iMenu, $link);
$mlist->setActions($iMenu, "delete", $deletebutton);
if ($_GET['userid'] == $cApiUser->get("user_id")) {
if (!empty($_GET['userid']) && $_GET['userid'] == $cApiUser->get("user_id")) {
$mlist->setExtra($iMenu, 'id="marked" ');
}
}
}
}
$deleteScript = '<script type="text/javascript">
/* Session-ID */
var sid = "'.$sess->id.'";
var sid = "' . $sess->id . '";
/* Create messageBox
instance */
@ -191,7 +172,7 @@ $deleteScript = '<script type="text/javascript">
url += \'&sortorder=\' +form.sortorder.value;
url += \'&filter=\' +form.filter.value;
url += \'&elemperpage=\' +form.elemperpage.value;
url += \'&page=\' +\''.$mPage.'\';
url += \'&page=\' +\'' . $mPage . '\';
parent.parent.right.right_bottom.location.href = url;
parent.parent.right.right_top.location.href = \'main.php?area=user&frame=3&contenido=\'+sid;
@ -204,13 +185,13 @@ $markActiveScript = '<script type="text/javascript">
row.markedRow = document.getElementById(\'marked\');
}
</script>';
//<script type="text/javascript" src="scripts/rowMark.js"></script>
//<script type="text/javascript" src="scripts/rowMark.js"></script>
$oPage->setMargin(0);
$oPage->addScript('rowMark.js', '<script language="JavaScript" src="scripts/rowMark.js"></script>');
$oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>');
$oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido='.$sess->id.'"></script>');
$oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido=' . $sess->id . '"></script>');
$oPage->addScript('delete', $deleteScript);
$oPage->setContent($mlist->render(false).$markActiveScript);
$oPage->setContent($mlist->render(false) . $markActiveScript);
//generate current content for Object Pager
$oPagerLink = new cHTMLLink;
@ -225,10 +206,10 @@ $oPagerLink->setCustom("area", $area);
$oPagerLink->enableAutomaticParameterAppend();
$oPagerLink->setCustom("contenido", $sess->id);
$pagerID="pager";
$pagerID = "pager";
$page = (empty($page))?1:(int)$page;
$oPager = new cObjectPager("44b41691-0dd4-443c-a594-66a8164e25fd", $iItemCount, $elemperpage, $page, $oPagerLink, "page", $pagerID);
//add slashes, to insert in javascript
$sPagerContent = $oPager->render(1);
$sPagerContent = str_replace('\\', '\\\\', $sPagerContent);
@ -237,7 +218,7 @@ $sPagerContent = str_replace('\'', '\\\'', $sPagerContent);
//send new object pager to left_top
$sRefreshPager = '
<script type="text/javascript">
var sNavigation = \''.$sPagerContent.'\';
var sNavigation = \'' . $sPagerContent . '\';
var left_top = parent.left_top;
if (left_top.document) {
var oPager = left_top.document.getElementById(\'44b41691-0dd4-443c-a594-66a8164e25fd\');
@ -252,5 +233,3 @@ $sRefreshPager = '
$oPage->addScript('refreshpager', $sRefreshPager);
$oPage->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -35,15 +36,13 @@
* TODO error handling!!!
* TODO export functions to new ConUser object!
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
cInclude('includes', 'functions.rights.php');
if (!($perm->have_perm_area_action($area, $action) || $perm->have_perm_area_action('user', $action))) {
// access denied
$notification->displayNotification("error", i18n("Permission denied"));
@ -69,7 +68,7 @@ if ($action == 'user_delete') {
$db->query($sql);
$sql = "DELETE FROM " . $cfg["tab"]["rights"]
." WHERE user_id = '" . Contenido_Security::escapeDB($userid, $db) . "'";
. " WHERE user_id = '" . Contenido_Security::escapeDB($userid, $db) . "'";
$db->query($sql);
$sNotification = $notification->displayNotification("info", i18n("User deleted"));
@ -158,13 +157,19 @@ $oUser = new User();
$oUser->loadUserByUserID(Contenido_Security::escapeDB($userid, $db));
// delete user property
if (is_string($del_userprop_type) && is_string($del_userprop_name)) {
if (!empty($del_userprop_type)
&& !empty($del_userprop_name)
&& is_string($del_userprop_type)
&& is_string($del_userprop_name)) {
$oUser->deleteUserProperty($del_userprop_type, $del_userprop_name);
}
// edit user property
if (is_string($userprop_type) && is_string($userprop_name) && is_string($userprop_value)
&& !empty($userprop_type) && !empty($userprop_name)) {
if (!empty($userprop_type)
&& !empty($userprop_name)
&& is_string($userprop_type)
&& is_string($userprop_name)
&& is_string($userprop_value)) {
$oUser->setUserProperty($userprop_type, $userprop_name, $userprop_value);
}
@ -174,16 +179,16 @@ if (count($aPerms) == 0 || $action == '' || !isset($action)) {
$tpl->reset();
$tpl->set('s','SID', $sess->id);
$tpl->set('s','NOTIFICATION', $sNotification);
$tpl->set('s', 'SID', $sess->id);
$tpl->set('s', 'NOTIFICATION', $sNotification);
$form = '<form name="user_properties" method="post" action="'.$sess->url("main.php?").'">
'.$sess->hidden_session(true).'
<input type="hidden" name="area" value="'.$area.'">
$form = '<form name="user_properties" method="post" action="' . $sess->url("main.php?") . '">
' . $sess->hidden_session(true) . '
<input type="hidden" name="area" value="' . $area . '">
<input type="hidden" name="action" value="user_edit">
<input type="hidden" name="frame" value="'.$frame.'">
<input type="hidden" name="userid" value="'.$userid.'">
<input type="hidden" name="idlang" value="'.$lang.'">';
<input type="hidden" name="frame" value="' . $frame . '">
<input type="hidden" name="userid" value="' . $userid . '">
<input type="hidden" name="idlang" value="' . $lang . '">';
$tpl->set('s', 'FORM', $form);
$tpl->set('s', 'GET_USERID', $userid);
@ -193,7 +198,6 @@ $tpl->set('s', 'SUBMITTEXT', i18n("Save changes"));
$tpl->set('s', 'CANCELTEXT', i18n("Discard changes"));
$tpl->set('s', 'CANCELLINK', $sess->url("main.php?area=$area&frame=4&userid=$userid"));
$tpl->set('d', 'CATNAME', i18n("Property"));
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_header"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
@ -203,7 +207,7 @@ $tpl->next();
$tpl->set('d', 'CATNAME', i18n("Username"));
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_light"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'CATFIELD', $oUser->getField('username').'<img align="top" src="images/spacer.gif" height="20">');
$tpl->set('d', 'CATFIELD', $oUser->getField('username') . '<img align="top" src="images/spacer.gif" height="20">');
$tpl->next();
$tpl->set('d', 'CATNAME', i18n("Name"));
@ -213,7 +217,7 @@ $tpl->set('d', 'CATFIELD', formGenerateField("text", "realname", $oUser->getFiel
$tpl->next();
// @since 2006-07-04 Display password fields only if not authenticated via LDAP/AD
if ($msysadmin || $oUser->getField('password') != 'active_directory_auth') {
if ((isset($msysadmin) && $msysadmin) || $oUser->getField('password') != 'active_directory_auth') {
$tpl->set('d', 'CATNAME', i18n("New password"));
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_light"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
@ -280,8 +284,8 @@ $oClientsCollection = new cApiClientCollection();
$aClients = $oClientsCollection->getAvailableClients();
$sClientCheckboxes = '';
foreach ($aClients as $idclient => $item) {
if (in_array("admin[".$idclient."]", $aAuthPerms) || in_array('sysadmin', $aAuthPerms)){
$sClientCheckboxes .= formGenerateCheckbox("madmin[".$idclient."]", $idclient, in_array("admin[".$idclient."]", $aPerms), $item['name']." (".$idclient.")")."<br>";
if (in_array("admin[" . $idclient . "]", $aAuthPerms) || in_array('sysadmin', $aAuthPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("madmin[" . $idclient . "]", $idclient, in_array("admin[" . $idclient . "]", $aPerms), $item['name'] . " (" . $idclient . ")") . "<br>";
}
}
@ -296,8 +300,8 @@ if ($sClientCheckboxes !== '' && !in_array('sysadmin', $aPerms)) {
// clients perms
$sClientCheckboxes = '';
foreach ($aClients as $idclient => $item) {
if ((in_array("client[".$idclient."]", $aAuthPerms) || in_array('sysadmin', $aAuthPerms) || in_array("admin[".$idclient."]", $aAuthPerms)) && !in_array("admin[".$idclient."]", $aPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("mclient[".$idclient."]", $idclient, in_array("client[".$idclient."]", $aPerms), $item['name']." (". $idclient . ")")."<br>";
if ((in_array("client[" . $idclient . "]", $aAuthPerms) || in_array('sysadmin', $aAuthPerms) || in_array("admin[" . $idclient . "]", $aAuthPerms)) && !in_array("admin[" . $idclient . "]", $aPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("mclient[" . $idclient . "]", $idclient, in_array("client[" . $idclient . "]", $aPerms), $item['name'] . " (" . $idclient . ")") . "<br>";
}
}
@ -313,8 +317,8 @@ if ($sClientCheckboxes !== '' && !in_array('sysadmin', $aPerms)) {
$aClientsLanguages = getAllClientsAndLanguages();
$sClientCheckboxes = '';
foreach ($aClientsLanguages as $item) {
if (($perm->have_perm_client("lang[".$item['idlang']."]") || $perm->have_perm_client("admin[".$item['idclient']."]")) && !in_array("admin[".$item['idclient']."]", $aPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("mlang[".$item['idlang']."]", $item['idlang'], in_array("lang[".$item['idlang']."]", $aPerms), $item['langname']." (". $item['clientname'] .")") ."<br>";
if (($perm->have_perm_client("lang[" . $item['idlang'] . "]") || $perm->have_perm_client("admin[" . $item['idclient'] . "]")) && !in_array("admin[" . $item['idclient'] . "]", $aPerms)) {
$sClientCheckboxes .= formGenerateCheckbox("mlang[" . $item['idlang'] . "]", $item['idlang'], in_array("lang[" . $item['idlang'] . "]", $aPerms), $item['langname'] . " (" . $item['clientname'] . ")") . "<br>";
}
}
@ -347,11 +351,11 @@ foreach ($aProperties as $entry) {
}
}
$table = '
<table width="100%" cellspacing="0" cellpadding="2" style="border:1px solid '.$cfg["color"]["table_border"].';">
<tr style="background-color:'.$cfg["color"]["table_header"].'" class="text_medium">
<td>'.i18n("Area/Type").'</td>
<td>'.i18n("Property").'</td>
<td>'.i18n("Value").'</td>
<table width="100%" cellspacing="0" cellpadding="2" style="border:1px solid ' . $cfg["color"]["table_border"] . ';">
<tr style="background-color:' . $cfg["color"]["table_header"] . '" class="text_medium">
<td>' . i18n("Area/Type") . '</td>
<td>' . i18n("Property") . '</td>
<td>' . i18n("Value") . '</td>
<td>&nbsp;</td>
</tr>
' . $sPropRows . '
@ -383,9 +387,9 @@ $sCurrentValueFrom = trim(str_replace('1000-01-01', '', $sCurrentValueFrom));
$sInputValidFrom = '<style type="text/css">@import url(./scripts/jscalendar/calendar-contenido.css);</style>
<script type="text/javascript" src="./scripts/jscalendar/calendar.js"></script>
<script type="text/javascript" src="./scripts/jscalendar/lang/calendar-'.substr(strtolower($belang),0,2).'.js"></script>
<script type="text/javascript" src="./scripts/jscalendar/lang/calendar-' . substr(strtolower($belang), 0, 2) . '.js"></script>
<script type="text/javascript" src="./scripts/jscalendar/calendar-setup.js"></script>';
$sInputValidFrom .= '<input type="text" id="valid_from" name="valid_from" value="'.$sCurrentValueFrom.'" />&nbsp;<img src="images/calendar.gif" id="trigger" /">';
$sInputValidFrom .= '<input type="text" id="valid_from" name="valid_from" value="' . $sCurrentValueFrom . '" />&nbsp;<img src="images/calendar.gif" id="trigger" /">';
$sInputValidFrom .= '<script type="text/javascript">
Calendar.setup({
inputField: "valid_from",
@ -406,7 +410,7 @@ $sCurrentValueTo = str_replace('00:00:00', '', $oUser->getField('valid_to'));
$sCurrentValueTo = trim(str_replace('0000-00-00', '', $sCurrentValueTo));
$sCurrentValueTo = trim(str_replace('1000-01-01', '', $sCurrentValueTo));
$sInputValidTo = '<input type="text" id="valid_to" name="valid_to" value="'.$sCurrentValueTo.'" />&nbsp;<img src="images/calendar.gif" id="trigger_to" /">';
$sInputValidTo = '<input type="text" id="valid_to" name="valid_to" value="' . $sCurrentValueTo . '" />&nbsp;<img src="images/calendar.gif" id="trigger_to" /">';
$sInputValidTo .= '<script type="text/javascript">
Calendar.setup({
inputField: "valid_to",
@ -445,7 +449,7 @@ if (($sCurrentValueFrom > $sCurrentDate) || ($sCurrentValueTo < $sCurrentDate))
$tpl->set('d', 'CATNAME', '&nbsp;');
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_dark"]);
$tpl->set('d', 'CATFIELD', '<span style="color:'.$sAccountColor.';">'.$sAccountState.'</span>');
$tpl->set('d', 'CATFIELD', '<span style="color:' . $sAccountColor . ';">' . $sAccountState . '</span>');
$tpl->next();
// Show backend user's group memberships
@ -465,5 +469,4 @@ $tpl->next();
// Generate template
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['rights_overview']);
?>

Datei anzeigen

@ -111,6 +111,7 @@ $aManagedProperties = array(
);
$aSettings = getSystemProperties(1);
$sNotification = '';
if (isset($_POST['action']) && $_POST['action'] == 'edit_sysconf' && $perm->have_perm_area_action($area, 'edit_sysconf')) {
$bStored = false;
@ -193,4 +194,3 @@ if ($perm->have_perm_area_action($area, 'edit_sysconf')) {
}
$oPage->addScript('setMenu', $sJs);
$oPage->render();
?>

Datei anzeigen

@ -38,6 +38,7 @@ $aManagedValues = array('versioning_prune_limit', 'update_check', 'update_news_f
'system_mail_sender_name', 'pw_request_enable', 'maintenance_mode', 'edit_area_activated',
'backend_preferred_idclient', 'generator_basehref', 'generator_xhtml', 'imagemagick_available',
'system_insight_editing_activated');
$sWarning = '';
if ($action == "systemsettings_save_item") {
if (!in_array($systype . '_' . $sysname, $aManagedValues)) {

Datei anzeigen

@ -153,7 +153,6 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$descr = new cHTMLTextarea("description", $description);
$form->add(i18n("Description"), $descr->render());
$standardcb = new cHTMLCheckbox("vdefault", 1, "", $vdefault);
$form->add(i18n("Default"), $standardcb->toHTML(false));
@ -165,7 +164,13 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$raw_code = ($oLayout->virgin) ? "" : $oLayout->getLayout();
tplPreparseLayout($idlay, $raw_code);
$tmp_returnstring = tplBrowseLayoutForContainers($idlay, $raw_code);
var_dump($tmp_returnstring);
if(empty($tmp_returnstring)) {
$a_container = [];
} else {
$a_container = explode("&", $tmp_returnstring);
}
foreach ($a_container as $key => $value) {
if ($value != 0) {
// Loop through containers ****************
@ -251,4 +256,3 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$page->render();
}
?>

Datei anzeigen

@ -278,7 +278,7 @@ $tpl->set('s', 'TEMPLATECAPTION', i18n("Template"));
$tpl2 = new Template;
$tpl2->set('s', 'NAME', 'idtpl');
$tpl2->set('s', 'CLASS', 'text_medium');
$disabled2 = '';
if (!$perm->have_perm_area_action_item("con", "con_changetemplate", $idcat)) {
$disabled2 = 'disabled="disabled"';
}

Datei anzeigen

@ -73,6 +73,10 @@ if (!isset($path) && $sess->is_registered("upl_last_path")) {
$path = $upl_last_path;
}
if(is_null($path)) {
$path = '';
}
$appendparameters = $_REQUEST["appendparameters"];
if (!isset($action))

Datei anzeigen

@ -347,7 +347,7 @@ class UploadList extends FrontendList {
case "xbm":
case "wbmp":
$sCacheThumbnail = uplGetThumbnail($data, 150);
$sCacheName = substr($sCacheThumbnail, strrpos($sCacheThumbnail, "/") + 1, strlen($sCacheThumbnail) - (strrchr($sCacheThumbnail, '/') + 1));
$sCacheName = substr($sCacheThumbnail, strrpos($sCacheThumbnail, "/") + 1, strlen($sCacheThumbnail) - (strlen(strrchr($sCacheThumbnail, '/')) + 1));
$sFullPath = $cfgClient[$client]['path']['frontend'] . 'cache/' . $sCacheName;
if (file_exists($sFullPath)) {
$aDimensions = getimagesize($sFullPath);
@ -430,18 +430,22 @@ class UploadList extends FrontendList {
* @param type $sErrorMessage
* @return type
*/
function uplRender($path, $sortby, $sortmode, $startpage = 1, $thumbnailmode, $sErrorMessage) {
function uplRender($path, $sortby, $sortmode, $startpage, $thumbnailmode, $sErrorMessage) {
global $cfg, $client, $cfgClient, $area, $frame, $sess, $browserparameters, $appendparameters, $perm, $auth, $sReloadScript, $notification, $bDirectoryIsWritable;
if ($sortby == "") {
if(empty($sortby)) {
$sortby = 3;
$sortmode = "ASC";
}
if ($startpage == "") {
if(empty($startpage)) {
$startpage = 1;
}
if(is_null($path)) {
$path = '';
}
$thisfile = $sess->url("main.php?idarea=$area&frame=$frame&path=$path&thumbnailmode=$thumbnailmode&appendparameters=$appendparameters");
$scrollthisfile = $thisfile . "&sortmode=$sortmode&sortby=$sortby&appendparameters=$appendparameters";

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -31,63 +32,61 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
cInclude('pear', 'XML/Parser.php');
cInclude('pear', 'XML/RSS.php');
if(!isset($oTpl) || !is_object($oTpl)) {
if (!isset($oTpl) || !is_object($oTpl)) {
$oTpl = new Template();
}
$oTpl->reset();
if ($saveLoginTime == true) {
$sess->register("saveLoginTime");
$saveLoginTime= 0;
$saveLoginTime = 0;
$vuser= new User();
$vuser = new User();
$vuser->loadUserByUserID($auth->auth["uid"]);
$lastTime= $vuser->getUserProperty("system", "currentlogintime");
$timestamp= date("Y-m-d H:i:s");
$lastTime = $vuser->getUserProperty("system", "currentlogintime");
$timestamp = date("Y-m-d H:i:s");
$vuser->setUserProperty("system", "currentlogintime", $timestamp);
$vuser->setUserProperty("system", "lastlogintime", $lastTime);
}
$vuser= new User();
$vuser = new User();
$vuser->loadUserByUserID($auth->auth["uid"]);
$lastlogin= $vuser->getUserProperty("system", "lastlogintime");
$lastlogin = $vuser->getUserProperty("system", "lastlogintime");
if ($lastlogin == "") {
$lastlogin= i18n("No Login Information available.");
$lastlogin = i18n("No Login Information available.");
}
$aNotifications = array();
// notification for requested password
if($vuser->getField('using_pw_request') == 1) {
if ($vuser->getField('using_pw_request') == 1) {
//$sPwNoti = $notification->returnNotification("warning", i18n("You're logged in with a temporary password. Please change your password."));
$aNotifications[] = i18n("You're logged in with a temporary password. Please change your password.");
}
// Check, if setup folder is still available
if (file_exists(dirname(dirname(dirname(__FILE__)))."/setup")) {
if (file_exists(dirname(dirname(dirname(__FILE__))) . "/setup")) {
$aNotifications[] = i18n("The setup directory still exists. Please remove the setup directory before you continue.");
}
// Check, if sysadmin and/or admin accounts are still using well-known default passwords
$sDate = date('Y-m-d');
$sSQL = "SELECT * FROM ".$cfg["tab"]["phplib_auth_user_md5"]."
$sSQL = "SELECT * FROM " . $cfg["tab"]["phplib_auth_user_md5"] . "
WHERE (username = 'sysadmin' AND password = '48a365b4ce1e322a55ae9017f3daf0c0'
AND (valid_from <= '".Contenido_Security::escapeDB($sDate, $db)."' OR valid_from = '0000-00-00' OR valid_from = '1000-01-01' OR valid_from is NULL) AND
(valid_to >= '".Contenido_Security::escapeDB($sDate, $db)."' OR valid_to = '0000-00-00' OR valid_to is NULL))
AND (valid_from <= '" . Contenido_Security::escapeDB($sDate, $db) . "' OR valid_from = '0000-00-00' OR valid_from = '1000-01-01' OR valid_from is NULL) AND
(valid_to >= '" . Contenido_Security::escapeDB($sDate, $db) . "' OR valid_to = '0000-00-00' OR valid_to is NULL))
OR (username = 'admin' AND password = '21232f297a57a5a743894a0e4a801fc3'
AND (valid_from <= '".Contenido_Security::escapeDB($sDate, $db)."' OR valid_from = '0000-00-00' OR valid_from = '1000-01-01' OR valid_from is NULL) AND
(valid_to >= '".Contenido_Security::escapeDB($sDate, $db)."' OR valid_to = '0000-00-00' OR valid_to = '1000-01-01' OR valid_to is NULL))
AND (valid_from <= '" . Contenido_Security::escapeDB($sDate, $db) . "' OR valid_from = '0000-00-00' OR valid_from = '1000-01-01' OR valid_from is NULL) AND
(valid_to >= '" . Contenido_Security::escapeDB($sDate, $db) . "' OR valid_to = '0000-00-00' OR valid_to = '1000-01-01' OR valid_to is NULL))
";
$db->query($sSQL);
@ -97,7 +96,7 @@ if ($db->num_rows() > 0) {
if (count($aNotifications) > 0) {
$oNotification = new Contenido_Notification();
$sNotification = $oNotification->messageBox("warning", implode("<br />", $aNotifications), 1). "<br />";
$sNotification = $oNotification->messageBox("warning", implode("<br />", $aNotifications), 1) . "<br />";
} else {
$sNotification = "";
}
@ -109,32 +108,31 @@ $userid = $auth->auth["uid"];
$oTpl->set('s', 'WELCOME', "<b>" . i18n("Welcome") . " </b>" . $vuser->getRealname($userid, true) . ".");
$oTpl->set('s', 'LASTLOGIN', i18n("Last login") . ": " . $lastlogin);
$clients= $classclient->getAccessibleClients();
$clients = $classclient->getAccessibleClients();
$cApiClient= new cApiClient;
$warnings= array ();
$cApiClient = new cApiClient;
$warnings = array();
if (count($clients) > 1) {
$clientform= '<form style="margin: 0px" name="clientselect" method="post" target="_top" action="' . $sess->url("index.php") . '">';
$select= new cHTMLSelectElement("changeclient");
$choices= array ();
$clientform = '<form style="margin: 0px" name="clientselect" method="post" target="_top" action="' . $sess->url("index.php") . '">';
$select = new cHTMLSelectElement("changeclient");
$choices = array();
foreach ($clients as $key => $v_client) {
if ($perm->hasClientPermission($key)) {
$cApiClient->loadByPrimaryKey($key);
if ($cApiClient->hasLanguages()) {
$choices[$key]= $v_client['name'] . " (" . $key . ')';
$choices[$key] = $v_client['name'] . " (" . $key . ')';
} else {
$warnings[]= sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key);
$warnings[] = sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key);
}
}
}
$select->autoFill($choices);
$select->setDefault($client);
$clientselect= $select->render();
$clientselect = $select->render();
$oTpl->set('s', 'CLIENTFORM', $clientform);
$oTpl->set('s', 'CLIENTFORMCLOSE', "</form>");
@ -149,20 +147,19 @@ if (count($clients) > 1) {
} else {
$oTpl->set('s', 'OKBUTTON', '');
$sClientForm = '';
if ( count($clients) == 0 ) {
if (count($clients) == 0) {
$sClientForm = i18n('No clients available!');
}
$oTpl->set('s', 'CLIENTFORM', $sClientForm);
$oTpl->set('s', 'CLIENTFORMCLOSE', '');
foreach ($clients as $key => $v_client) {
if ($perm->hasClientPermission($key)) {
$cApiClient->loadByPrimaryKey($key);
if ($cApiClient->hasLanguages()) {
$name= $v_client['name'] . " (" . $key . ')';
$name = $v_client['name'] . " (" . $key . ')';
} else {
$warnings[]= sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key);
$warnings[] = sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key);
}
}
}
@ -176,59 +173,59 @@ if (count($clients) > 1) {
$oTpl->set('s', 'CLIENTSDROPDOWN', $name);
}
$props= new PropertyCollection;
$props = new PropertyCollection;
$props->select("itemtype = 'idcommunication' AND idclient='$client' AND type = 'todo' AND name = 'status' AND value != 'done'");
$todoitems= array ();
$aItemsTodo = [];
while ($prop= $props->next()) {
$todoitems[]= $prop->get("itemid");
while ($prop = $props->next()) {
$aItemsTodo[] = $prop->get("itemid");
}
if (count($todoitems) > 0) {
$in= "idcommunication IN (" . implode(",", $todoitems) . ")";
if (count($aItemsTodo) > 0) {
$in = "idcommunication IN (" . implode(",", $aItemsTodo) . ")";
} else {
$in= 1;
$in = 1;
}
$todoitems= new TODOCollection;
$recipient= $auth->auth["uid"];
$todoitems = new TODOCollection();
$recipient = $auth->auth["uid"];
$todoitems->select("recipient = '$recipient' AND idclient='$client' AND $in");
while ($todo= $todoitems->next()) {
$iItemsTodoOpen = 0;
while ($todo = $todoitems->next()) {
if ($todo->getProperty("todo", "status") != "done") {
$todoitems++;
$iItemsTodoOpen++;
}
}
$sTaskTranslation = '';
if ($todoitems->count() == 1) {
if ($iItemsTodoOpen == 1) {
$sTaskTranslation = i18n("Reminder list: %d Task open");
} else {
$sTaskTranslation = i18n("Reminder list: %d Tasks open");
}
$mycontenido_overview= '<a class="blue" href="' . $sess->url("main.php?area=mycontenido&frame=4") . '">' . i18n("Overview") . '</a>';
$mycontenido_lastarticles= '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_recent&frame=4") . '">' . i18n("Recently edited articles") . '</a>';
$mycontenido_tasks= '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_tasks&frame=4") . '">' . sprintf($sTaskTranslation, $todoitems->count()) . '</a>';
$mycontenido_settings= '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_settings&frame=4") . '">' . i18n("Settings") . '</a>';
$mycontenido_overview = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido&frame=4") . '">' . i18n("Overview") . '</a>';
$mycontenido_lastarticles = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_recent&frame=4") . '">' . i18n("Recently edited articles") . '</a>';
$mycontenido_tasks = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_tasks&frame=4") . '">' . sprintf($sTaskTranslation, $iItemsTodoOpen) . '</a>';
$mycontenido_settings = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_settings&frame=4") . '">' . i18n("Settings") . '</a>';
$oTpl->set('s', 'MYCONTENIDO_OVERVIEW', $mycontenido_overview);
$oTpl->set('s', 'MYCONTENIDO_LASTARTICLES', $mycontenido_lastarticles);
$oTpl->set('s', 'MYCONTENIDO_TASKS', $mycontenido_tasks);
$oTpl->set('s', 'MYCONTENIDO_SETTINGS', $mycontenido_settings);
$admins= $classuser->getSystemAdmins(true);
$admins = $classuser->getSystemAdmins(true);
$sAdminTemplate = '<li class="welcome">%s, %s</li>';
$sAdminName= "";
$sAdminName = "";
$sAdminEmail = "";
$sOutputAdmin = "";
foreach ($admins as $key => $value) {
if ($value["email"] != "") {
$sAdminEmail= '<a class="blue" href="mailto:' . $value["email"] . '">' . $value["email"] . '</a>';
$sAdminName= $value['realname'];
$sAdminEmail = '<a class="blue" href="mailto:' . $value["email"] . '">' . $value["email"] . '</a>';
$sAdminName = $value['realname'];
$sOutputAdmin .= sprintf($sAdminTemplate, $sAdminName, $sAdminEmail);
}
}
@ -244,8 +241,8 @@ if (isset($cfg["contenido"]["handbook_path"]) && file_exists($cfg["contenido"]["
}
// For display current online user in Contenido-Backend
$aMemberList= array ();
$oActiveUsers= new ActiveUsers($db, $cfg, $auth);
$aMemberList = array();
$oActiveUsers = new ActiveUsers($db, $cfg, $auth);
$iNumberOfUsers = 0;
// Start()
@ -255,16 +252,16 @@ $oActiveUsers->startUsersTracking();
$iNumberOfUsers = $oActiveUsers->getNumberOfUsers();
// Find all User who is online
$aMemberList= $oActiveUsers->findAllUser();
$aMemberList = $oActiveUsers->findAllUser();
// Template for display current user
$sTemplate = "";
$sOutput = "";
$sTemplate= '<li class="welcome">%s, %s</li>';
$sTemplate = '<li class="welcome">%s, %s</li>';
foreach ($aMemberList as $key) {
$sRealName= $key['realname'];
$aPerms['0']= $key['perms'];
$sRealName = $key['realname'];
$aPerms['0'] = $key['perms'];
$sOutput .= sprintf($sTemplate, $sRealName, $aPerms['0']);
}
@ -273,11 +270,10 @@ $oTpl->set('s', 'USER_ONLINE', $sOutput);
$oTpl->set('s', 'Anzahl', $iNumberOfUsers);
// rss feed
if($perm->isSysadmin($vuser) && isset($cfg["backend"]["newsfeed"]) && $cfg["backend"]["newsfeed"] == true){
if ($perm->isSysadmin($vuser) && isset($cfg["backend"]["newsfeed"]) && $cfg["backend"]["newsfeed"] == true) {
$newsfeed = 'some news';
$oTpl->set('s', 'CONTENIDO_NEWS', $newsfeed);
}
else{
} else {
$oTpl->set('s', 'CONTENIDO_NEWS', '');
}
@ -287,5 +283,4 @@ $sUpdateNotifierOutput = $oUpdateNotifier->displayOutput();
$oTpl->set('s', 'UPDATENOTIFICATION', $sUpdateNotifierOutput);
$oTpl->generate($cfg["path"]["templates"] . $cfg["templates"]["welcome"]);
?>

Datei anzeigen

@ -194,9 +194,15 @@ function logMessage($msg, $PC_writeDir, $PC_useLog, $PC_debug) {
}
function lTrimZeros($number) {
/*
while ($number[0] == '0') {
$number = substr($number, 1);
}
*
*/
$number = intval(ltrim($number, '0'));
return (is_numeric($number))?$number:0;
}

2
conlite/includes/startup.php Ausführbare Datei → Normale Datei
Datei anzeigen

@ -71,7 +71,7 @@ if (!defined('CL_ENVIRONMENT')) {
*/
if (!defined('CL_VERSION')) {
define('CL_VERSION', '2.1.3');
define('CL_VERSION', '2.2.0 beta');
}

Datei anzeigen

@ -225,7 +225,7 @@ class MetaTagCreatorHtml5 {
* @return boolean
*/
protected function _addFacebookMetaTags() {
if(!$this->_aConfig['add_facebook_meta']) return;
if(empty($this->_aConfig['add_facebook_meta'])) return;
// add always article data, cause they needed for fb-meta
if($this->_aConfig['add_article_meta'] === false) {
$this->_aConfig['add_article_meta'] = true;

@ -1 +1 @@
Subproject commit 3217b73d08e1b76193f02d2d912134320ef40bfe
Subproject commit 91b0fd8c15cdf1b5e9704c8720a40f959e7eb4fe

Datei anzeigen

@ -212,7 +212,7 @@ class pimSetupPluginInstall extends pimSetupBase {
private function _addNavMain() {
$aAttributes = array();
$iCountNavMain = count(self::$XmlNavMain->nav);
$iCountNavMain = (is_countable(self::$XmlNavMain->nav))?count(self::$XmlNavMain->nav):0;
if ($iCountNavMain > 0) {
$oNavMainColl = new cApiNavMainCollection();

Datei anzeigen

@ -1,106 +0,0 @@
var display_url;
function createMenu (menuname, items, links)
{
document.writeln('<div id="' + menuname + '" class="skin0" onMouseover="highlightie5(event)" onMouseout="lowlightie5(event)" onClick="jumptoie5(event)" display:none>');
document.writeln('<div class="skin1">Context Menu</div>');
for (var i = 0; i < items.length; i++)
{
if (items[i] == "--")
{
document.writeln('<hr style="line-height:4px;border: 0px;border-bottom:1px;border-color: black; border-style: solid;">');
} else {
document.writeln('<div class="menuitems" url="' + links[i] + '">' + items[i] + '</div>');
}
}
document.writeln('</div>');
document.getElementById(menuname).style.display = '';
}
var ie5 = document.all && document.getElementById
var ns6 = document.getElementById && !document.all
if (ie5 || ns6)
//var menuobj=document.getElementById("ie5menu")
function showmenuie5(e){
if (ie5)
{
menuobj = document.getElementById(window.event.srcElement.getAttribute("helpid"));
} else
{
menuobj = document.getElementById(e.target.getAttribute("helpid"));
}
//Find out how close the mouse is to the corner of the window
var rightedge = ie5? document.body.clientWidth - event.clientX : window.innerWidth - e.clientX
var bottomedge = ie5? document.body.clientHeight - event.clientY : window.innerHeight - e.clientY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge < menuobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left = ie5? document.body.scrollLeft + event.clientX - menuobj.offsetWidth : window.pageXOffset + e.clientX - menuobj.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left = ie5? document.body.scrollLeft + event.clientX : window.pageXOffset + e.clientX
//same concept with the vertical position
if (bottomedge < menuobj.offsetHeight)
menuobj.style.top = ie5? document.body.scrollTop + event.clientY - menuobj.offsetHeight : window.pageYOffset + e.clientY - menuobj.offsetHeight
else
menuobj.style.top = ie5? document.body.scrollTop + event.clientY : window.pageYOffset + e.clientY
menuobj.style.visibility = "visible"
return false;
}
function hidemenuie5(e){
if (typeof menuobj == "object")
{
menuobj.style.visibility = "hidden"
}
}
function highlightie5(e){
var firingobj = ie5? event.srcElement : e.target
if (firingobj.className == "menuitems" || ns6 && firingobj.parentNode.className == "menuitems"){
if (ns6 && firingobj.parentNode.className == "menuitems") firingobj = firingobj.parentNode //up one node
firingobj.style.backgroundColor = "#F4F8BD"
firingobj.style.color = "black"
firingobj.style.cursor = "pointer"
if (display_url == 1)
window.status = event.srcElement.url
}
}
function lowlightie5(e){
var firingobj = ie5? event.srcElement : e.target
if (firingobj.className == "menuitems" || ns6 && firingobj.parentNode.className == "menuitems"){
if (ns6 && firingobj.parentNode.className == "menuitems") firingobj = firingobj.parentNode //up one node
firingobj.style.backgroundColor = ""
firingobj.style.color = "black"
window.status = ''
}
}
function jumptoie5(e){
var firingobj = ie5? event.srcElement : e.target
if (firingobj.className == "menuitems" || ns6 && firingobj.parentNode.className == "menuitems"){
if (ns6 && firingobj.parentNode.className == "menuitems") firingobj = firingobj.parentNode
if (firingobj.getAttribute("target"))
window.open(firingobj.getAttribute("url"), firingobj.getAttribute("target"))
else
window.location = firingobj.getAttribute("url")
}
}
var menuobj;
if (ie5 || ns6){
//menuobj.style.display=''
document.oncontextmenu = showmenuie5
document.onclick = hidemenuie5
}

Datei anzeigen

@ -1,5 +1,5 @@
<html>
<head>
<head>
<title></title>
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache">
@ -30,7 +30,7 @@
function disableFunctionsOnTimeControl()
{
// Timecontrol enabled => disable Online and Startaticle
if(document.getElementById("timemgmt").checked == true)
if (document.getElementById("timemgmt").checked == true)
{
document.getElementById("is_start").checked = false;
document.getElementById("is_start").disabled = true;
@ -51,12 +51,12 @@
}
}
</script>
</head>
<body style="margin: 10px" onload="disableFunctionsOnTimeControl()">
</head>
<body style="margin: 10px" onload="disableFunctionsOnTimeControl()">
<div class="categorypath">{CATEGORY}</div>
<div class="categorypath">{CATEGORY}</div>
<form method="post" name="art_props" action="{ACTION}">
<form method="post" name="art_props" action="{ACTION}">
<input type="hidden" name="action" value="con_saveart">
{HIDDENSESSION}
@ -153,7 +153,7 @@
<td class="text_medium"><label for="time_move_cat">i18n("When expired, move to category"):</label></td><td>{MOVETOCATEGORYSELECT}</td></tr>
<tr><td valign="top"><input type="checkbox" id="time_online_move" name="time_online_move" value="1" {ONLINEAFTERMOVECHECKED}></td>
<td colspan="2" class="text_medium"><label for="time_online_move">i18n("Make online after move")</label></td></tr>
</table>
</table>
</td></tr>
<tr valign="top">
<td class="text_medium" style="border: 1px;border-top: 0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{ONLINE}</td>
@ -207,21 +207,23 @@
</table>
</form>
</form>
<script language="javascript">
<script language="javascript">
/* Create a reference to the
Article Object in frame 'right_top' */
artObj = parent.parent.frames["left"].frames["left_top"].artObj;
if ( parent.parent.frames["right"].frames["right_top"].document.getElementById('c_1') ) {
if (parent.parent.frames["right"].frames["right_top"].document.getElementById('c_1')) {
menuItem = parent.parent.frames["right"].frames["right_top"].document.getElementById('c_1');
parent.parent.frames["right"].frames["right_top"].sub.clicked(menuItem.firstChild);
}
{DATAPUSH}
{
DATAPUSH
}
</script>
</body>
</script>
</body>
</html>

Datei anzeigen

@ -18,10 +18,10 @@
<tr>
<td class="text_medium" style="border: 0px; border-bottom:1px; border-color: #a9aec2; border-style: solid">
<br><b>Current version:</b><br>
Carsten Peters, Markus H&uuml;bner, Ortwin Pinke, Ren&eacute; Mansveld, Steffen Reddig, Thomas Dubbert
Carsten Peters, Markus H&uuml;bner, Ortwin Pinke, Lars Lämmerhirt
<br><br>
<b>Special thanks to all contributors of the former releases and bugreporters.</b><br>
-
Ren&eacute; Mansveld, Steffen Reddig, Thomas Dubbert
<br><br>
<b>Special thanks to all contributors of Contenido up to 4.8.15, which ConLite is based upon.</b><br>
Andreas Kummer, Andreas Lindner, Bilal Arslan, Bj&ouml;rn Behrens, Christa Tabara, Christian End, Conrad Leu, Dominik Ziegler, Frederic Schneider, Harald Wirths, Holger Librenz, Ingo van Peeren, Jonas Vogel, Kristina Birkenbeul, Marco Prey, Martin Horwath, Murat Pur&ccedil;, Oliver Lohkemper, Rudi Bieller, Timo Trautmann, Thorsten Granz, Thomas Sch&auml;fer-Tertilt, Tobias Klonk, Daniel Rothmaler, Guido, i-fekt, Helen Sch&auml;fer, Jan Lengowski, John van Aerle, Maria Martha Sanchez-Straub, Marco Jahn, Martin Hahn, Marion Fischer, Olaf Niemann, Robert Herbert, Stefan Jelner, Timo A. Hummel, Willi Man

Datei anzeigen

@ -174,6 +174,7 @@ return array(
'cHTML5Button' => 'conlite/classes/cHTML5/class.chtml5.button.php',
'cHTML5Meta' => 'conlite/classes/cHTML5/class.chtml5.meta.php',
'cHTML' => 'conlite/classes/cHTML5/class.chtml.php',
'cHTML5Common' => 'conlite/classes/cHTML5/class.chtml5.common.php',
'cHTML5List' => 'conlite/classes/cHTML5/class.chtml5.list.php',
'XML_doc' => 'conlite/classes/class.xml.php',
'Contenido_FrontendNavigation_Breadcrumb' => 'conlite/classes/Contenido_FrontendNavigation/Contenido_FrontendNavigation_Breadcrumb.class.php',

Datei anzeigen

@ -139,27 +139,28 @@ $cfg['native_i18n'] = false;
*/
/* Don't display errors */
@ini_set("display_errors", false);
ini_set("display_errors", false);
/* Log errors to a file */
@ini_set("log_errors", true);
ini_set("log_errors", true);
/* The file in which we write the error log */
@ini_set("error_log", $cfg['path']['conlite_logs'] . "errorlog.txt");
ini_set("error_log", $cfg['path']['conlite_logs'] . "errorlog.txt");
/* Report all errors except warnings */
if ($cfg["develop"]["show_errors"] && $_SERVER['SERVER_NAME'] == "local.dceserver.de") {
/**
* Report all errors except warnings
* @todo change first if to use a local config var for servername
*
**/
if ($cfg["develop"]["show_errors"]
&& filter_input(INPUT_SERVER, 'SERVER_NAME', FILTER_SANITIZE_STRING) == "local.dceserver.de") {
error_reporting(E_ALL);
} else {
if ($cfg["develop"]["show_deprecated"]) {
error_reporting(E_ALL ^ E_NOTICE);
} else {
if (version_compare(PHP_VERSION, '5.3.0', '<')) { // remove unknown deprecated for PHP < 5.3
error_reporting(E_ALL ^ E_NOTICE);
} else if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
if (version_compare(PHP_VERSION, '7.4.0', '>=')) {
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_USER_DEPRECATED ^ E_WARNING);
} else if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_USER_DEPRECATED ^ E_STRICT);
} else {
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_USER_DEPRECATED);
}
@ -322,4 +323,3 @@ $cfg['password']['numbers_mandatory'] = 3;
*/
// Define here all content types which includes special module translations (dont forget the prefix "CMS_"!)
$cfg['translatable_content_types'] = array('CMS_TEASER', 'CMS_FILELIST');
?>

Datei anzeigen

@ -1,6 +1,6 @@
auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true
include.path=${php.global.include.path}
php.version=PHP_73
php.version=PHP_81
source.encoding=UTF-8
src.dir=.
tags.asp=false

Datei anzeigen

@ -513,6 +513,7 @@ abstract class HTML_Common2 implements ArrayAccess
* @return boolean Returns true on success or false on failure.
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
*/
#[ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->attributes[strtolower($offset)]);
@ -527,6 +528,7 @@ abstract class HTML_Common2 implements ArrayAccess
* @link http://php.net/manual/en/arrayaccess.offsetget.php
* @see getAttribute()
*/
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->getAttribute($offset);
@ -542,6 +544,7 @@ abstract class HTML_Common2 implements ArrayAccess
* @link http://php.net/manual/en/arrayaccess.offsetset.php
* @see setAttribute()
*/
#[ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (null !== $offset) {
@ -561,6 +564,7 @@ abstract class HTML_Common2 implements ArrayAccess
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
* @see removeAttribute
*/
#[ReturnTypeWillChange]
public function offsetUnset($offset)
{
$this->removeAttribute($offset);

Datei anzeigen

@ -180,7 +180,7 @@ INSERT INTO !PREFIX!_files VALUES('402', '402', 'include.js_history.php', 'main'
INSERT INTO !PREFIX!_files VALUES('403', '403', 'include.html_tpl_history.php', 'main');
INSERT INTO !PREFIX!_files VALUES('415', '415', 'include.system_configuration.php', 'main');
INSERT INTO !PREFIX!_files VALUES('503', '52', 'include.subnav.php', 'main');
INSERT INTO !PREFIX!_files VALUES('700', '52', 'include.subnav_blank.php', 'main');
INSERT INTO !PREFIX!_files VALUES('700', '52', 'include.subnav.php', 'main');
INSERT INTO !PREFIX!_files VALUES('813', '811', 'include.system_purge.php', 'main');
INSERT INTO !PREFIX!_files VALUES('814', '812', 'include.system_db_backup.php', 'main');
INSERT INTO !PREFIX!_files VALUES('990', '990', 'pluginmanager/includes/include.right_bottom.php', 'main');

Datei anzeigen

@ -1,23 +1,23 @@
DELETE FROM !PREFIX!_type WHERE idtype < 10000;
INSERT INTO !PREFIX!_type VALUES('22', 'CMS_QRCODE', '/**\r\n * CMS_QRCODE\r\n */ \r\n$tmp = $a_content[''CMS_QRCODE''][$val];\r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''", "''", $tmp); \r\n$tmp = str_replace("\\$", ''\\\\\\$'', $tmp); \r\n\r\n$q = array("", "L", "M", "Q", "H");\r\n$quality = intval(getEffectiveSetting("qrcode", "quality"));\r\nif ($quality == 0) {\r\n setSystemProperty("qrcode", "quality", 1);\r\n setSystemProperty("qrcode", "blocksize", 3);\r\n setSystemProperty("qrcode", "border", 2);\r\n $quality = 1;\r\n}\r\n$quality = $q[$quality];\r\n$blocksize = intval(getEffectiveSetting("qrcode", "blocksize", 3));\r\n$border = intval(getEffectiveSetting("qrcode", "border", 2));\r\n\r\nif ($edit) {\r\n # In editor we always generate a new image because of possible changes\r\n $tmp2 = "\r\necho ''<strong>QR Code</strong><br />(online only)<br />'';\r\n@unlink(''" . $cfgClient[$client]["path"]["frontend"] . "cache/QR-Code-" . $idart . "-" . $val . ".png'');";\r\n \r\n # Edit anchor and image\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_QRCODE&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_QRCODE_'' . $val . ''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'', ''" . $editLink . "'');");\r\n # Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . "but_edittext.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n # Process for tmp2put with echo\r\n $finalEditButton = $editAnchor->render();\r\n \r\n $tmp2 .= "echo ''" . $finalEditButton . "'';";\r\n} else {\r\n # In frontend and preview we only generate a new image if it was deleted\r\n $tmp2 = "\r\nif (!is_file(''" . $cfgClient[$client][''path''][''frontend''] . "cache/QR-Code-" . $idart . "-" . $val . ".png'')) {\r\n define(''QR_CACHE_DIR'', ''" . $cfgClient[$client][''path''][''frontend''] . "cache/phpqrcode/'');\r\n if (!is_dir(QR_CACHE_DIR)) {\r\n mkdir(QR_CACHE_DIR);\r\n }";\r\n if (isStartArticle($idartlang, $idcat, $lang)) {\r\n $tmp2 .= "\r\n QRcode::png(''" . ((strlen($tmp)) ? $tmp : Contenido_Url::getInstance()->build(array(''idcat'' => $idcat, ''client'' => $client, ''lang'' => $lang), true)) . "'', ''" . $cfgClient[$client][''path''][''frontend''] . ''cache/QR-Code-'' . $idart . ''-'' . $val . ''.png'' . "'', ''" . $quality . "'', " . $blocksize . ", " . $border . ");";\r\n } else {\r\n $tmp2 .= "\r\n QRcode::png(''" . ((strlen($tmp)) ? $tmp : Contenido_Url::getInstance()->build(array(''idcat'' => $idcat, ''idart'' => $idart, ''client'' => $client, ''lang'' => $lang), true)) . "'', ''" . $cfgClient[$client][''path''][''frontend''] . ''cache/QR-Code-'' . $idart . ''-'' . $val . ''.png'' . "'', ''" . $quality . "'', " . $blocksize . ", " . $border . ");";\r\n }\r\n $tmp2 .= "\r\n}\r\necho ''<img src=\\"" . $cfgClient[$client]["path"]["htmlpath"] . "cache/QR-Code-" . $idart . "-" . $val . ".png\\" alt=\\"QR Code\\" /><br />'';";\r\n}\r\n$tmp = $tmp2;', 'QR Code', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('18', 'CMS_EASYIMGEDIT', '/**\r\n * CMS_EASYIMGEDIT\r\n */\r\n$tmp = "";\r\nif ($edit) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_EASYIMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_EASYIMGEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', '', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('19', 'CMS_DATE', '$tmp = $a_content["CMS_DATE"][$val];\r\n\r\n$oCmsDate = new Cms_Date($tmp, $val, $idartlang, $editLink, $cfg, $db, count($a_content["CMS_DATE"]), $belang);\r\n\r\nif($edit){\r\n\r\n$tmp = $oCmsDate->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsDate->getAllWidgetView();\r\n\r\n}', 'Date', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('20', 'CMS_TEASER', '$tmp = $a_content["CMS_TEASER"][$val];\r\n\r\n$oCmsTeaser = new Cms_Teaser($tmp, $val, $idartlang, $editLink, $cfg, $db, $belang, $client, $lang, $cfgClient, $sess);\r\n\r\nif($edit){\r\n\r\n$tmp = $oCmsTeaser->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsTeaser->getAllWidgetView();\r\n\r\n}', 'Teaser', '0', '', '2009-04-20 13:12:14', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('21', 'CMS_FILELIST', '$tmp = $a_content["CMS_FILELIST"][$val];\r\n\r\n$oCmsFileList = new Cms_FileList($tmp, $val, $idartlang, $editLink, $cfg, $db, $belang, $client, $lang, $cfgClient, $sess);\r\n\r\nif($edit){\r\n\r\n$tmp = $oCmsFileList->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsFileList->getAllWidgetView();\r\n\r\n}', '', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('17', 'CMS_HTMLTEXT', '/**\r\n * CMS_HTMLTEXT\r\n */\r\ncInclude("includes", "functions.lang.php");\r\n\r\n$content = $a_content[''CMS_HTMLTEXT''][$val];\r\n$content = urldecode($content);\r\n$content = htmldecode($content);\r\n$content = strip_tags($content);\r\n\r\n$content = str_replace("&nbsp;", " ", $content);\r\n\r\n$content = htmlspecialchars($content);\r\nif ($content == "")\r\n{\r\n $content = "&nbsp;";\r\n}\r\n\r\n$content = nl2br($content);\r\n\r\nif ($edit) {\r\n\r\n $div = new cHTMLDiv;\r\n $div->setID("HTMLTEXT_".$db->f("idtype")."_".$val);\r\n $div->setEvent("focus", "this.style.border=''1px solid #bb5577''");\r\n $div->setEvent("blur", "this.style.border=''1px dashed #bfbfbf''");\r\n $div->setStyleDefinition("border", "1px dashed #bfbfbf");\r\n $div->updateAttributes(array("contentEditable" => "true"));\r\n $div->setStyleDefinition("direction", langGetTextDirection($lang));\r\n \r\n $editlink = new cHTMLLink;\r\n $editlink->setClass(''CMS_HTMLTEXT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editlink->setLink($sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLTEXT&typenr=$val&lang=$lang"));\r\n \r\n $editimg = new cHTMLImage;\r\n $editimg->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edittext.gif");\r\n \r\n $savelink = new cHTMLLink;\r\n $savelink->setClass(''CMS_HTMLTEXT_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $savelink->setLink("javascript:setcontent(''$idartlang'',''0'')");\r\n \r\n $saveimg = new cHTMLImage;\r\n $saveimg->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif");\r\n \r\n $savelink->setContent($saveimg);\r\n \r\n $editlink->setContent($editimg);\r\n \r\n $div->setContent($content);\r\n\r\n $tmp = implode("", array($div->render(), $editlink->render(), " ", $savelink->render()));\r\n $tmp = str_replace(''"'', ''\\"'', $tmp);\r\n} else {\r\n $tmp = $content;\r\n $tmp = str_replace(''"'', ''\\"'', $tmp);\r\n}\r\n\r\n\r\n$tmp = addslashes($tmp);\r\n$tmp = str_replace(''$'', ''\\\\\\$'', $tmp);', 'Text / Standard', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('16', 'CMS_SIMPLELINKEDIT', '/**\r\n * CMS_LINKEDIT\r\n */\r\n$tmp = "";\r\nif ($edit) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_SIMPLELINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_SIMPLELINKEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', '', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('14', 'CMS_IMGEDIT', '/**\r\n * CMS_IMGEDIT\r\n */\r\n$tmp = '''';\r\n\r\nif ($edit) {\r\n \r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_IMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_IMGEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Edit button for an image', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:58:44');
INSERT INTO !PREFIX!_type VALUES('22', 'CMS_QRCODE', '/**\r\n * CMS_QRCODE\r\n */ \r\n$tmp = $a_content[''CMS_QRCODE''][$val];\r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''", "''", $tmp); \r\n$tmp = str_replace("\\$", ''\\\\\\$'', $tmp); \r\n\r\n$q = array("", "L", "M", "Q", "H");\r\n$quality = intval(getEffectiveSetting("qrcode", "quality"));\r\nif ($quality == 0) {\r\n setSystemProperty("qrcode", "quality", 1);\r\n setSystemProperty("qrcode", "blocksize", 3);\r\n setSystemProperty("qrcode", "border", 2);\r\n $quality = 1;\r\n}\r\n$quality = $q[$quality];\r\n$blocksize = intval(getEffectiveSetting("qrcode", "blocksize", 3));\r\n$border = intval(getEffectiveSetting("qrcode", "border", 2));\r\n\r\nif (!empty($edit)) {\r\n # In editor we always generate a new image because of possible changes\r\n $tmp2 = "\r\necho ''<strong>QR Code</strong><br />(online only)<br />'';\r\n@unlink(''" . $cfgClient[$client]["path"]["frontend"] . "cache/QR-Code-" . $idart . "-" . $val . ".png'');";\r\n \r\n # Edit anchor and image\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_QRCODE&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_QRCODE_'' . $val . ''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'', ''" . $editLink . "'');");\r\n # Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . "but_edittext.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n # Process for tmp2put with echo\r\n $finalEditButton = $editAnchor->render();\r\n \r\n $tmp2 .= "echo ''" . $finalEditButton . "'';";\r\n} else {\r\n # In frontend and preview we only generate a new image if it was deleted\r\n $tmp2 = "\r\nif (!is_file(''" . $cfgClient[$client][''path''][''frontend''] . "cache/QR-Code-" . $idart . "-" . $val . ".png'')) {\r\n define(''QR_CACHE_DIR'', ''" . $cfgClient[$client][''path''][''frontend''] . "cache/phpqrcode/'');\r\n if (!is_dir(QR_CACHE_DIR)) {\r\n mkdir(QR_CACHE_DIR);\r\n }";\r\n if (isStartArticle($idartlang, $idcat, $lang)) {\r\n $tmp2 .= "\r\n QRcode::png(''" . ((strlen($tmp)) ? $tmp : Contenido_Url::getInstance()->build(array(''idcat'' => $idcat, ''client'' => $client, ''lang'' => $lang), true)) . "'', ''" . $cfgClient[$client][''path''][''frontend''] . ''cache/QR-Code-'' . $idart . ''-'' . $val . ''.png'' . "'', ''" . $quality . "'', " . $blocksize . ", " . $border . ");";\r\n } else {\r\n $tmp2 .= "\r\n QRcode::png(''" . ((strlen($tmp)) ? $tmp : Contenido_Url::getInstance()->build(array(''idcat'' => $idcat, ''idart'' => $idart, ''client'' => $client, ''lang'' => $lang), true)) . "'', ''" . $cfgClient[$client][''path''][''frontend''] . ''cache/QR-Code-'' . $idart . ''-'' . $val . ''.png'' . "'', ''" . $quality . "'', " . $blocksize . ", " . $border . ");";\r\n }\r\n $tmp2 .= "\r\n}\r\necho ''<img src=\\"" . $cfgClient[$client]["path"]["htmlpath"] . "cache/QR-Code-" . $idart . "-" . $val . ".png\\" alt=\\"QR Code\\" /><br />'';";\r\n}\r\n$tmp = $tmp2;', 'QR Code', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('18', 'CMS_EASYIMGEDIT', '/**\r\n * CMS_EASYIMGEDIT\r\n */\r\n$tmp = "";\r\nif (!empty($edit)) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_EASYIMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_EASYIMGEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', '', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('19', 'CMS_DATE', '$tmp = $a_content["CMS_DATE"][$val];\r\n\r\n$oCmsDate = new Cms_Date($tmp, $val, $idartlang, $editLink, $cfg, $db, count($a_content["CMS_DATE"]), $belang);\r\n\r\nif(!empty($edit)){\r\n\r\n$tmp = $oCmsDate->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsDate->getAllWidgetView();\r\n\r\n}', 'Date', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('20', 'CMS_TEASER', '$tmp = $a_content["CMS_TEASER"][$val];\r\n\r\n$oCmsTeaser = new Cms_Teaser($tmp, $val, $idartlang, $editLink, $cfg, $db, $belang, $client, $lang, $cfgClient, $sess);\r\n\r\nif(!empty($edit)){\r\n\r\n$tmp = $oCmsTeaser->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsTeaser->getAllWidgetView();\r\n\r\n}', 'Teaser', '0', '', '2009-04-20 13:12:14', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('21', 'CMS_FILELIST', '$tmp = $a_content["CMS_FILELIST"][$val];\r\n\r\n$oCmsFileList = new Cms_FileList($tmp, $val, $idartlang, $editLink, $cfg, $db, $belang, $client, $lang, $cfgClient, $sess);\r\n\r\nif(!empty($edit)){\r\n\r\n$tmp = $oCmsFileList->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsFileList->getAllWidgetView();\r\n\r\n}', '', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('17', 'CMS_HTMLTEXT', '/**\r\n * CMS_HTMLTEXT\r\n */\r\ncInclude("includes", "functions.lang.php");\r\n\r\n$content = $a_content[''CMS_HTMLTEXT''][$val];\r\n$content = urldecode($content);\r\n$content = htmldecode($content);\r\n$content = strip_tags($content);\r\n\r\n$content = str_replace("&nbsp;", " ", $content);\r\n\r\n$content = htmlspecialchars($content);\r\nif ($content == "")\r\n{\r\n $content = "&nbsp;";\r\n}\r\n\r\n$content = nl2br($content);\r\n\r\nif (!empty($edit)) {\r\n\r\n $div = new cHTMLDiv;\r\n $div->setID("HTMLTEXT_".$db->f("idtype")."_".$val);\r\n $div->setEvent("focus", "this.style.border=''1px solid #bb5577''");\r\n $div->setEvent("blur", "this.style.border=''1px dashed #bfbfbf''");\r\n $div->setStyleDefinition("border", "1px dashed #bfbfbf");\r\n $div->updateAttributes(array("contentEditable" => "true"));\r\n $div->setStyleDefinition("direction", langGetTextDirection($lang));\r\n \r\n $editlink = new cHTMLLink;\r\n $editlink->setClass(''CMS_HTMLTEXT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editlink->setLink($sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLTEXT&typenr=$val&lang=$lang"));\r\n \r\n $editimg = new cHTMLImage;\r\n $editimg->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edittext.gif");\r\n \r\n $savelink = new cHTMLLink;\r\n $savelink->setClass(''CMS_HTMLTEXT_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $savelink->setLink("javascript:setcontent(''$idartlang'',''0'')");\r\n \r\n $saveimg = new cHTMLImage;\r\n $saveimg->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif");\r\n \r\n $savelink->setContent($saveimg);\r\n \r\n $editlink->setContent($editimg);\r\n \r\n $div->setContent($content);\r\n\r\n $tmp = implode("", array($div->render(), $editlink->render(), " ", $savelink->render()));\r\n $tmp = str_replace(''"'', ''\\"'', $tmp);\r\n} else {\r\n $tmp = $content;\r\n $tmp = str_replace(''"'', ''\\"'', $tmp);\r\n}\r\n\r\n\r\n$tmp = addslashes($tmp);\r\n$tmp = str_replace(''$'', ''\\\\\\$'', $tmp);', 'Text / Standard', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('16', 'CMS_SIMPLELINKEDIT', '/**\r\n * CMS_LINKEDIT\r\n */\r\n$tmp = "";\r\nif (!empty($edit)) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_SIMPLELINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_SIMPLELINKEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', '', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('14', 'CMS_IMGEDIT', '/**\r\n * CMS_IMGEDIT\r\n */\r\n$tmp = '''';\r\n\r\nif (!empty($edit)) {\r\n \r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_IMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_IMGEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Edit button for an image', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:58:44');
INSERT INTO !PREFIX!_type VALUES('15', 'CMS_IMGTITLE', '/**\r\n * CMS_IMGTITLE\r\n */\r\n$tmp = $a_content["CMS_IMGDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = addslashes($tmp);', 'Title of an image', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('13', 'CMS_RAWLINK', '/**\r\n* CMS_RAWLINK\r\n*/\r\nglobal $cfgClient;\r\nglobal $client;\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n $tmp = "front_content.php?idcatart=". $tmp."&client=".$client."&lang=".$lang;\r\n if ($edit) $tmp = $sess->url("$tmp");\r\n\r\n}', 'Raw Link without transformation', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('13', 'CMS_RAWLINK', '/**\r\n* CMS_RAWLINK\r\n*/\r\nglobal $cfgClient;\r\nglobal $client;\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n $tmp = "front_content.php?idcatart=". $tmp."&client=".$client."&lang=".$lang;\r\n if (!empty($edit)) $tmp = $sess->url("$tmp");\r\n\r\n}', 'Raw Link without transformation', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('11', 'CMS_LINKTITLE', '/**\r\n * CMS_LINKTITLE\r\n */\r\n$tmp = $a_content["CMS_LINKDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = addslashes($tmp);\r\n\r\n', 'Title of a Link', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('12', 'CMS_LINKEDIT', '/**\r\n * CMS_LINKEDIT\r\n */\r\n$tmp = "";\r\n\r\nif ($edit) {\r\n \r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_LINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_LINKEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $finalEditButton;\r\n \r\n}', 'Link edit button', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('9', 'CMS_HEAD', '/**\r\n * CMS_HEAD\r\n */\r\n$tmp = $a_content["CMS_HEAD"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\nif ($edit) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HEAD&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_HEAD_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithead.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Headline / Standard', '0', '', '2002-05-13 19:02:34', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('10', 'CMS_SWF', '/**\r\n * CMS_SWF\r\n */\r\n\r\nif ( !is_object($db2) ) $db2 = new DB_Contenido;\r\n\r\n$tmp_id = $a_content[''CMS_SWF''][$val];\r\n\r\n$sql = "SELECT * FROM ".$cfg["tab"]["upl"]." WHERE idclient=''".$client."'' AND idupl=''".$tmp_id."'' AND filetype = ''swf''";\r\n\r\n$db2->query($sql);\r\n\r\nif ( $db2->next_record() ) {\r\n\r\n $tmp_swf = $cfgClient[$client]["upload"] . $db2->f("dirname") . $db2->f("filename");\r\n \r\n $aImgSize = @getimagesize($tmp_swf);\r\n\r\n $width = $aImgSize[0];\r\n $height = $aImgSize[1];\r\n\r\n $tmp = ''<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\r\n codebase="http://download.macromedia.com\r\n /pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"\r\n width="''.$width.''" height="''.$height.''" id="movie" align="">\r\n <param name="movie" value="''.$tmp_swf.''">\r\n <embed src="''.$tmp_swf.''" quality="high" width="''.$width.''"\r\n height="''.$height.''" name="movie" align="" type="application/x-shockwave-flash"\r\n plug inspage="http://www.macromedia.com/go/getflashplayer">\r\n </object>'';\r\n} else {\r\n $tmp = '''';\r\n}\r\n\r\n\r\nif( $edit ) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_SWF&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_SWF_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editswf.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n \r\n $tmp = ''<table cellspacing="0" cellpadding="0" border="0"><tr><td>''.$tmp.''</td></tr><tr><td>''.$finalEditButton.''</td></tr></table>'';\r\n}\r\n\r\n$tmp = addslashes( addslashes($tmp) ); \r\n$tmp = str_replace( "\\\\\\''", "''", $tmp ); ', 'Flash Movie', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('12', 'CMS_LINKEDIT', '/**\r\n * CMS_LINKEDIT\r\n */\r\n$tmp = "";\r\n\r\nif (!empty($edit)) {\r\n \r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_LINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_LINKEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $finalEditButton;\r\n \r\n}', 'Link edit button', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('9', 'CMS_HEAD', '/**\r\n * CMS_HEAD\r\n */\r\n$tmp = $a_content["CMS_HEAD"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\nif (!empty($edit)) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HEAD&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_HEAD_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithead.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Headline / Standard', '0', '', '2002-05-13 19:02:34', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('10', 'CMS_SWF', '/**\r\n * CMS_SWF\r\n */\r\n\r\nif ( !is_object($db2) ) $db2 = new DB_Contenido;\r\n\r\n$tmp_id = $a_content[''CMS_SWF''][$val];\r\n\r\n$sql = "SELECT * FROM ".$cfg["tab"]["upl"]." WHERE idclient=''".$client."'' AND idupl=''".$tmp_id."'' AND filetype = ''swf''";\r\n\r\n$db2->query($sql);\r\n\r\nif ( $db2->next_record() ) {\r\n\r\n $tmp_swf = $cfgClient[$client]["upload"] . $db2->f("dirname") . $db2->f("filename");\r\n \r\n $aImgSize = @getimagesize($tmp_swf);\r\n\r\n $width = $aImgSize[0];\r\n $height = $aImgSize[1];\r\n\r\n $tmp = ''<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\r\n codebase="http://download.macromedia.com\r\n /pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"\r\n width="''.$width.''" height="''.$height.''" id="movie" align="">\r\n <param name="movie" value="''.$tmp_swf.''">\r\n <embed src="''.$tmp_swf.''" quality="high" width="''.$width.''"\r\n height="''.$height.''" name="movie" align="" type="application/x-shockwave-flash"\r\n plug inspage="http://www.macromedia.com/go/getflashplayer">\r\n </object>'';\r\n} else {\r\n $tmp = '''';\r\n}\r\n\r\n\r\nif( !empty($edit) ) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_SWF&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_SWF_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editswf.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n \r\n $tmp = ''<table cellspacing="0" cellpadding="0" border="0"><tr><td>''.$tmp.''</td></tr><tr><td>''.$finalEditButton.''</td></tr></table>'';\r\n}\r\n\r\n$tmp = addslashes( addslashes($tmp) ); \r\n$tmp = str_replace( "\\\\\\''", "''", $tmp ); ', 'Flash Movie', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('7', 'CMS_LINKTARGET', '/**\r\n * CMS_LINKTARGET\r\n */\r\n$tmp = $a_content["CMS_LINKTARGET"][$val];\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = urldecode($tmp);', 'Frame', '0', '', '2002-05-13 19:04:43', '2002-05-13 19:04:43');
INSERT INTO !PREFIX!_type VALUES('8', 'CMS_LINKDESCR', '/**\r\n * CMS_LINKDESCR\r\n */\r\n$tmp = $a_content["CMS_LINKDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\nif ($edit) {\r\n\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_LINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_LINKDESCR_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Description', '0', '', '2002-05-13 19:05:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('6', 'CMS_LINK', '/**\r\n* CMS_LINK\r\n*/\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n $tmp = "front_content.php?idcatart=". $tmp."&client=".$client."&lang=".$lang;\r\n if ($edit) $tmp = $sess->url("$tmp");\r\n\r\n} else {\r\n\r\n if (!preg_match(''/^(http|https|ftp|telnet|gopher):\\/\\/((?:[a-zA-Z0-9_-]+\\.?)+):?(\\d*)/'', $tmp)) {\r\n // it''s a relative link, or an absolute link with unsupported protocol\r\n if (substr($tmp,0,4) == "www." || $tmp == "") { // only check if it could be a domainname\r\n $tmp = "http://".$tmp;\r\n }\r\n }\r\n\r\n}', 'Link', '0', '', '2002-05-13 19:04:36', '2002-05-13 19:04:36');
INSERT INTO !PREFIX!_type VALUES('8', 'CMS_LINKDESCR', '/**\r\n * CMS_LINKDESCR\r\n */\r\n$tmp = $a_content["CMS_LINKDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\nif (!empty($edit)) {\r\n\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_LINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_LINKDESCR_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Description', '0', '', '2002-05-13 19:05:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('6', 'CMS_LINK', '/**\r\n* CMS_LINK\r\n*/\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n $tmp = "front_content.php?idcatart=". $tmp."&client=".$client."&lang=".$lang;\r\n if (!empty($edit)) $tmp = $sess->url("$tmp");\r\n\r\n} else {\r\n\r\n if (!preg_match(''/^(http|https|ftp|telnet|gopher):\\/\\/((?:[a-zA-Z0-9_-]+\\.?)+):?(\\d*)/'', $tmp)) {\r\n // it''s a relative link, or an absolute link with unsupported protocol\r\n if (substr($tmp,0,4) == "www." || $tmp == "") { // only check if it could be a domainname\r\n $tmp = "http://".$tmp;\r\n }\r\n }\r\n\r\n}', 'Link', '0', '', '2002-05-13 19:04:36', '2002-05-13 19:04:36');
INSERT INTO !PREFIX!_type VALUES('4', 'CMS_IMG', '/**\r\n * CMS_IMG\r\n */\r\n \r\n$tmp = $a_content["CMS_IMG"][$val];\r\n$tmp = urldecode($tmp);\r\nif($tmp==""||$tmp=="0"){\r\n$tmp="";\r\n\r\n}else{\r\n\r\nif (is_numeric($tmp))\r\n{\r\n$sql = "SELECT * FROM ".$cfg["tab"]["upl"]." WHERE idclient=''".$client."'' AND idupl=''".$tmp."''";\r\n\r\n$db2 = new DB_Contenido;\r\n$db2->query($sql);\r\n\r\nif ( $db2->next_record() ) {\r\n\r\n $tmp = $cfgClient[$client]["path"]["htmlpath"].$cfgClient[$client]["upload"].$db2->f("dirname").$db2->f("filename");\r\n }\r\n}\r\n\r\n $tmp = htmlspecialchars($tmp);\r\n$tmp = urldecode($tmp);\r\n $tmp = str_replace("''", "\\''", $tmp);\r\n}', 'Image', '0', '', '2002-05-13 19:04:21', '2002-05-13 19:04:21');
INSERT INTO !PREFIX!_type VALUES('5', 'CMS_IMGDESCR', '/**\r\n * CMS_IMGDESCR\r\n */\r\n$tmp = $a_content["CMS_IMGDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlentities($tmp,ENT_QUOTES);\r\n\r\n\r\nif ($edit) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_IMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_IMGDESCR_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Description', '0', '', '2002-05-13 19:04:28', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('3', 'CMS_TEXT', '/**\r\n * CMS_TEXT\r\n */\r\ncInclude("includes", "functions.lang.php");\r\n\r\n$tmp = $a_content["CMS_TEXT"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = nl2br($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp);\r\n\r\n$tmp = str_replace("<br />","<br>", $tmp);\r\nif ($edit) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_TEXT&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_TEXT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edittext.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Text / Standard', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('1', 'CMS_HTMLHEAD', '/**\r\n * CMS_HTMLHEAD\r\n */ \r\n$tmp = $a_content[''CMS_HTMLHEAD''][$val];\r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''","''",$tmp); \r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\ncInclude("includes", "functions.lang.php"); \r\n\r\nif ($edit) {\r\n if ($tmp == "") { \r\n $tmp = "&nbsp;"; \r\n } \r\n $insiteEditingDIV = new cHTMLDiv; \r\n $insiteEditingDIV->setId("HTMLHEAD_".$db->f("idtype")."_".$val);\r\n $insiteEditingDIV->setEvent("Focus", "this.style.border=''1px solid #bb5577'';"); \r\n $insiteEditingDIV->setEvent("Blur", "this.style.border=''1px dashed #bfbfbf'';"); \r\n $insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf"); \r\n $insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang)); \r\n \r\n $insiteEditingDIV->updateAttributes(array("contentEditable" => "true")); \r\n \r\n $insiteEditingDIV->setContent("_REPLACEMENT_"); \r\n \r\n\r\n /* Edit anchor and image */ \r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLHEAD&typenr=$val");\r\n $editAnchor = new cHTMLLink; \r\n $editAnchor->setClass(''CMS_HTMLHEAD_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''" . $editLink . "'');"); \r\n \r\n $editButton = new cHTMLImage; \r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithead.gif");\r\n $editButton->setBorder(0); \r\n $editButton->setStyleDefinition("margin-right", "2px"); \r\n \r\n $editAnchor->setContent($editButton); \r\n \r\n \r\n /* Save anchor and image */ \r\n $saveAnchor = new cHTMLLink; \r\n $saveAnchor->setClass(''CMS_HTMLHEAD_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $saveAnchor->setLink("javascript:setcontent(''$idartlang'',''0'')"); \r\n \r\n $saveButton = new cHTMLImage; \r\n $saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif"); \r\n $saveButton->setBorder(0); \r\n \r\n $saveAnchor->setContent($saveButton); \r\n\r\n /* Process for output with echo */ \r\n $finalEditButton = $editAnchor->render(); \r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton)); \r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton); \r\n \r\n $finalEditingDiv = $insiteEditingDIV->render(); \r\n $finalEditingDiv = AddSlashes(AddSlashes($finalEditingDiv)); \r\n $finalEditingDiv = str_replace("\\\\\\''","''",$finalEditingDiv); \r\n \r\n $finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv); \r\n \r\n $finalSaveButton = $saveAnchor->render(); \r\n $finalSaveButton = AddSlashes(AddSlashes($finalSaveButton)); \r\n $finalSaveButton = str_replace("\\\\\\''","''",$finalSaveButton); \r\n \r\n $tmp = $finalEditingDiv . $finalEditButton . $finalSaveButton;\r\n}', 'Headline / HTML', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('2', 'CMS_HTML', '/** \r\n * CMS_HTML \r\n */ \r\n$tmp = $a_content[''CMS_HTML''][$val]; \r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''","''",$tmp); \r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\ncInclude("includes", "functions.lang.php"); \r\n\r\nif ($edit) { \r\n if ($tmp == "") { \r\n $tmp = "&nbsp;"; \r\n } \r\n $insiteEditingDIV = new cHTMLDiv; \r\n $insiteEditingDIV->setId("HTML_".$db->f("idtype")."_".$val); \r\n $insiteEditingDIV->setEvent("Focus", "this.style.border=''1px solid #bb5577'';"); \r\n $insiteEditingDIV->setEvent("Blur", "this.style.border=''1px dashed #bfbfbf'';"); \r\n $insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf"); \r\n $insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang)); \r\n \r\n $insiteEditingDIV->updateAttributes(array("contentEditable" => "true")); \r\n \r\n $insiteEditingDIV->setContent("_REPLACEMENT_"); \r\n \r\n\r\n /* Edit anchor and image */ \r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTML&typenr=$val"); \r\n $editAnchor = new cHTMLLink; \r\n $editAnchor->setClass(''CMS_HTML_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''" . $editLink . "'');"); \r\n \r\n $editButton = new cHTMLImage; \r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithtml.gif"); \r\n $editButton->setBorder(0); \r\n $editButton->setStyleDefinition("margin-right", "2px"); \r\n \r\n $editAnchor->setContent($editButton); \r\n \r\n \r\n /* Save anchor and image */ \r\n $saveAnchor = new cHTMLLink; \r\n $saveAnchor->setClass(''CMS_HTML_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $saveAnchor->setLink("javascript:setcontent(''$idartlang'',''0'')"); \r\n \r\n $saveButton = new cHTMLImage; \r\n $saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif"); \r\n $saveButton->setBorder(0); \r\n \r\n $saveAnchor->setContent($saveButton); \r\n\r\n /* Process for output with echo */ \r\n $finalEditButton = $editAnchor->render(); \r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton)); \r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton); \r\n \r\n $finalEditingDiv = $insiteEditingDIV->render(); \r\n $finalEditingDiv = AddSlashes(AddSlashes($finalEditingDiv)); \r\n $finalEditingDiv = str_replace("\\\\\\''","''",$finalEditingDiv); \r\n \r\n $finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv); \r\n \r\n $finalSaveButton = $saveAnchor->render(); \r\n $finalSaveButton = AddSlashes(AddSlashes($finalSaveButton)); \r\n $finalSaveButton = str_replace("\\\\\\''","''",$finalSaveButton); \r\n \r\n $tmp = $finalEditingDiv . $finalEditButton . $finalSaveButton;\r\n}', 'Text / HTML', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('5', 'CMS_IMGDESCR', '/**\r\n * CMS_IMGDESCR\r\n */\r\n$tmp = $a_content["CMS_IMGDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlentities($tmp,ENT_QUOTES);\r\n\r\n\r\nif (!empty($edit)) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_IMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_IMGDESCR_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Description', '0', '', '2002-05-13 19:04:28', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('3', 'CMS_TEXT', '/**\r\n * CMS_TEXT\r\n */\r\ncInclude("includes", "functions.lang.php");\r\n\r\n$tmp = $a_content["CMS_TEXT"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = nl2br($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp);\r\n\r\n$tmp = str_replace("<br />","<br>", $tmp);\r\nif (!empty($edit)) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_TEXT&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_TEXT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edittext.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Text / Standard', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('1', 'CMS_HTMLHEAD', '/**\r\n * CMS_HTMLHEAD\r\n */ \r\n$tmp = $a_content[''CMS_HTMLHEAD''][$val];\r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''","''",$tmp); \r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\ncInclude("includes", "functions.lang.php"); \r\n\r\nif (!empty($edit)) {\r\n if ($tmp == "") { \r\n $tmp = "&nbsp;"; \r\n } \r\n $insiteEditingDIV = new cHTMLDiv; \r\n $insiteEditingDIV->setId("HTMLHEAD_".$db->f("idtype")."_".$val);\r\n $insiteEditingDIV->setEvent("Focus", "this.style.border=''1px solid #bb5577'';"); \r\n $insiteEditingDIV->setEvent("Blur", "this.style.border=''1px dashed #bfbfbf'';"); \r\n $insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf"); \r\n $insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang)); \r\n \r\n $insiteEditingDIV->updateAttributes(array("contentEditable" => "true")); \r\n \r\n $insiteEditingDIV->setContent("_REPLACEMENT_"); \r\n \r\n\r\n /* Edit anchor and image */ \r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLHEAD&typenr=$val");\r\n $editAnchor = new cHTMLLink; \r\n $editAnchor->setClass(''CMS_HTMLHEAD_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''" . $editLink . "'');"); \r\n \r\n $editButton = new cHTMLImage; \r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithead.gif");\r\n $editButton->setBorder(0); \r\n $editButton->setStyleDefinition("margin-right", "2px"); \r\n \r\n $editAnchor->setContent($editButton); \r\n \r\n \r\n /* Save anchor and image */ \r\n $saveAnchor = new cHTMLLink; \r\n $saveAnchor->setClass(''CMS_HTMLHEAD_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $saveAnchor->setLink("javascript:setcontent(''$idartlang'',''0'')"); \r\n \r\n $saveButton = new cHTMLImage; \r\n $saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif"); \r\n $saveButton->setBorder(0); \r\n \r\n $saveAnchor->setContent($saveButton); \r\n\r\n /* Process for output with echo */ \r\n $finalEditButton = $editAnchor->render(); \r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton)); \r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton); \r\n \r\n $finalEditingDiv = $insiteEditingDIV->render(); \r\n $finalEditingDiv = AddSlashes(AddSlashes($finalEditingDiv)); \r\n $finalEditingDiv = str_replace("\\\\\\''","''",$finalEditingDiv); \r\n \r\n $finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv); \r\n \r\n $finalSaveButton = $saveAnchor->render(); \r\n $finalSaveButton = AddSlashes(AddSlashes($finalSaveButton)); \r\n $finalSaveButton = str_replace("\\\\\\''","''",$finalSaveButton); \r\n \r\n $tmp = $finalEditingDiv . $finalEditButton . $finalSaveButton;\r\n}', 'Headline / HTML', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('2', 'CMS_HTML', '/** \r\n * CMS_HTML \r\n */ \r\n$tmp = $a_content[''CMS_HTML''][$val]; \r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''","''",$tmp); \r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\ncInclude("includes", "functions.lang.php"); \r\n\r\nif (!empty($edit)) { \r\n if ($tmp == "") { \r\n $tmp = "&nbsp;"; \r\n } \r\n $insiteEditingDIV = new cHTMLDiv; \r\n $insiteEditingDIV->setId("HTML_".$db->f("idtype")."_".$val); \r\n $insiteEditingDIV->setEvent("Focus", "this.style.border=''1px solid #bb5577'';"); \r\n $insiteEditingDIV->setEvent("Blur", "this.style.border=''1px dashed #bfbfbf'';"); \r\n $insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf"); \r\n $insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang)); \r\n \r\n $insiteEditingDIV->updateAttributes(array("contentEditable" => "true")); \r\n \r\n $insiteEditingDIV->setContent("_REPLACEMENT_"); \r\n \r\n\r\n /* Edit anchor and image */ \r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTML&typenr=$val"); \r\n $editAnchor = new cHTMLLink; \r\n $editAnchor->setClass(''CMS_HTML_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''" . $editLink . "'');"); \r\n \r\n $editButton = new cHTMLImage; \r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithtml.gif"); \r\n $editButton->setBorder(0); \r\n $editButton->setStyleDefinition("margin-right", "2px"); \r\n \r\n $editAnchor->setContent($editButton); \r\n \r\n \r\n /* Save anchor and image */ \r\n $saveAnchor = new cHTMLLink; \r\n $saveAnchor->setClass(''CMS_HTML_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $saveAnchor->setLink("javascript:setcontent(''$idartlang'',''0'')"); \r\n \r\n $saveButton = new cHTMLImage; \r\n $saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif"); \r\n $saveButton->setBorder(0); \r\n \r\n $saveAnchor->setContent($saveButton); \r\n\r\n /* Process for output with echo */ \r\n $finalEditButton = $editAnchor->render(); \r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton)); \r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton); \r\n \r\n $finalEditingDiv = $insiteEditingDIV->render(); \r\n $finalEditingDiv = AddSlashes(AddSlashes($finalEditingDiv)); \r\n $finalEditingDiv = str_replace("\\\\\\''","''",$finalEditingDiv); \r\n \r\n $finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv); \r\n \r\n $finalSaveButton = $saveAnchor->render(); \r\n $finalSaveButton = AddSlashes(AddSlashes($finalSaveButton)); \r\n $finalSaveButton = str_replace("\\\\\\''","''",$finalSaveButton); \r\n \r\n $tmp = $finalEditingDiv . $finalEditButton . $finalSaveButton;\r\n}', 'Text / HTML', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58');

Datei anzeigen

@ -37,6 +37,6 @@ define('C_SETUP_STEPFILE', 'images/steps/s%d.png');
define('C_SETUP_STEPFILE_ACTIVE', 'images/steps/s%da.png');
define('C_SETUP_STEPWIDTH', 28);
define('C_SETUP_STEPHEIGHT', 28);
define('C_SETUP_MIN_PHP_VERSION', '7.2.0');
define('C_SETUP_MAX_PHP_VERSION', '8.0.3');
define('C_SETUP_VERSION', '2.1.3');
define('C_SETUP_MIN_PHP_VERSION', '7.4.0');
define('C_SETUP_MAX_PHP_VERSION', '8.2.0');
define('C_SETUP_VERSION', '2.2.0 beta');

Datei anzeigen

@ -33,9 +33,10 @@ ini_set("error_log", "../data/logs/setup_errorlog.txt");
header('Content-Type: text/html; charset=UTF-8');
// Check php version
if (version_compare(PHP_VERSION, C_SETUP_MIN_PHP_VERSION, '<')
|| version_compare(PHP_VERSION, C_SETUP_MAX_PHP_VERSION, '>')) {
if (version_compare(PHP_VERSION, C_SETUP_MIN_PHP_VERSION, '<')) {
die("You need PHP >= " . C_SETUP_MIN_PHP_VERSION . " to install ConLite " . C_SETUP_VERSION . ". Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
} else if (version_compare(PHP_VERSION, C_SETUP_MAX_PHP_VERSION, '>=')) {
die("You need PHP < " . C_SETUP_MAX_PHP_VERSION . " to install ConLite " . C_SETUP_VERSION . ". Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
}

Datei anzeigen

@ -31,6 +31,8 @@ if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
//print_r($_SESSION);
class cSetupSetupSummary extends cSetupMask {
public function __construct($step, $previous, $next) {