remove deprecated docs folder
10
cms/templates/cl_flex_slider.html
Normale Datei
|
@ -0,0 +1,10 @@
|
|||
<div class="flexslider">
|
||||
<ul class="slides">
|
||||
<!-- BEGIN:BLOCK -->
|
||||
<li>
|
||||
<img src="{IMG}" alt="" />
|
||||
<p class="flex-caption">{IMG_CAPTION}</p>
|
||||
</li>
|
||||
<!-- END:BLOCK -->
|
||||
</ul>
|
||||
</div>
|
Vorher Breite: | Höhe: | Größe: 146 KiB Nachher Breite: | Höhe: | Größe: 146 KiB |
Vorher Breite: | Höhe: | Größe: 126 KiB Nachher Breite: | Höhe: | Größe: 126 KiB |
Vorher Breite: | Höhe: | Größe: 126 KiB Nachher Breite: | Höhe: | Größe: 126 KiB |
Vorher Breite: | Höhe: | Größe: 53 KiB Nachher Breite: | Höhe: | Größe: 53 KiB |
|
@ -213,7 +213,7 @@ class clDbBackup {
|
|||
if (!isset($rows[$column])) {
|
||||
$values[] = 'NULL';
|
||||
} else if ($rows[$column] != '') {
|
||||
$values[] = '\'' . mysql_escape_string($rows[$column]) . '\'';
|
||||
$values[] = '\'' . $this->_oDb->escape($rows[$column]) . '\'';
|
||||
} else {
|
||||
$values[] = '\'\'';
|
||||
}
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
* Description:
|
||||
* Validates the HTML
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend classes
|
||||
* @version 1.6.1
|
||||
* @author unknown
|
||||
|
@ -19,13 +15,8 @@
|
|||
* @link http://www.contenido.org
|
||||
* @since file available since contenido release <= 4.6
|
||||
*
|
||||
* {@internal
|
||||
* created unknown
|
||||
* modified 2008-07-02, Frederic Schneider, add security fix
|
||||
*
|
||||
* $Id: class.htmlvalidator.php 312 2014-06-18 11:01:08Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if(!defined('CON_FRAMEWORK')) {
|
||||
|
@ -60,6 +51,9 @@ class cHTMLValidator
|
|||
// remove all php code from layout
|
||||
$resultingHTML = preg_replace('/<\?(php)?((.)|(\s))*?\?>/i', '', $html);
|
||||
|
||||
// remove comments
|
||||
$resultingHTML = preg_replace('/<\!--((.)|(\s))*?-->/i', '', $resultingHTML);
|
||||
|
||||
/* We respect only \n, but we need to take care of windows (\n\r) and other systems (\r) */
|
||||
$resultingHTML = str_replace("\r\n", "\n", $resultingHTML);
|
||||
$resultingHTML = str_replace("\r", "\n", $resultingHTML);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
|
@ -31,12 +32,10 @@
|
|||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function reduces long path names and creates a dynamic tooltipp which shows
|
||||
* the full path name on mouseover
|
||||
|
@ -84,8 +83,7 @@ function uplDirectoryListRecursive ($currentdir, $startdir=NULL, $files=array(),
|
|||
|
||||
$unsorted_files = array();
|
||||
|
||||
if (chdir ($currentdir) == false)
|
||||
{
|
||||
if (chdir($currentdir) == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -101,10 +99,12 @@ function uplDirectoryListRecursive ($currentdir, $startdir=NULL, $files=array(),
|
|||
if (is_dir($file)) {
|
||||
$unsorted_files[] = $file;
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_array($unsorted_files)) sort($unsorted_files);
|
||||
if (is_array($unsorted_files))
|
||||
sort($unsorted_files);
|
||||
$sorted_files = $unsorted_files;
|
||||
|
||||
if (is_array($sorted_files)) {
|
||||
|
@ -115,7 +115,8 @@ function uplDirectoryListRecursive ($currentdir, $startdir=NULL, $files=array(),
|
|||
(opendir(getcwd() . "/" . $file) !== false)) {
|
||||
$a_file['name'] = $file;
|
||||
$a_file['depth'] = $depth;
|
||||
$a_file['pathstring'] = $pathstring.$file.'/';;
|
||||
$a_file['pathstring'] = $pathstring . $file . '/';
|
||||
;
|
||||
|
||||
$files[] = $a_file;
|
||||
// If $file is a directory take a look inside
|
||||
|
@ -173,7 +174,6 @@ function upldelete($path, $files) {
|
|||
$sql = "DELETE FROM " . $cfg["tab"]["upl"] . " WHERE idupl='" . Contenido_Security::toInteger($db->f("idupl")) . "'";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -187,8 +187,7 @@ function uplRecursiveRmDirIfEmpty($dir) {
|
|||
}
|
||||
$directory = @opendir($dir);
|
||||
|
||||
if (!$directory)
|
||||
{
|
||||
if (!$directory) {
|
||||
return false;
|
||||
}
|
||||
readdir($directory);
|
||||
|
@ -211,8 +210,7 @@ function uplRecursiveRmDirIfEmpty($dir) {
|
|||
}
|
||||
}
|
||||
|
||||
function uplHasFiles($dir)
|
||||
{
|
||||
function uplHasFiles($dir) {
|
||||
global $client, $cfgClient;
|
||||
|
||||
$directory = @opendir($cfgClient[$client]["upl"]["path"] . $dir);
|
||||
|
@ -233,14 +231,12 @@ function uplHasFiles($dir)
|
|||
return false;
|
||||
}
|
||||
|
||||
function uplHasSubdirs($dir)
|
||||
{
|
||||
function uplHasSubdirs($dir) {
|
||||
global $client, $cfgClient;
|
||||
|
||||
$directory = @opendir($cfgClient[$client]["upl"]["path"] . $dir);
|
||||
|
||||
if (!$directory)
|
||||
{
|
||||
if (!$directory) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -249,10 +245,8 @@ function uplHasSubdirs($dir)
|
|||
$ret = false;
|
||||
|
||||
while (false !== ($dir_entry = readdir($directory))) {
|
||||
if ($dir_entry != "." && $dir_entry != "..")
|
||||
{
|
||||
if (is_dir($cfgClient[$client]["upl"]["path"].$dir.$dir_entry))
|
||||
{
|
||||
if ($dir_entry != "." && $dir_entry != "..") {
|
||||
if (is_dir($cfgClient[$client]["upl"]["path"] . $dir . $dir_entry)) {
|
||||
closedir($directory);
|
||||
return true;
|
||||
}
|
||||
|
@ -262,19 +256,16 @@ function uplHasSubdirs($dir)
|
|||
return ($ret);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uplSyncDirectory ($path)
|
||||
* Sync database contents with directory
|
||||
*
|
||||
* @param string $path Specifies the path to scan
|
||||
*/
|
||||
function uplSyncDirectory ($path)
|
||||
{
|
||||
function uplSyncDirectory($path) {
|
||||
global $cfgClient, $client, $cfg, $db;
|
||||
|
||||
if (is_dbfs($path))
|
||||
{
|
||||
if (is_dbfs($path)) {
|
||||
return uplSyncDirectoryDBFS($path);
|
||||
}
|
||||
|
||||
|
@ -290,14 +281,11 @@ function uplSyncDirectory ($path)
|
|||
$dirhandle = @opendir($dir);
|
||||
|
||||
/* Whoops, probably failed to open. Return to the caller, but clean up stuff first. */
|
||||
if (!$dirhandle)
|
||||
{
|
||||
if (!$dirhandle) {
|
||||
$uploads->select("dirname = '$path' AND idclient = '$client'");
|
||||
|
||||
while ($upload = $uploads->next())
|
||||
{
|
||||
if (!file_exists($cfgClient[$client]["upl"]["path"].$upload->get("dirname").$upload->get("filename")))
|
||||
{
|
||||
while ($upload = $uploads->next()) {
|
||||
if (!file_exists($cfgClient[$client]["upl"]["path"] . $upload->get("dirname") . $upload->get("filename"))) {
|
||||
$uploads->delete($upload->get("idupl"));
|
||||
}
|
||||
}
|
||||
|
@ -306,10 +294,8 @@ function uplSyncDirectory ($path)
|
|||
// So, we have to exclude dbfs-files, as they "don't exist" (-> file_exists)
|
||||
$properties->select("idclient = '$client' AND itemtype='upload' AND type='file' AND itemid LIKE '" . $path . "%' AND itemid NOT LIKE 'dbfs%'");
|
||||
|
||||
while ($property = $properties->next())
|
||||
{
|
||||
if (!file_exists($cfgClient[$client]["upl"]["path"].$property->get("itemid")))
|
||||
{
|
||||
while ($property = $properties->next()) {
|
||||
if (!file_exists($cfgClient[$client]["upl"]["path"] . $property->get("itemid"))) {
|
||||
$properties->delete($property->get("idproperty"));
|
||||
}
|
||||
}
|
||||
|
@ -319,12 +305,9 @@ function uplSyncDirectory ($path)
|
|||
}
|
||||
|
||||
/* Put all the files into the $files array */
|
||||
while ($file = readdir ($dirhandle))
|
||||
{
|
||||
if ($file != "." && $file != "..")
|
||||
{
|
||||
if (is_file($file))
|
||||
{
|
||||
while ($file = readdir($dirhandle)) {
|
||||
if ($file != "." && $file != "..") {
|
||||
if (is_file($file)) {
|
||||
$uploads->sync($path, $file);
|
||||
}
|
||||
}
|
||||
|
@ -332,10 +315,8 @@ function uplSyncDirectory ($path)
|
|||
|
||||
$uploads->select("dirname = '$path' AND idclient = '$client'");
|
||||
|
||||
while ($upload = $uploads->next())
|
||||
{
|
||||
if (!file_exists($cfgClient[$client]["upl"]["path"].$upload->get("dirname").$upload->get("filename")))
|
||||
{
|
||||
while ($upload = $uploads->next()) {
|
||||
if (!file_exists($cfgClient[$client]["upl"]["path"] . $upload->get("dirname") . $upload->get("filename"))) {
|
||||
$uploads->delete($upload->get("idupl"));
|
||||
}
|
||||
}
|
||||
|
@ -344,10 +325,8 @@ function uplSyncDirectory ($path)
|
|||
// So, we have to exclude dbfs-files, as they "don't exist" (-> file_exists)
|
||||
$properties->select("idclient = '$client' AND itemtype='upload' AND type='file' AND itemid LIKE '" . $path . "%' AND itemid NOT LIKE 'dbfs%'");
|
||||
|
||||
while ($property = $properties->next())
|
||||
{
|
||||
if (!file_exists($cfgClient[$client]["upl"]["path"].$property->get("itemid")))
|
||||
{
|
||||
while ($property = $properties->next()) {
|
||||
if (!file_exists($cfgClient[$client]["upl"]["path"] . $property->get("itemid"))) {
|
||||
$properties->delete($property->get("idproperty"));
|
||||
}
|
||||
}
|
||||
|
@ -361,24 +340,20 @@ function uplSyncDirectory ($path)
|
|||
*
|
||||
* @param string $path Specifies the path to scan
|
||||
*/
|
||||
function uplSyncDirectoryDBFS ($path)
|
||||
{
|
||||
function uplSyncDirectoryDBFS($path) {
|
||||
global $cfgClient, $client, $cfg, $db;
|
||||
|
||||
$uploads = new UploadCollection;
|
||||
$properties = new PropertyCollection;
|
||||
$dbfs = new DBFSCollection;
|
||||
|
||||
if ($dbfs->dir_exists($path))
|
||||
{
|
||||
if ($dbfs->dir_exists($path)) {
|
||||
$strippath = $dbfs->strip_path($path);
|
||||
|
||||
$dbfs->select("dirname = '$strippath'");
|
||||
|
||||
while ($file = $dbfs->next())
|
||||
{
|
||||
if ($file->get("filename") != ".")
|
||||
{
|
||||
while ($file = $dbfs->next()) {
|
||||
if ($file->get("filename") != ".") {
|
||||
$uploads->sync($path . "/", $file->get("filename"));
|
||||
}
|
||||
}
|
||||
|
@ -386,20 +361,16 @@ function uplSyncDirectoryDBFS ($path)
|
|||
|
||||
$uploads->select("dirname = '$path/' AND idclient = '$client'");
|
||||
|
||||
while ($upload = $uploads->next())
|
||||
{
|
||||
if (!$dbfs->file_exists($upload->get("dirname").$upload->get("filename")))
|
||||
{
|
||||
while ($upload = $uploads->next()) {
|
||||
if (!$dbfs->file_exists($upload->get("dirname") . $upload->get("filename"))) {
|
||||
$uploads->delete($upload->get("idupl"));
|
||||
}
|
||||
}
|
||||
|
||||
$properties->select("idclient = '$client' AND itemtype='upload' AND type='file' AND itemid LIKE '" . $path . "%'");
|
||||
|
||||
while ($property = $properties->next())
|
||||
{
|
||||
if (!$dbfs->file_exists($property->get("itemid")))
|
||||
{
|
||||
while ($property = $properties->next()) {
|
||||
if (!$dbfs->file_exists($property->get("itemid"))) {
|
||||
$properties->delete($property->get("idproperty"));
|
||||
}
|
||||
}
|
||||
|
@ -407,13 +378,11 @@ function uplSyncDirectoryDBFS ($path)
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
function uplmkdir($path, $name) {
|
||||
|
||||
global $cfgClient, $client, $action;
|
||||
|
||||
if (is_dbfs($path))
|
||||
{
|
||||
if (is_dbfs($path)) {
|
||||
$path = str_replace("dbfs:", "", $path);
|
||||
|
||||
$fullpath = $path . "/" . $name . "/.";
|
||||
|
@ -435,8 +404,7 @@ function uplmkdir($path,$name) {
|
|||
}
|
||||
}
|
||||
|
||||
function uplRenameDirectory ($oldpath, $newpath, $parent)
|
||||
{
|
||||
function uplRenameDirectory($oldpath, $newpath, $parent) {
|
||||
global $cfgClient, $client, $cfg, $db;
|
||||
|
||||
$db2 = new DB_ConLite;
|
||||
|
@ -448,8 +416,7 @@ function uplRenameDirectory ($oldpath, $newpath, $parent)
|
|||
$sql = "SELECT dirname, idupl FROM " . $cfg["tab"]["upl"] . " WHERE idclient='" . Contenido_Security::toInteger($client) . "' AND dirname LIKE '" . Contenido_Security::escapeDB($parent, $db) . Contenido_Security::escapeDB($oldpath, $db) . "%'";
|
||||
$db->query($sql);
|
||||
|
||||
while ($db->next_record())
|
||||
{
|
||||
while ($db->next_record()) {
|
||||
$moldpath = $db->f("dirname");
|
||||
$junk = substr($moldpath, strlen($parent) + strlen($oldpath));
|
||||
|
||||
|
@ -458,14 +425,12 @@ function uplRenameDirectory ($oldpath, $newpath, $parent)
|
|||
$idupl = $db->f("idupl");
|
||||
$sql = "UPDATE " . $cfg["tab"]["upl"] . " SET dirname='" . Contenido_Security::escapeDB($newpath2, $db) . "' WHERE idupl = '" . Contenido_Security::toInteger($idupl) . "'";
|
||||
$db2->query($sql);
|
||||
|
||||
}
|
||||
|
||||
$sql = "SELECT itemid, idproperty FROM " . $cfg["tab"]["properties"] . " WHERE itemid LIKE '" . Contenido_Security::escapeDB($parent, $db) . Contenido_Security::escapeDB($oldpath, $db) . "%'";
|
||||
$db->query($sql);
|
||||
|
||||
while ($db->next_record())
|
||||
{
|
||||
while ($db->next_record()) {
|
||||
$moldpath = $db->f("itemid");
|
||||
$junk = substr($moldpath, strlen($parent) + strlen($oldpath));
|
||||
|
||||
|
@ -474,30 +439,22 @@ function uplRenameDirectory ($oldpath, $newpath, $parent)
|
|||
$sql = "UPDATE " . $cfg["tab"]["properties"] . " SET itemid = '$newpath2' WHERE idproperty='$idproperty'";
|
||||
$db2->query($sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function uplRecursiveDirectoryList ($directory, &$rootitem, $level, $sParent = '', $iRenameLevel = null)
|
||||
{
|
||||
function uplRecursiveDirectoryList($directory, &$rootitem, $level, $sParent = '', $iRenameLevel = null) {
|
||||
$dirhandle = @opendir($directory);
|
||||
|
||||
if (!$dirhandle)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$dirhandle) {
|
||||
|
||||
} else {
|
||||
$aInvalidDirectories = array();
|
||||
|
||||
unset($files);
|
||||
|
||||
//list the files in the dir
|
||||
while ($file = readdir ($dirhandle))
|
||||
{
|
||||
if ($file != "." && $file != "..")
|
||||
{
|
||||
if (@chdir($directory.$file."/"))
|
||||
{
|
||||
while ($file = readdir($dirhandle)) {
|
||||
if ($file != "." && $file != "..") {
|
||||
if (@chdir($directory . $file . "/")) {
|
||||
if (uplCreateFriendlyName($file) == $file) {
|
||||
$files[] = $file;
|
||||
} else {
|
||||
|
@ -517,23 +474,18 @@ function uplRecursiveDirectoryList ($directory, &$rootitem, $level, $sParent = '
|
|||
}
|
||||
}
|
||||
|
||||
if (is_array($files))
|
||||
{
|
||||
if (is_array($files)) {
|
||||
sort($files);
|
||||
foreach ($files as $key => $file)
|
||||
{
|
||||
foreach ($files as $key => $file) {
|
||||
/* We aren't using is_dir anymore as that function is buggy */
|
||||
$olddir = getcwd();
|
||||
if ($file != "." && $file != "..")
|
||||
{
|
||||
if (@chdir($directory.$file."/"))
|
||||
{
|
||||
if ($file != "." && $file != "..") {
|
||||
if (@chdir($directory . $file . "/")) {
|
||||
unset($item);
|
||||
$item = new TreeItem($file, $directory . $file . "/", true);
|
||||
$item->custom["level"] = $level;
|
||||
|
||||
if ($key == count($files)-1)
|
||||
{
|
||||
if ($key == count($files) - 1) {
|
||||
$item->custom["lastitem"] = true;
|
||||
} else {
|
||||
$item->custom["lastitem"] = false;
|
||||
|
@ -557,39 +509,32 @@ function uplRecursiveDirectoryList ($directory, &$rootitem, $level, $sParent = '
|
|||
return $aInvalidDirectories;
|
||||
}
|
||||
|
||||
|
||||
function uplRecursiveDBDirectoryList ($directory, &$rootitem, $level)
|
||||
{
|
||||
function uplRecursiveDBDirectoryList($directory, &$rootitem, $level) {
|
||||
$dbfs = new DBFSCollection;
|
||||
$dbfs->select("filename = '.'", "dirname", "dirname ASC");
|
||||
$count = 0;
|
||||
$lastlevel = 0;
|
||||
$item["."] = &$rootitem;
|
||||
|
||||
while ($dbitem = $dbfs->next())
|
||||
{
|
||||
while ($dbitem = $dbfs->next()) {
|
||||
$dirname = $dbitem->get("dirname");
|
||||
$level = substr_count($dirname, "/") + 2;
|
||||
$file = basename($dbitem->get("dirname"));
|
||||
$parent = dirname($dbitem->get("dirname"));
|
||||
|
||||
if ($dirname != "." && $file != ".")
|
||||
{
|
||||
if ($dirname != "." && $file != ".") {
|
||||
$item[$dirname] = new TreeItem($file, "dbfs:/" . $dirname, true);
|
||||
$item[$dirname]->custom["level"] = $level;
|
||||
$item[$dirname]->custom["parent"] = $parent;
|
||||
$item[$dirname]->custom["lastitem"] = true;
|
||||
|
||||
if ($prevobj[$level]->custom["level"] == $level)
|
||||
{
|
||||
if (is_object($prevobj[$level]))
|
||||
{
|
||||
if ($prevobj[$level]->custom["level"] == $level) {
|
||||
if (is_object($prevobj[$level])) {
|
||||
$prevobj[$level]->custom["lastitem"] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastlevel > $level)
|
||||
{
|
||||
if ($lastlevel > $level) {
|
||||
unset($prevobj[$lastlevel]);
|
||||
$lprevobj->custom["lastitem"] = true;
|
||||
}
|
||||
|
@ -599,8 +544,7 @@ function uplRecursiveDBDirectoryList ($directory, &$rootitem, $level)
|
|||
|
||||
$lastlevel = $level;
|
||||
|
||||
if (is_object($item[$parent]))
|
||||
{
|
||||
if (is_object($item[$parent])) {
|
||||
$item[$parent]->addItem($item[$dirname]);
|
||||
}
|
||||
|
||||
|
@ -609,18 +553,14 @@ function uplRecursiveDBDirectoryList ($directory, &$rootitem, $level)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function uplGetThumbnail ($file, $maxsize)
|
||||
{
|
||||
function uplGetThumbnail($file, $maxsize) {
|
||||
global $client, $cfgClient, $cfg;
|
||||
|
||||
if ($maxsize == -1)
|
||||
{
|
||||
if ($maxsize == -1) {
|
||||
return uplGetFileIcon($file);
|
||||
}
|
||||
|
||||
switch (getFileExtension($file))
|
||||
{
|
||||
switch (getFileExtension($file)) {
|
||||
case "png":
|
||||
case "gif":
|
||||
case "tiff":
|
||||
|
@ -634,13 +574,11 @@ function uplGetThumbnail ($file, $maxsize)
|
|||
case "wbmp":
|
||||
$img = capiImgScale($cfgClient[$client]["upl"]["path"] . $file, $maxsize, $maxsize, false, false, 50);
|
||||
|
||||
if ($img !== false)
|
||||
{
|
||||
if ($img !== false) {
|
||||
return $img;
|
||||
} else {
|
||||
$value = capiImgScale($cfg["path"]["contenido"] . "images/unknown.jpg", $maxsize, $maxsize, false, false, 50);
|
||||
if ($value !== false)
|
||||
{
|
||||
if ($value !== false) {
|
||||
return $value;
|
||||
} else {
|
||||
return uplGetFileIcon($file);
|
||||
|
@ -649,8 +587,6 @@ function uplGetThumbnail ($file, $maxsize)
|
|||
break;
|
||||
default:
|
||||
return uplGetFileIcon($file);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -662,8 +598,7 @@ function uplGetThumbnail ($file, $maxsize)
|
|||
* @return Icon for the file type
|
||||
*
|
||||
*/
|
||||
function uplGetFileIcon ($file)
|
||||
{
|
||||
function uplGetFileIcon($file) {
|
||||
global $cfg;
|
||||
|
||||
switch (getFileExtension($file)) {
|
||||
|
@ -772,7 +707,6 @@ function uplGetFileIcon ($file)
|
|||
return $cfg['path']['contenido_fullhtml'] . $cfg["path"]["images"] . "filetypes/" . $icon;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the description for a file type
|
||||
*
|
||||
|
@ -781,12 +715,10 @@ function uplGetFileIcon ($file)
|
|||
* @return Text for the file type
|
||||
*
|
||||
*/
|
||||
function uplGetFileTypeDescription ($extension)
|
||||
{
|
||||
function uplGetFileTypeDescription($extension) {
|
||||
global $cfg;
|
||||
|
||||
switch ($extension)
|
||||
{
|
||||
switch ($extension) {
|
||||
/* Presentation files */
|
||||
case "sxi": return (i18n("OpenOffice.org Presentation"));
|
||||
case "sti": return (i18n("OpenOffice.org Presentation Template"));
|
||||
|
@ -865,8 +797,7 @@ function uplGetFileTypeDescription ($extension)
|
|||
}
|
||||
}
|
||||
|
||||
function uplCreateFriendlyName ($filename, $spacer="_")
|
||||
{
|
||||
function uplCreateFriendlyName($filename, $spacer = "_") {
|
||||
global $cfg;
|
||||
|
||||
$newfilename = "";
|
||||
|
@ -877,19 +808,16 @@ function uplCreateFriendlyName ($filename, $spacer="_")
|
|||
$filename = str_replace(" ", $spacer, $filename);
|
||||
}
|
||||
|
||||
for ($i=0;$i<strlen($filename);$i++)
|
||||
{
|
||||
for ($i = 0; $i < strlen($filename); $i++) {
|
||||
$atom = substr($filename, $i, 1);
|
||||
$bFound = false;
|
||||
|
||||
if (preg_match("/[0-9a-zA-Z]/i", $atom ))
|
||||
{
|
||||
if (preg_match("/[0-9a-zA-Z]/i", $atom)) {
|
||||
$newfilename .= $atom;
|
||||
$bFound = true;
|
||||
}
|
||||
|
||||
if (($atom == "-" || $atom == "_" || $atom == ".") && !$bFound)
|
||||
{
|
||||
if (($atom == "-" || $atom == "_" || $atom == ".") && !$bFound) {
|
||||
$newfilename .= $atom;
|
||||
$bFound = true;
|
||||
}
|
||||
|
@ -905,8 +833,7 @@ function uplCreateFriendlyName ($filename, $spacer="_")
|
|||
return $newfilename;
|
||||
}
|
||||
|
||||
function uplSearch ($searchfor)
|
||||
{
|
||||
function uplSearch($searchfor) {
|
||||
global $client;
|
||||
|
||||
$properties = new PropertyCollection;
|
||||
|
@ -917,57 +844,51 @@ function uplSearch ($searchfor)
|
|||
/* Search for keywords first, ranking +5 */
|
||||
$properties->select("idclient='" . Contenido_Security::toInteger($client) . "' AND itemtype = 'upload' AND type='file' AND name='keywords' AND value LIKE '%" . Contenido_Security::escapeDB($mysearch, $db) . "%'", "itemid");
|
||||
|
||||
while ($item = $properties->next())
|
||||
{
|
||||
while ($item = $properties->next()) {
|
||||
$items[$item->get("itemid")] += (substr_count(strtolower($item->get("value")), strtolower($searchfor)) * 5);
|
||||
}
|
||||
|
||||
/* Search for medianame , ranking +4 */
|
||||
$properties->select("idclient='" . Contenido_Security::toInteger($client) . "' AND itemtype = 'upload' AND type='file' AND name='medianame' AND value LIKE '%" . Contenido_Security::escapeDB($mysearch, $db) . "%'", "itemid");
|
||||
|
||||
while ($item = $properties->next())
|
||||
{
|
||||
while ($item = $properties->next()) {
|
||||
$items[$item->get("itemid")] += (substr_count(strtolower($item->get("value")), strtolower($searchfor)) * 4);
|
||||
}
|
||||
|
||||
/* Search for media notes, ranking +3 */
|
||||
$properties->select("idclient='" . Contenido_Security::toInteger($client) . "' AND itemtype = 'upload' AND type='file' AND name='medianotes' AND value LIKE '%" . Contenido_Security::escapeDB($mysearch, $db) . "%'", "itemid");
|
||||
|
||||
while ($item = $properties->next())
|
||||
{
|
||||
while ($item = $properties->next()) {
|
||||
$items[$item->get("itemid")] += (substr_count(strtolower($item->get("value")), strtolower($searchfor)) * 3);
|
||||
}
|
||||
|
||||
/* Search for description, ranking +2 */
|
||||
$uploads->select("idclient='" . Contenido_Security::toInteger($client) . "' AND description LIKE '%" . Contenido_Security::escapeDB($mysearch, $db) . "%'", "idupl");
|
||||
|
||||
while ($item = $uploads->next())
|
||||
{
|
||||
while ($item = $uploads->next()) {
|
||||
$items[$item->get("dirname") . $item->get("filename")] += (substr_count(strtolower($item->get("description")), strtolower($searchfor)) * 2);
|
||||
}
|
||||
|
||||
/* Search for file name, ranking +1 */
|
||||
$uploads->select("idclient='" . Contenido_Security::toInteger($client) . "' AND filename LIKE '%" . Contenido_Security::escapeDB($mysearch, $db) . "%'", "idupl");
|
||||
|
||||
while ($item = $uploads->next())
|
||||
{
|
||||
while ($item = $uploads->next()) {
|
||||
$items[$item->get("dirname") . $item->get("filename")] += 1;
|
||||
}
|
||||
|
||||
return ($items);
|
||||
}
|
||||
|
||||
function uplGetFileExtension ($sFile)
|
||||
{
|
||||
function uplGetFileExtension($sFile) {
|
||||
/* Fetch the dot position */
|
||||
$iDotPosition = strrpos($sFile, ".");
|
||||
|
||||
$sExtension = substr($sFile, $iDotPosition + 1);
|
||||
if (strpos($sExtension, "/") !== false)
|
||||
{
|
||||
if (strpos($sExtension, "/") !== false) {
|
||||
return false;
|
||||
} else {
|
||||
return $sExtension;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -29,7 +29,6 @@ define('CL_BACKUP_START_IMG_OFF', $cfg['path']['contenido_html'] . $cfg['path'][
|
|||
$aMessage = array();
|
||||
$bNoBackup = false;
|
||||
$bFinalStep = false;
|
||||
echo CL_BACKUP_PATH;
|
||||
// check backup path
|
||||
if (!is_dir(CL_BACKUP_PATH) || !is_writable(CL_BACKUP_PATH)) {
|
||||
$notification->displayNotification("error", i18n("Backupfolder missing or not writable!"));
|
||||
|
|