git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7522 b9a71923-0436-4b27-9f14-aed3839534dd
No files matched your search
@@ -1,653 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
define('PS_ADMIN_DIR', getcwd());
|
||||
include(PS_ADMIN_DIR.'/../config/config.inc.php');
|
||||
/* Getting cookie or logout */
|
||||
require_once(dirname(__FILE__).'/init.php');
|
||||
|
||||
require_once(PS_ADMIN_DIR.'/tabs/AdminCounty.php');
|
||||
|
||||
if (isset($_GET['changeParentUrl']))
|
||||
echo '<script type="text/javascript">parent.parent.document.location.href = "'.addslashes(urldecode(Tools::getValue('changeParentUrl'))).'";</script>';
|
||||
if (isset($_GET['installBoughtModule']))
|
||||
{
|
||||
if (!class_exists('ZipArchive', false))
|
||||
die(displayJavascriptAlert('Host does not handle Zip files'));
|
||||
$zip = new ZipArchive();
|
||||
$file = false;
|
||||
while ($file === false OR file_exists(_PS_MODULE_DIR_.$file))
|
||||
$file = uniqid();
|
||||
$file = _PS_MODULE_DIR_.$file.'.zip';
|
||||
if (!copy('http://addons.prestashop.com/iframe/getboughtfile.php?id_order_detail='.Tools::getValue('id_order_detail').'&token='.Tools::getValue('token'), $file))
|
||||
die(displayJavascriptAlert('Cannot copy file'));
|
||||
$first6 = fread($fd = fopen($file, 'r'), 6);
|
||||
if (!strncmp($first6, 'Error:', 6))
|
||||
{
|
||||
fclose($fd);
|
||||
unlink($file);
|
||||
die(displayJavascriptAlert(fread($fd, 1024)));
|
||||
}
|
||||
fclose($fd);
|
||||
if ($zip->open($file) !== true OR !$zip->extractTo(_PS_MODULE_DIR_) OR !$zip->close())
|
||||
{
|
||||
unlink($file);
|
||||
die(displayJavascriptAlert('Cannot unzip file'));
|
||||
}
|
||||
unlink($file);
|
||||
die(displayJavascriptAlert('Module copied to disk'));
|
||||
}
|
||||
|
||||
function displayJavascriptAlert($s){echo '<script type="text/javascript">alert(\''.addslashes($s).'\');</script>';}
|
||||
|
||||
if (isset($_GET['ajaxProductManufacturers']))
|
||||
{
|
||||
$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
$manufacturers = Manufacturer::getManufacturers();
|
||||
if ($manufacturers)
|
||||
{
|
||||
$jsonArray = array();
|
||||
foreach ($manufacturers AS $manufacturer)
|
||||
$jsonArray[] = '{"optionValue": "'.$manufacturer['id_manufacturer'].'", "optionDisplay": "'.htmlspecialchars($manufacturer['name']).'"}';
|
||||
die('['.implode(',', $jsonArray).']');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['ajaxProductSuppliers']))
|
||||
{
|
||||
$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
$suppliers = Supplier::getSuppliers();
|
||||
if ($suppliers)
|
||||
{
|
||||
$jsonArray = array();
|
||||
foreach ($suppliers AS $supplier)
|
||||
$jsonArray[] = '{"optionValue": "'.$supplier['id_supplier'].'", "optionDisplay": "'.htmlspecialchars($supplier['name']).'"}';
|
||||
die('['.implode(',', $jsonArray).']');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['ajaxProductAccessories']))
|
||||
{
|
||||
$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
$jsonArray = array();
|
||||
|
||||
$products = Db::getInstance()->ExecuteS('
|
||||
SELECT p.`id_product`, pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
NATURAL LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
||||
WHERE pl.`id_lang` = '.(int)(Tools::getValue('id_lang')).'
|
||||
AND p.`id_product` != '.(int)(Tools::getValue('id_product')).'
|
||||
AND p.`id_product` NOT IN (
|
||||
SELECT a.`id_product_2`
|
||||
FROM `'._DB_PREFIX_.'accessory` a
|
||||
WHERE a.`id_product_1` = '.(int)(Tools::getValue('id_product')).')
|
||||
ORDER BY pl.`name`');
|
||||
|
||||
foreach ($products AS $accessory)
|
||||
$jsonArray[] = '{"value: "'.(int)($accessory['id_product']).'-'.addslashes($accessory['name']).'", "text":"'.(int)($accessory['id_product']).' - '.addslashes($accessory['name']).'"}';
|
||||
die('['.implode(',', $jsonArray).']');
|
||||
}
|
||||
|
||||
if (isset($_GET['ajaxDiscountCustomers']))
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
$currentIndex = 'index.php?tab=AdminDiscounts';
|
||||
$jsonArray = array();
|
||||
$filter = Tools::getValue('filter');
|
||||
|
||||
if (Validate::isBool_Id($filter))
|
||||
$filterArray = explode('_', $filter);
|
||||
|
||||
$customers = Db::getInstance()->ExecuteS('
|
||||
SELECT `id_customer`, `email`, CONCAT(`lastname`, \' \', `firstname`) as name
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `deleted` = 0 AND is_guest = 0
|
||||
AND '.(Validate::isUnsignedInt($filter) ? '`id_customer` = '.(int)($filter) : '(`email` LIKE "%'.pSQL($filter).'%"
|
||||
'.((Validate::isBool_Id($filter) AND $filterArray[0] == 0) ? 'OR `id_customer` = '.(int)($filterArray[1]) : '').'
|
||||
'.(Validate::isUnsignedInt($filter) ? '`id_customer` = '.(int)($filter) : '').'
|
||||
OR CONCAT(`firstname`, \' \', `lastname`) LIKE "%'.pSQL($filter).'%"
|
||||
OR CONCAT(`lastname`, \' \', `firstname`) LIKE "%'.pSQL($filter).'%")').'
|
||||
ORDER BY CONCAT(`lastname`, \' \', `firstname`) ASC
|
||||
LIMIT 50');
|
||||
|
||||
$groups = Db::getInstance()->ExecuteS('
|
||||
SELECT g.`id_group`, gl.`name`
|
||||
FROM `'._DB_PREFIX_.'group` g
|
||||
LEFT JOIN `'._DB_PREFIX_.'group_lang` AS gl ON (g.`id_group` = gl.`id_group` AND gl.`id_lang` = '.(int)($cookie->id_lang).')
|
||||
WHERE '.(Validate::isUnsignedInt($filter) ? 'g.`id_group` = '.(int)($filter) : 'gl.`name` LIKE "%'.pSQL($filter).'%"
|
||||
'.((Validate::isBool_Id($filter) AND $filterArray[0] == 1) ? 'OR g.`id_group` = '.(int)($filterArray[1]) : '')).'
|
||||
ORDER BY gl.`name` ASC
|
||||
LIMIT 50');
|
||||
|
||||
$json = '{"customers" : ';
|
||||
foreach ($customers AS $customer)
|
||||
$jsonArray[] = '{"value":"0_'.(int)($customer['id_customer']).'", "text":"'.addslashes($customer['name']).' ('.addslashes($customer['email']).')"}';
|
||||
$json .= '['.implode(',', $jsonArray).'],
|
||||
"groups" : ';
|
||||
$jsonArray = array();
|
||||
foreach ($groups AS $group)
|
||||
$jsonArray[] = '{"value":"1_'.(int)($group['id_group']).'", "text":"'.addslashes($group['name']).'"}';
|
||||
$json .= '['.implode(',', $jsonArray).']}';
|
||||
die($json);
|
||||
}
|
||||
|
||||
if (Tools::getValue('page') == 'prestastore' AND @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3))
|
||||
readfile('http://addons.prestashop.com/adminmodules.php?lang='.Language::getIsoById($cookie->id_lang));
|
||||
if (Tools::getValue('page') == 'themes' AND @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3))
|
||||
readfile('http://addons.prestashop.com/adminthemes.php?lang='.Language::getIsoById($cookie->id_lang));
|
||||
|
||||
if ($step = (int)(Tools::getValue('ajaxProductTab')))
|
||||
{
|
||||
require_once(dirname(__FILE__).'/tabs/AdminCatalog.php');
|
||||
$catalog = new AdminCatalog();
|
||||
$admin = new AdminProducts();
|
||||
|
||||
$languages = Language::getLanguages(false);
|
||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||
$product = new Product((int)(Tools::getValue('id_product')));
|
||||
if (!Validate::isLoadedObject($product))
|
||||
die (Tools::displayError('Product cannot be loaded'));
|
||||
|
||||
$switchArray = array(3 => 'displayFormPrices', 4 => 'displayFormAttributes', 5 => 'displayFormFeatures', 6 => 'displayFormCustomization', 7 => 'displayFormAttachments');
|
||||
$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
if (key_exists($step, $switchArray))
|
||||
$admin->{$switchArray[$step]}($product, $languages, $defaultLanguage);
|
||||
}
|
||||
|
||||
if (isset($_GET['getAvailableFields']) and isset($_GET['entity']))
|
||||
{
|
||||
$currentIndex = 'index.php?tab=AdminImport';
|
||||
$jsonArray = array();
|
||||
require_once(dirname(__FILE__).'/tabs/AdminImport.php');
|
||||
$import = new AdminImport();
|
||||
|
||||
$languages = Language::getLanguages(false);
|
||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||
$fields = $import->getAvailableFields(true);
|
||||
foreach ($fields AS $field)
|
||||
$jsonArray[] = '{"field":"'.addslashes($field).'"}';
|
||||
die('['.implode(',', $jsonArray).']');
|
||||
}
|
||||
|
||||
if (array_key_exists('ajaxModulesPositions', $_POST))
|
||||
{
|
||||
$id_module = (int)(Tools::getValue('id_module'));
|
||||
$id_hook = (int)(Tools::getValue('id_hook'));
|
||||
$way = (int)(Tools::getValue('way'));
|
||||
$positions = Tools::getValue(strval($id_hook));
|
||||
$position = (is_array($positions)) ? array_search($id_hook.'_'.$id_module, $positions) : null;
|
||||
$module = Module::getInstanceById($id_module);
|
||||
if (Validate::isLoadedObject($module))
|
||||
if ($module->updatePosition($id_hook, $way, $position))
|
||||
die(true);
|
||||
else
|
||||
die('{"hasError" : true, "errors" : "Can not update module position"}');
|
||||
else
|
||||
die('{"hasError" : true, "errors" : "This module can not be loaded"}');
|
||||
}
|
||||
|
||||
if (array_key_exists('ajaxCategoriesPositions', $_POST))
|
||||
{
|
||||
$id_category_to_move = (int)(Tools::getValue('id_category_to_move'));
|
||||
$id_category_parent = (int)(Tools::getValue('id_category_parent'));
|
||||
$way = (int)(Tools::getValue('way'));
|
||||
$positions = Tools::getValue('category');
|
||||
if (is_array($positions))
|
||||
foreach ($positions AS $key => $value)
|
||||
{
|
||||
$pos = explode('_', $value);
|
||||
if ((isset($pos[1]) AND isset($pos[2])) AND ($pos[1] == $id_category_parent AND $pos[2] == $id_category_to_move))
|
||||
{
|
||||
$position = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$category = new Category($id_category_to_move);
|
||||
if (Validate::isLoadedObject($category))
|
||||
{
|
||||
if (isset($position) && $category->updatePosition($way, $position))
|
||||
{
|
||||
Module::hookExec('categoryUpdate');
|
||||
die(true);
|
||||
}
|
||||
else
|
||||
die('{"hasError" : true, errors : "Can not update categories position"}');
|
||||
}
|
||||
else
|
||||
die('{"hasError" : true, "errors" : "This category can not be loaded"}');
|
||||
|
||||
}
|
||||
|
||||
if (array_key_exists('ajaxCMSCategoriesPositions', $_POST))
|
||||
{
|
||||
$id_cms_category_to_move = (int)(Tools::getValue('id_cms_category_to_move'));
|
||||
$id_cms_category_parent = (int)(Tools::getValue('id_cms_category_parent'));
|
||||
$way = (int)(Tools::getValue('way'));
|
||||
$positions = Tools::getValue('cms_category');
|
||||
if (is_array($positions))
|
||||
foreach ($positions AS $key => $value)
|
||||
{
|
||||
$pos = explode('_', $value);
|
||||
if ((isset($pos[1]) AND isset($pos[2])) AND ($pos[1] == $id_cms_category_parent AND $pos[2] == $id_cms_category_to_move))
|
||||
{
|
||||
$position = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$cms_category = new CMSCategory($id_cms_category_to_move);
|
||||
if (Validate::isLoadedObject($cms_category))
|
||||
{
|
||||
if (isset($position) && $cms_category->updatePosition($way, $position))
|
||||
die(true);
|
||||
else
|
||||
die('{"hasError" : true, "errors" : "Can not update cms categories position"}');
|
||||
}
|
||||
else
|
||||
die('{"hasError" : true, "errors" : "This cms category can not be loaded"}');
|
||||
}
|
||||
|
||||
if (array_key_exists('ajaxCMSPositions', $_POST))
|
||||
{
|
||||
$id_cms = (int)(Tools::getValue('id_cms'));
|
||||
$id_category = (int)(Tools::getValue('id_cms_category'));
|
||||
$way = (int)(Tools::getValue('way'));
|
||||
$positions = Tools::getValue('cms');
|
||||
if (is_array($positions))
|
||||
foreach ($positions AS $key => $value)
|
||||
{
|
||||
$pos = explode('_', $value);
|
||||
if ((isset($pos[1]) AND isset($pos[2])) AND ($pos[1] == $id_category AND $pos[2] == $id_cms))
|
||||
{
|
||||
$position = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$cms = new CMS($id_cms);
|
||||
if (Validate::isLoadedObject($cms))
|
||||
{
|
||||
if (isset($position) && $cms->updatePosition($way, $position))
|
||||
die(true);
|
||||
else
|
||||
die('{"hasError" : true, "errors" : "Can not update cms position"}');
|
||||
}
|
||||
else
|
||||
die('{"hasError" : true, "errors" : "This cms can not be loaded"}');
|
||||
}
|
||||
|
||||
/* Modify product position in catalog */
|
||||
if (array_key_exists('ajaxProductsPositions', $_POST))
|
||||
{
|
||||
$way = (int)(Tools::getValue('way'));
|
||||
$id_product = (int)(Tools::getValue('id_product'));
|
||||
$id_category = (int)(Tools::getValue('id_category'));
|
||||
$positions = Tools::getValue('product');
|
||||
|
||||
if (is_array($positions))
|
||||
foreach ($positions AS $position => $value)
|
||||
{
|
||||
// pos[1] = id_categ, pos[2] = id_product, pos[3]=old position
|
||||
$pos = explode('_', $value);
|
||||
|
||||
if ((isset($pos[1]) AND isset($pos[2])) AND ($pos[1] == $id_category AND (int)$pos[2] === $id_product))
|
||||
{
|
||||
if ($product = new Product((int)$pos[2]))
|
||||
if (isset($position) && $product->updatePosition($way, $position))
|
||||
echo "ok position $position for product $pos[2]\r\n";
|
||||
else
|
||||
echo '{"hasError" : true, "errors" : "Can not update product '. $id_product . ' to position '.$position.' "}';
|
||||
else
|
||||
echo '{"hasError" : true, "errors" : "This product ('.$id_product.') can t be loaded"}';
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['ajaxProductPackItems']))
|
||||
{
|
||||
$jsonArray = array();
|
||||
$products = Db::getInstance()->ExecuteS('
|
||||
SELECT p.`id_product`, pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
NATURAL LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
||||
WHERE pl.`id_lang` = '.(int)(Tools::getValue('id_lang')).'
|
||||
AND p.`id_product` NOT IN (SELECT DISTINCT id_product_pack FROM `'._DB_PREFIX_.'pack`)
|
||||
AND p.`id_product` != '.(int)(Tools::getValue('id_product')));
|
||||
|
||||
foreach ($products AS $packItem)
|
||||
$jsonArray[] = '{"value": "'.(int)($packItem['id_product']).'-'.addslashes($packItem['name']).'", "text":"'.(int)($packItem['id_product']).' - '.addslashes($packItem['name']).'"}';
|
||||
die('['.implode(',', $jsonArray).']');
|
||||
}
|
||||
|
||||
if (isset($_GET['ajaxStates']) AND isset($_GET['id_country']))
|
||||
{
|
||||
$states = Db::getInstance()->ExecuteS('
|
||||
SELECT s.id_state, s.name
|
||||
FROM '._DB_PREFIX_.'state s
|
||||
LEFT JOIN '._DB_PREFIX_.'country c ON (s.`id_country` = c.`id_country`)
|
||||
WHERE s.id_country = '.(int)(Tools::getValue('id_country')).' AND s.active = 1 AND c.`contains_states` = 1
|
||||
ORDER BY s.`name` ASC');
|
||||
|
||||
if (is_array($states) AND !empty($states))
|
||||
{
|
||||
$list = '';
|
||||
if (Tools::getValue('no_empty') != true)
|
||||
$list = '<option value="0">-----------</option>'."\n";
|
||||
|
||||
foreach ($states AS $state)
|
||||
$list .= '<option value="'.(int)($state['id_state']).'"'.((isset($_GET['id_state']) AND $_GET['id_state'] == $state['id_state']) ? ' selected="selected"' : '').'>'.$state['name'].'</option>'."\n";
|
||||
}
|
||||
else
|
||||
$list = 'false';
|
||||
|
||||
die($list);
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitCustomerNote') AND $id_customer = (int)Tools::getValue('id_customer'))
|
||||
{
|
||||
$note = html_entity_decode(Tools::getValue('note'));
|
||||
if (!empty($note) AND !Validate::isCleanHtml($note))
|
||||
die ('error:validation');
|
||||
if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET `note` = "'.pSQL($note, true).'" WHERE id_customer = '.(int)$id_customer.' LIMIT 1'))
|
||||
die ('error:update');
|
||||
die('ok');
|
||||
}
|
||||
|
||||
if (Tools::getValue('form_language_id'))
|
||||
{
|
||||
if (!($cookie->employee_form_lang = (int)(Tools::getValue('form_language_id'))))
|
||||
die ('Error while updating cookie.');
|
||||
die ('Form language updated.');
|
||||
}
|
||||
|
||||
if (Tools::getValue('submitPublishProduct'))
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
if (Tools::getIsset('id_product'))
|
||||
{
|
||||
$id_product = (int)(Tools::getValue('id_product'));
|
||||
$id_tab_catalog = (int)(Tab::getIdFromClassName('AdminCatalog'));
|
||||
$token = Tools::getAdminToken('AdminCatalog'.(int)($id_tab_catalog).(int)($cookie->id_employee));
|
||||
$bo_product_url = dirname($_SERVER['PHP_SELF']).'/index.php?tab=AdminCatalog&id_product='.$id_product.'&updateproduct&token='.$token;
|
||||
|
||||
if (Tools::getValue('redirect'))
|
||||
die($bo_product_url);
|
||||
|
||||
$profileAccess = Profile::getProfileAccess((int)($cookie->profile), $id_tab_catalog);
|
||||
if($profileAccess['edit'])
|
||||
{
|
||||
$product = new Product((int)(Tools::getValue('id_product')));
|
||||
if (!Validate::isLoadedObject($product))
|
||||
die('error: invalid id');
|
||||
|
||||
$product->active = 1;
|
||||
|
||||
if ($product->save())
|
||||
die($bo_product_url);
|
||||
else
|
||||
die('error: saving');
|
||||
|
||||
} else {
|
||||
die('error: permissions');
|
||||
}
|
||||
}
|
||||
else
|
||||
die ('error: parameters');
|
||||
}
|
||||
|
||||
if (Tools::getValue('submitPublishCMS'))
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
if (Tools::getIsset('id_cms'))
|
||||
{
|
||||
$id_cms = (int)(Tools::getValue('id_cms'));
|
||||
$id_tab_cms = (int)(Tab::getIdFromClassName('AdminCMSContent'));
|
||||
$token = Tools::getAdminToken('AdminCMSContent'.(int)($id_tab_cms).(int)($cookie->id_employee));
|
||||
$bo_cms_url = dirname($_SERVER['PHP_SELF']).'/index.php?tab=AdminCMSContent&id_cms='.(int)$id_cms.'&updatecms&token='.$token;
|
||||
|
||||
if (Tools::getValue('redirect'))
|
||||
die($bo_cms_url);
|
||||
|
||||
$profileAccess = Profile::getProfileAccess((int)($cookie->profile), $id_tab_cms);
|
||||
if($profileAccess['edit'])
|
||||
{
|
||||
$cms = new CMS((int)(Tools::getValue('id_cms')));
|
||||
if (!Validate::isLoadedObject($cms))
|
||||
die('error: invalid id');
|
||||
|
||||
$cms->active = 1;
|
||||
|
||||
if ($cms->save())
|
||||
die($bo_cms_url);
|
||||
else
|
||||
die('error: saving');
|
||||
|
||||
} else {
|
||||
die('error: permissions');
|
||||
}
|
||||
}
|
||||
else
|
||||
die ('error: parameters');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitTrackClickOnHelp'))
|
||||
{
|
||||
$label = Tools::getValue('label');
|
||||
$version = Tools::getValue('version');
|
||||
|
||||
if (!empty($label) && !empty($version))
|
||||
HelpAccess::trackClick($label, $version);
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('saveImportMatchs'))
|
||||
{
|
||||
$match = implode('|', Tools::getValue('type_value'));
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'import_match` (
|
||||
`id_import_match` ,
|
||||
`name` ,
|
||||
`match`,
|
||||
`skip`
|
||||
)
|
||||
VALUES (
|
||||
NULL ,
|
||||
\''.pSQL(Tools::getValue('newImportMatchs')).'\',
|
||||
\''.pSQL($match).'\',
|
||||
\''.pSQL(Tools::getValue('skip')).'\'
|
||||
)');
|
||||
|
||||
die('{"id" : "'.Db::getInstance()->Insert_ID().'"}');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('deleteImportMatchs'))
|
||||
{
|
||||
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'import_match` WHERE id_import_match = '.pSQL(Tools::getValue('idImportMatchs')));
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('loadImportMatchs'))
|
||||
{
|
||||
$return = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'import_match` WHERE id_import_match = '.pSQL(Tools::getValue('idImportMatchs')));
|
||||
die('{"id" : "'.$return[0]['id_import_match'].'", "matchs" : "'.$return[0]['match'].'", "skip" : "'.$return[0]['skip'].'"}');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('toggleScreencast'))
|
||||
{
|
||||
global $cookie;
|
||||
$cookie->show_screencast = (int)(!(bool)$cookie->show_screencast);
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('ajaxAddZipCode') OR Tools::isSubmit('ajaxRemoveZipCode'))
|
||||
{
|
||||
$zipcodes = Tools::getValue('zipcodes');
|
||||
$id_county = (int)Tools::getValue('id_county');
|
||||
|
||||
$county = new County($id_county);
|
||||
if (!Validate::isLoadedObject($county))
|
||||
die('error');
|
||||
|
||||
if (Tools::isSubmit('ajaxAddZipCode'))
|
||||
{
|
||||
if ($county->isZipCodeRangePresent($zipcodes))
|
||||
die('error:'.Tools::displayError('This Zip Code is already in use.'));
|
||||
if ($county->addZipCodes($zipcodes))
|
||||
die(AdminCounty::renderZipCodeList($county->getZipCodes()));
|
||||
}
|
||||
else if (Tools::isSubmit('ajaxRemoveZipCode') AND $county->removeZipCodes($zipcodes))
|
||||
die(AdminCounty::renderZipCodeList($county->getZipCodes()));
|
||||
|
||||
die('error');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('helpAccess'))
|
||||
{
|
||||
$item = Tools::getValue('item');
|
||||
$isoUser = Tools::getValue('isoUser');
|
||||
$country = Tools::getValue('country');
|
||||
$version = Tools::getValue('version');
|
||||
|
||||
if (isset($item) AND isset($isoUser) AND isset($country))
|
||||
die(HelpAccess::displayHelp($item, $isoUser, $country, $version));
|
||||
die();
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('getHookableList'))
|
||||
{
|
||||
$modules_list = explode(',', Tools::getValue('modules_list'));
|
||||
$hooks_list = explode(',', Tools::getValue('hooks_list'));
|
||||
$hookableList = array();
|
||||
|
||||
foreach ($modules_list as $module)
|
||||
{
|
||||
$moduleInstance = Module::getInstanceByName($module);
|
||||
foreach($hooks_list as $hook_name)
|
||||
{
|
||||
if (!array_key_exists($hook_name, $hookableList))
|
||||
$hookableList[$hook_name] = array();
|
||||
if ($moduleInstance->isHookableOn($hook_name))
|
||||
array_push($hookableList[$hook_name], $module);
|
||||
}
|
||||
|
||||
}
|
||||
die(Tools::jsonEncode($hookableList));
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('getHookableModuleList'))
|
||||
{
|
||||
|
||||
include('../init.php');
|
||||
$hook_name = Tools::getValue('hook');
|
||||
$hookableModulesList = array();
|
||||
$modules = Db::getInstance()->ExecuteS('SELECT id_module, name FROM `'._DB_PREFIX_.'module` ');
|
||||
foreach ($modules as $module)
|
||||
{
|
||||
if (file_exists(_PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php'))
|
||||
{
|
||||
include_once(_PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php');
|
||||
$mod = new $module['name']();
|
||||
if ($mod->isHookableOn($hook_name))
|
||||
$hookableModulesList[] = array('id' => (int)$mod->id, 'name' => $mod->displayName, 'display' => Module::hookExec($hook_name, array(), (int)$mod->id));
|
||||
}
|
||||
}
|
||||
die(Tools::jsonEncode($hookableModulesList));
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('saveHook'))
|
||||
{
|
||||
$hooks_list = explode(',', Tools::getValue('hooks_list'));
|
||||
$hookableList = array();
|
||||
foreach ($hooks_list as $hook)
|
||||
{
|
||||
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'hook_module` WHERE `id_hook` = (SELECT id_hook FROM `'._DB_PREFIX_.'hook` WHERE `name` = \''.pSQL($hook).'\' LIMIT 0, 1)');
|
||||
$hookedModules = explode(',', Tools::getValue($hook));
|
||||
$i = 1;
|
||||
$value = '';
|
||||
foreach($hookedModules as $module)
|
||||
{
|
||||
$ids = explode('_', $module);
|
||||
$value .= '('.$ids[1].', (SELECT id_hook FROM `'._DB_PREFIX_.'hook` WHERE `name` = \''.pSQL($hook).'\' LIMIT 0, 1), '.$i.'),';
|
||||
$i ++;
|
||||
}
|
||||
$value = rtrim($value, ',');
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`) VALUES '.$value);
|
||||
|
||||
}
|
||||
die('{"hasError" : false, "errors" : ""}');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('getAdminHomeElement'))
|
||||
{
|
||||
$result = array();
|
||||
|
||||
// PREACTIVATION
|
||||
$protocol = (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off') ? 'https' : 'http';
|
||||
$isoUser = Language::getIsoById(intval($cookie->id_lang));
|
||||
$isoCountry = Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
|
||||
$context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
|
||||
$content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $context);
|
||||
if (!$content)
|
||||
die('NOK');
|
||||
$content = explode('|', $content);
|
||||
if ($content[0] == 'OK')
|
||||
{
|
||||
$result['partner_preactivation'] = $content[2];
|
||||
$content[1] = explode('#%#', $content[1]);
|
||||
foreach ($content[1] as $partnerPopUp)
|
||||
if ($partnerPopUp)
|
||||
{
|
||||
$partnerPopUp = explode('%%', $partnerPopUp);
|
||||
if (!Configuration::get('PS_PREACTIVATION_'.strtoupper($partnerPopUp[0])))
|
||||
{
|
||||
$result['partner_preactivation'] .= $partnerPopUp[1];
|
||||
Configuration::updateValue('PS_PREACTIVATION_'.strtoupper($partnerPopUp[0]), 'TRUE');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
$result['partner_preactivation'] = '';
|
||||
|
||||
// DISCOVER PRESTASHOP
|
||||
$content = @file_get_contents('https://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $context);
|
||||
$content = explode('|', $content);
|
||||
if ($content[0] == 'OK')
|
||||
$result['discover_prestashop'] = $content[1];
|
||||
else
|
||||
$result['discover_prestashop'] = '';
|
||||
|
||||
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3))
|
||||
$result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="'.$protocol.'://www.prestashop.com/rss/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe>';
|
||||
|
||||
$content = @file_get_contents('https://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $context);
|
||||
$content = explode('|', $content);
|
||||
if ($content[0] == 'OK')
|
||||
$result['discover_prestashop'] .= $content[1];
|
||||
|
||||
|
||||
die(Tools::jsonEncode($result));
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
define('PS_ADMIN_DIR', getcwd());
|
||||
include_once('../config/config.inc.php');
|
||||
include_once('tabs/AdminCatalog.php');
|
||||
include_once('tabs/AdminProducts.php');
|
||||
include_once('init.php');
|
||||
|
||||
if (Tools::getValue('token') != Tools::getAdminTokenLite('AdminCatalog'))
|
||||
die(1);
|
||||
|
||||
$catalog = new AdminCatalog();
|
||||
$adminProducts = new AdminProducts();
|
||||
|
||||
global $cookie;
|
||||
|
||||
echo ' <tr>
|
||||
<td class="col-left"><label for="id_category_default" class="t">'.$adminProducts->getL('Default category:').'</label></td>
|
||||
<td>
|
||||
<select id="id_category_default" name="id_category_default" onchange="checkDefaultCategory(this.value);">';
|
||||
$categories = Category::getCategories((int)($cookie->id_lang), false);
|
||||
Category::recurseCategory($categories, $categories[0][1], 1, (int)(Tools::getValue('id_category_default')));
|
||||
echo ' </select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-left">'.$adminProducts->getL('Catalog:').'</td>
|
||||
<td>
|
||||
<div style="overflow: auto; min-height: 300px; padding-top: 0.6em;" id="categoryList">
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(\'div#categoryList input.categoryBox\').click(function (){
|
||||
if ($(this).is(\':not(:checked)\') && $(\'div#categoryList input.id_category_default\').val() == $(this).val())
|
||||
alert(\''.utf8_encode(html_entity_decode($adminProducts->getL('Consider changing the default category.'))).'\');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<table cellspacing="0" cellpadding="0" class="table">
|
||||
<tr>
|
||||
<th><input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \'categoryBox[]\', this.checked)" /></th>
|
||||
<th>'.$adminProducts->getL('ID').'</th>
|
||||
<th style="width: 600px">'.$adminProducts->getL('Name').'</th>
|
||||
</tr>';
|
||||
$done = array();
|
||||
$index = array();
|
||||
|
||||
$categoryBox = Tools::getValue('categoryBox');
|
||||
if ($categoryBox != '')
|
||||
{
|
||||
$categoryBox = @unserialize($categoryBox);
|
||||
foreach ($categoryBox AS $k => $row)
|
||||
$index[] = $row;
|
||||
}
|
||||
elseif ((int)Tools::getValue('id_product'))
|
||||
$index = Product::getProductCategories((int)Tools::getValue('id_product'));
|
||||
$adminProducts->recurseCategoryForInclude((int)(Tools::getValue('id_product')), $index, $categories, $categories[0][1], 1, (int)(Tools::getValue('id_category_default')));
|
||||
echo ' </table>
|
||||
<p style="padding:0px; margin:0px 0px 10px 0px;">'.$adminProducts->getL('Mark all checkbox(es) of categories in which product is to appear').'<sup> *</sup></p>
|
||||
</div>
|
||||
</tr>';
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
define('PS_ADMIN_DIR', getcwd());
|
||||
include(PS_ADMIN_DIR.'/../config/config.inc.php');
|
||||
/* Getting cookie or logout */
|
||||
require_once(dirname(__FILE__).'/init.php');
|
||||
|
||||
if(!isset($_GET['iso_lang']) OR empty($_GET['iso_lang']))
|
||||
die('fail:0');
|
||||
if(!isset($_GET['ps_version']) OR empty($_GET['ps_version']))
|
||||
die('fail:0');
|
||||
if(@fsockopen('www.prestashop.com', 80))
|
||||
{
|
||||
// Get all iso code available
|
||||
$lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang']);
|
||||
|
||||
if ($lang_packs !== '' && Tools::jsonDecode($lang_packs) !== NULL)
|
||||
{
|
||||
echo $lang_packs;
|
||||
}
|
||||
else
|
||||
die('fail:2');
|
||||
}
|
||||
else
|
||||
die('offline');
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
define('PS_ADMIN_DIR', getcwd());
|
||||
include(PS_ADMIN_DIR.'/../config/config.inc.php');
|
||||
/* Getting cookie or logout */
|
||||
require_once(dirname(__FILE__).'/init.php');
|
||||
|
||||
$query = Tools::getValue('q', false);
|
||||
if (!$query OR $query == '' OR strlen($query) < 1)
|
||||
die();
|
||||
|
||||
/*
|
||||
* In the SQL request the "q" param is used entirely to match result in database.
|
||||
* In this way if string:"(ref : #ref_pattern#)" is displayed on the return list,
|
||||
* they are no return values just because string:"(ref : #ref_pattern#)"
|
||||
* is not write in the name field of the product.
|
||||
* So the ref pattern will be cut for the search request.
|
||||
*/
|
||||
if($pos = strpos($query, ' (ref:'))
|
||||
$query = substr($query, 0, $pos);
|
||||
|
||||
$excludeIds = Tools::getValue('excludeIds', false);
|
||||
if ($excludeIds && $excludeIds != 'NaN')
|
||||
$excludeIds = implode(',', array_map('intval', explode(',', $excludeIds)));
|
||||
else
|
||||
$excludeIds = '';
|
||||
$items = Db::getInstance()->ExecuteS('
|
||||
SELECT p.`id_product`, `reference`, pl.name
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product)
|
||||
WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\') AND pl.id_lang = '.(int)($cookie->id_lang).
|
||||
(!empty($excludeIds) ? ' AND p.id_product NOT IN ('.$excludeIds.') ' : ''));
|
||||
|
||||
if ($items)
|
||||
foreach ($items AS $item)
|
||||
echo trim($item['name']).(!empty($item['reference']) ? ' (ref: '.$item['reference'].')' : '').'|'.(int)($item['id_product'])."\n";
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
include_once(dirname(__FILE__).'/../config/config.inc.php');
|
||||
|
||||
/* Getting cookie or logout */
|
||||
require_once(dirname(__FILE__).'/init.php');
|
||||
|
||||
$smtpChecked = (trim($_GET['mailMethod']) == 'smtp');
|
||||
$smtpServer = $_GET['smtpSrv'];
|
||||
$content = $_GET['testMsg'];
|
||||
$subject = $_GET['testSubject'];
|
||||
$type = 'text/html';
|
||||
$to = $_GET['testEmail'];
|
||||
$from = Configuration::get('PS_SHOP_EMAIL');
|
||||
$smtpLogin = $_GET['smtpLogin'];
|
||||
$smtpPassword = $_GET['smtpPassword'];
|
||||
$smtpPort = $_GET['smtpPort'];
|
||||
$smtpEncryption = $_GET['smtpEnc'];
|
||||
|
||||
$result = Mail::sendMailTest(Tools::htmlentitiesUTF8($smtpChecked), Tools::htmlentitiesUTF8($smtpServer), Tools::htmlentitiesUTF8($content), Tools::htmlentitiesUTF8($subject), Tools::htmlentitiesUTF8($type), Tools::htmlentitiesUTF8($to), Tools::htmlentitiesUTF8($from), Tools::htmlentitiesUTF8($smtpLogin), Tools::htmlentitiesUTF8($smtpPassword), Tools::htmlentitiesUTF8($smtpPort), Tools::htmlentitiesUTF8($smtpEncryption));
|
||||
die($result ? 'ok' : 'fail');
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
<div id="content">
|
||||
<table class="tableList" id="tableList" cellpadding="0" cellspacing="0" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5"><a href="#" class="check_all" id="tickAll" title="<?php echo TIP_SELECT_ALL; ?>" onclick="checkAll(this);"> </a></th>
|
||||
<th width="10" class="fileColumns"> </th>
|
||||
<th class="docName"><?php echo LBL_NAME; ?></th>
|
||||
<th width="70" class="fileColumns"><?php echo LBL_SIZE; ?></th>
|
||||
<th class="fileColumns"><?php echo LBL_MODIFIED; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="fileList">
|
||||
<?php
|
||||
$count = 1;
|
||||
$css = "";
|
||||
//list all documents (files and folders) under this current folder,
|
||||
//<?php echo appendQueryString(appendQueryString(CONFIG_URL_FILEnIMAGE_MANAGER, "path=" . $file['path']), makeQueryString(array('path')));
|
||||
foreach($fileList as $file)
|
||||
{
|
||||
$css = ($css == "" || $css == "even"?"odd":"even");
|
||||
$strDisabled = ($file['is_writable']?"":" disabled");
|
||||
$strClass = ($file['is_writable']?"left":" leftDisabled");
|
||||
if($file['type'] == 'file')
|
||||
{
|
||||
|
||||
?>
|
||||
<tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" >
|
||||
<td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?> />
|
||||
</td>
|
||||
<td align="center" class="fileColumns" id="tdst<?php echo $count; ?>"> <a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" target="_blank"><span class="<?php echo $file['cssClass']; ?>"> </span></a></td>
|
||||
<td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><?php echo $file['name']; ?></td>
|
||||
<td class="docInfo" id="tdrd<?php echo $count; ?>"><?php echo transformFileSize($file['size']); ?></td>
|
||||
<td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}else
|
||||
{
|
||||
?>
|
||||
<tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" >
|
||||
<td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?>/>
|
||||
</td>
|
||||
<td lign="center" class="fileColumns" id="tdst<?php echo $count; ?>"> <a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" <?php echo $file['cssClass'] == 'filePicture'?'rel="ajaxPhotos"':''; ?> ><span class="<?php echo ($file['file']||$file['subdir']?$file['cssClass']:"folderEmpty"); ?>"> </span></a></td>
|
||||
<td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><?php echo $file['name']; ?></td>
|
||||
<td class="docInfo" id="tdrd<?php echo $count; ?>"> </td>
|
||||
<td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1,37 +0,0 @@
|
||||
<div id="content">
|
||||
<?php
|
||||
|
||||
$count = 1;
|
||||
$thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path')));
|
||||
foreach($fileList as $file)
|
||||
|
||||
{
|
||||
?>
|
||||
<dl class="thumbnailListing" id="dl<?php echo $count; ?>">
|
||||
<dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir'])?'folderEmpty':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
|
||||
<?php
|
||||
switch($file['cssClass'])
|
||||
{
|
||||
case 'filePicture':
|
||||
echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">';
|
||||
echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n";
|
||||
break;
|
||||
case 'fileFlash':
|
||||
case 'fileVideo':
|
||||
case 'fileMusic':
|
||||
break;
|
||||
default:
|
||||
echo ' ';
|
||||
}
|
||||
?>
|
||||
|
||||
</dt>
|
||||
<dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" />
|
||||
<a <?php echo ($file['cssClass']== 'filePicture'?'rel="orgImg"':''); ?> href="<?php echo $file['path']; ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></dd>
|
||||
|
||||
</dl>
|
||||
<?php
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
?>
|
||||
<select class="input inputSearch" name="search_folder" id="search_folder">
|
||||
<?php
|
||||
|
||||
foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $v; ?>" ><?php echo shortenFileName($k, 30); ?></option>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* create a folder
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
@ob_start();
|
||||
displayArray($_POST);
|
||||
writeInfo(@ob_get_clean());
|
||||
echo "{";
|
||||
$error = "";
|
||||
$info = "";
|
||||
/* $_POST['new_folder'] = substr(md5(time()), 1, 5);
|
||||
$_POST['currentFolderPath'] = "../../uploaded/";*/
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_NEWFOLDER)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(empty($_POST['new_folder']))
|
||||
{
|
||||
$error = ERR_FOLDER_NAME_EMPTY;
|
||||
}elseif(!preg_match("/^[a-zA-Z0-9_\- ]+$/", $_POST['new_folder']))
|
||||
{
|
||||
$error = ERR_FOLDER_FORMAT;
|
||||
}else if(empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath']))
|
||||
{
|
||||
$error = ERR_FOLDER_PATH_NOT_ALLOWED;
|
||||
}
|
||||
elseif(file_exists(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']))
|
||||
{
|
||||
$error = ERR_FOLDER_EXISTS;
|
||||
}else
|
||||
{
|
||||
include_once(CLASS_FILE);
|
||||
$file = new file();
|
||||
if($file->mkdir(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], 0775))
|
||||
{
|
||||
include_once(CLASS_MANAGER);
|
||||
$manager = new manager(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], false);
|
||||
$pathInfo = $manager->getFolderInfo(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']);
|
||||
foreach($pathInfo as $k=>$v)
|
||||
{
|
||||
switch ($k)
|
||||
{
|
||||
|
||||
|
||||
case "ctime";
|
||||
case "mtime":
|
||||
case "atime":
|
||||
$v = date(DATE_TIME_FORMAT, $v);
|
||||
break;
|
||||
case 'name':
|
||||
$info .= sprintf(", %s:'%s'", 'short_name', shortenFileName($v));
|
||||
break;
|
||||
case 'cssClass':
|
||||
$v = 'folderEmpty';
|
||||
break;
|
||||
}
|
||||
$info .= sprintf(", %s:'%s'", $k, $v);
|
||||
}
|
||||
}else
|
||||
{
|
||||
$error = ERR_FOLDER_CREATION_FAILED;
|
||||
}
|
||||
//$error = "For security reason, folder creation function has been disabled.";
|
||||
}
|
||||
echo "error:'" . $error . "'";
|
||||
echo $info;
|
||||
echo "}";
|
||||
?>
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* delete selected files
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/April/2007
|
||||
*
|
||||
*/
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
$error = "";
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_DELETE)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(!empty($_GET['delete']))
|
||||
{//delete the selected file from context menu
|
||||
if(!file_exists($_GET['delete']))
|
||||
{
|
||||
$error = ERR_FILE_NOT_AVAILABLE;
|
||||
}
|
||||
elseif(!isUnderRoot($_GET['delete']))
|
||||
{
|
||||
$error = ERR_FOLDER_PATH_NOT_ALLOWED;
|
||||
}else
|
||||
{
|
||||
include_once(CLASS_FILE);
|
||||
$file = new file();
|
||||
if(is_dir($_GET['delete'])
|
||||
&& isValidPattern(CONFIG_SYS_INC_DIR_PATTERN, getBaseName($_GET['delete']))
|
||||
&& !isInvalidPattern(CONFIG_SYS_EXC_DIR_PATTERN, getBaseName($_GET['delete'])))
|
||||
{
|
||||
$file->delete(addTrailingSlash(backslashToSlash($_GET['delete'])));
|
||||
}elseif(is_file($_GET['delete'])
|
||||
&& isValidPattern(CONFIG_SYS_INC_FILE_PATTERN, getBaseName($_GET['delete']))
|
||||
&& !isInvalidPattern(CONFIG_SYS_EXC_FILE_PATTERN, getBaseName($_GET['delete']))
|
||||
)
|
||||
{
|
||||
$file->delete(($_GET['delete']));
|
||||
}
|
||||
}
|
||||
}else
|
||||
{
|
||||
if(!isset($_POST['selectedDoc']) || !is_array($_POST['selectedDoc']) || sizeof($_POST['selectedDoc']) < 1)
|
||||
{
|
||||
$error = ERR_NOT_FILE_SELECTED;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
include_once(CLASS_FILE);
|
||||
$file = new file();
|
||||
|
||||
foreach($_POST['selectedDoc'] as $doc)
|
||||
{
|
||||
if(file_exists($doc) && isUnderRoot($doc))
|
||||
{
|
||||
if(is_dir($doc)
|
||||
&& isValidPattern(CONFIG_SYS_INC_DIR_PATTERN, $doc)
|
||||
&& !isInvalidPattern(CONFIG_SYS_EXC_DIR_PATTERN, $doc))
|
||||
{
|
||||
$file->delete(addTrailingSlash(backslashToSlash($doc)));
|
||||
}elseif(is_file($doc)
|
||||
&& isValidPattern(CONFIG_SYS_INC_FILE_PATTERN, $doc)
|
||||
&& !isInvalidPattern(CONFIG_SYS_EXC_FILE_PATTERN, $doc)
|
||||
)
|
||||
{
|
||||
$file->delete($doc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "{error:'" . $error . "'}";
|
||||
?>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* delete selected files
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/April/2007
|
||||
*
|
||||
*/
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
|
||||
{
|
||||
|
||||
$path = $_GET['path'];
|
||||
//check if the file size
|
||||
$fileSize = @filesize($path);
|
||||
|
||||
if($fileSize > getMemoryLimit())
|
||||
{//larger then the php memory limit, redirect to the file
|
||||
|
||||
header('Location: ' . $path);
|
||||
exit;
|
||||
}else
|
||||
{//open it up and send out with php
|
||||
downloadFile($path);
|
||||
|
||||
}
|
||||
}else
|
||||
{
|
||||
die(ERR_DOWNLOAD_FILE_NOT_FOUND);
|
||||
}
|
||||
?>
|
||||
@@ -1,118 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* reset the image
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
if(!isset($_POST['path']))
|
||||
{
|
||||
$_POST['path'] = "uploaded/Winter.jpg" . "?" . makeQueryString(array('path'));
|
||||
//for crop
|
||||
$_POST['mode'] = "crop";
|
||||
$_POST['x'] = 100;
|
||||
$_POST['y'] = 100;
|
||||
$imageInfo = @GetImageSize($_POST['path']);
|
||||
$_POST['width'] = $imageInfo[0];
|
||||
$_POST['height'] = $imageInfo[1];
|
||||
|
||||
}
|
||||
initSessionHistory($_POST['path']);
|
||||
|
||||
echo "{";
|
||||
$error = "";
|
||||
$info = "";
|
||||
|
||||
if(empty($_POST['path']))
|
||||
{
|
||||
$error = IMG_SAVE_EMPTY_PATH;
|
||||
}elseif(!file_exists($_POST['path']))
|
||||
{
|
||||
$error = IMG_SAVE_NOT_EXISTS;
|
||||
}else if(!isUnderRoot($_POST['path']))
|
||||
{
|
||||
$error = IMG_SAVE_PATH_DISALLOWED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!empty($_POST['mode']))
|
||||
{
|
||||
|
||||
include_once(CLASS_IMAGE);
|
||||
$image = new Image();
|
||||
$image->loadImage($_POST['path']);
|
||||
|
||||
switch($_POST['mode'])
|
||||
{
|
||||
case "resize":
|
||||
if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false)))
|
||||
{
|
||||
$error = IMG_SAVE_RESIZE_FAILED;
|
||||
}
|
||||
break;
|
||||
case "crop":
|
||||
if(!$image->cropToDimensions($_POST['x'], $_POST['y'], (int)($_POST['x']) + (int)($_POST['width']), (int)($_POST['y']) + (int)($_POST['height'])))
|
||||
{
|
||||
$error = IMG_SAVE_CROP_FAILED;
|
||||
}
|
||||
|
||||
break;
|
||||
case "flip":
|
||||
if(!$image->flip($_POST['flip_angle']))
|
||||
{
|
||||
$error = IMG_SAVE_FLIP_FAILED;
|
||||
}
|
||||
break;
|
||||
case "rotate":
|
||||
if(!$image->rotate((int)($_POST['angle'])))
|
||||
{
|
||||
$error = IMG_SAVE_ROTATE_FAILED;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$error = IMG_SAVE_UNKNOWN_MODE;
|
||||
}
|
||||
if(empty($error))
|
||||
{
|
||||
|
||||
$sessionNewPath = $session->getSessionDir() . uniqid(md5(time())) . "." . getFileExt($_POST['path']);
|
||||
if(!@copy($_POST['path'], $sessionNewPath))
|
||||
{
|
||||
$error = IMG_SAVE_BACKUP_FAILED;
|
||||
}else
|
||||
{
|
||||
addSessionHistory($_POST['path'], $sessionNewPath);
|
||||
if($image->saveImage($_POST['path']))
|
||||
{
|
||||
$imageInfo = $image->getFinalImageInfo();
|
||||
$info .= ",width:" . $imageInfo['width'] . "\n";
|
||||
$info .= ",height:" . $imageInfo['height'] . "\n";
|
||||
$info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n";
|
||||
}else
|
||||
{
|
||||
$error = IMG_SAVE_FAILED;
|
||||
}
|
||||
}
|
||||
}else
|
||||
{
|
||||
//$image->DestroyImages();
|
||||
}
|
||||
}else
|
||||
{
|
||||
$error = IMG_SAVE_UNKNOWN_MODE;
|
||||
}
|
||||
}
|
||||
|
||||
echo "error:'" . $error . "'\n";
|
||||
if(isset($image) && is_object($image))
|
||||
{
|
||||
$image->DestroyImages();
|
||||
}
|
||||
echo $info;
|
||||
echo ",history:" . sizeof($_SESSION[$_POST['path']]) . "\n";
|
||||
echo "}";
|
||||
?>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* copy file
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
$error = "";
|
||||
$info = '';
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_COPY)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(!isset($_POST['selectedDoc']) || !is_array($_POST['selectedDoc']) || sizeof($_POST['selectedDoc']) < 1)
|
||||
{
|
||||
$error = ERR_NOT_DOC_SELECTED_FOR_COPY;
|
||||
}
|
||||
elseif(empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath']))
|
||||
{
|
||||
$error = ERR_FOLDER_PATH_NOT_ALLOWED;
|
||||
}else
|
||||
{
|
||||
require_once(CLASS_SESSION_ACTION);
|
||||
$sessionAction = new SessionAction();
|
||||
$sessionAction->setAction($_POST['action_value']);
|
||||
$sessionAction->setFolder($_POST['currentFolderPath']);
|
||||
$sessionAction->set($_POST['selectedDoc']);
|
||||
$info = ',num:' . sizeof($_POST['selectedDoc']);
|
||||
}
|
||||
echo "{error:'" . $error . "'\n" . $info . "}";
|
||||
?>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* cut file
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
|
||||
$error = "";
|
||||
$info = '';
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_CUT)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(!isset($_POST['selectedDoc']) || !is_array($_POST['selectedDoc']) || sizeof($_POST['selectedDoc']) < 1)
|
||||
{
|
||||
$error = ERR_NOT_DOC_SELECTED_FOR_CUT;
|
||||
}
|
||||
elseif(empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath']))
|
||||
{
|
||||
$error = ERR_FOLDER_PATH_NOT_ALLOWED;
|
||||
}else
|
||||
{
|
||||
require_once(CLASS_SESSION_ACTION);
|
||||
$sessionAction = new SessionAction();
|
||||
$sessionAction->setAction($_POST['action_value']);
|
||||
$sessionAction->setFolder($_POST['currentFolderPath']);
|
||||
$sessionAction->set($_POST['selectedDoc']);
|
||||
$info = ',num:' . sizeof($_POST['selectedDoc']);
|
||||
}
|
||||
echo "{error:'" . $error . "'\n" . $info . "}";
|
||||
?>
|
||||
@@ -1,140 +0,0 @@
|
||||
<?
|
||||
include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
$error = '';
|
||||
$fileMoved = array();
|
||||
$unmovedDocDueToSamePath = array();
|
||||
if(CONFIG_SYS_VIEW_ONLY || (!CONFIG_OPTIONS_CUT && !CONFIG_OPTIONS_COPY))
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(empty($_GET['current_folder_path']))
|
||||
{
|
||||
$error = ERR_NOT_DEST_FOLDER_SPECIFIED;
|
||||
}elseif(!file_exists($_GET['current_folder_path']) || !is_dir($_GET['current_folder_path']))
|
||||
{
|
||||
$error = ERR_DEST_FOLDER_NOT_FOUND;
|
||||
}elseif(!isUnderRoot($_GET['current_folder_path']))
|
||||
{
|
||||
$error = ERR_DEST_FOLDER_NOT_ALLOWED;
|
||||
}else
|
||||
{
|
||||
|
||||
include_once(CLASS_MANAGER);
|
||||
include_once(CLASS_SESSION_ACTION);
|
||||
$sessionAction = new SessionAction();
|
||||
include_once(DIR_AJAX_INC . "class.manager.php");
|
||||
$manager = new manager();
|
||||
$manager->setSessionAction($sessionAction);
|
||||
$selectedDocuments = $sessionAction->get();
|
||||
|
||||
$destFolderPath = addTrailingSlash(backslashToSlash($_GET['current_folder_path']));
|
||||
|
||||
|
||||
if(sizeof($selectedDocuments))
|
||||
{
|
||||
//get all files within the destination folder
|
||||
$allDocs = array();
|
||||
if(($fh = @opendir($_GET['current_folder_path'])))
|
||||
{
|
||||
while(($file = readdir($fh)) && $file != '.' && $file != '..')
|
||||
{
|
||||
$allDocs[] = getRealPath($destFolderPath . $file);
|
||||
}
|
||||
}
|
||||
closedir($fh);
|
||||
include_once(CLASS_FILE);
|
||||
$file = new file();
|
||||
//check if all files are allowed to cut or copy
|
||||
|
||||
foreach($selectedDocuments as $doc)
|
||||
{
|
||||
if(file_exists($doc) && isUnderRoot($doc) )
|
||||
{
|
||||
|
||||
if( array_search(getRealPath($doc), $allDocs) === false || CONFIG_OVERWRITTEN)
|
||||
{
|
||||
if(CONFIG_OVERWRITTEN)
|
||||
{
|
||||
$file->delete($doc);
|
||||
}
|
||||
if($file->copyTo($doc, $_GET['current_folder_path']))
|
||||
{
|
||||
|
||||
$finalPath = $destFolderPath . basename($doc);
|
||||
$objFile = new file($finalPath);
|
||||
$tem = $objFile->getFileInfo();
|
||||
$obj = new manager($finalPath, false);
|
||||
|
||||
$fileType = $obj->getFileType($finalPath, (is_dir($finalPath)?true:false));
|
||||
|
||||
foreach($fileType as $k=>$v)
|
||||
{
|
||||
$tem[$k] = $v;
|
||||
}
|
||||
|
||||
/* foreach ($folderInfo as $k=>$v)
|
||||
{
|
||||
$tem['i_' . $k] = $v;
|
||||
}
|
||||
if($folderInfo['type'] == 'folder' && empty($folderInfo['subdir']) && empty($folderInfo['file']))
|
||||
{
|
||||
$tem['cssClass'] = 'folderEmpty';
|
||||
}*/
|
||||
|
||||
$tem['final_path'] = $finalPath;
|
||||
$tem['path'] = backslashToSlash($finalPath);
|
||||
$tem['type'] = (is_dir($finalPath)?'folder':'file');
|
||||
$tem['size'] = @transformFileSize($tem['size']);
|
||||
$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
|
||||
$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
|
||||
$tem['flag'] = 'noFlag';
|
||||
$tem['url'] = getFileUrl($doc);
|
||||
|
||||
$manager = null;
|
||||
if($sessionAction->getAction() == "cut")
|
||||
{
|
||||
$file->delete($doc);
|
||||
}
|
||||
$fileMoved[sizeof($fileMoved)] = $tem;
|
||||
$tem = null;
|
||||
}
|
||||
}else
|
||||
{
|
||||
$unmovedDocDueToSamePath[] = $doc;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$sessionAction->set(array());
|
||||
}
|
||||
if(sizeof($unmovedDocDueToSamePath) == sizeof($selectedDocuments))
|
||||
{
|
||||
$error = ERR_DEST_FOLDER_NOT_ALLOWED;
|
||||
}elseif(sizeof($unmovedDocDueToSamePath))
|
||||
{
|
||||
foreach($unmovedDocDueToSamePath as $v)
|
||||
{
|
||||
$error .= sprintf(ERR_UNABLE_TO_MOVE_TO_SAME_DEST, $v) . "\r\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "{'error':'" . $error . "', 'unmoved_files':" . sizeof($unmovedDocDueToSamePath) . ", 'files':{";
|
||||
foreach($fileMoved as $i=>$file)
|
||||
{
|
||||
|
||||
echo ($i>0?', ':' ') . $i . ": { ";
|
||||
$j = 0;
|
||||
foreach($file as $k=>$v)
|
||||
{
|
||||
echo ($j++ > 0? ", ":'') . "'" . $k . "':'" . $v . "'";
|
||||
|
||||
}
|
||||
echo "} ";
|
||||
}
|
||||
echo "} }";
|
||||
|
||||
?>
|
||||
@@ -1,90 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* processing the uploaded files
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
|
||||
sleep(3);
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
echo "{";
|
||||
$error = "";
|
||||
$info = "";
|
||||
|
||||
include_once(CLASS_UPLOAD);
|
||||
$upload = new Upload();
|
||||
|
||||
$upload->setInvalidFileExt(explode(",", CONFIG_UPLOAD_INVALID_EXTS));
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder']))
|
||||
{
|
||||
$error = ERR_FOLDER_PATH_NOT_ALLOWED;
|
||||
}else if(!$upload->isFileUploaded('file'))
|
||||
{
|
||||
$error = ERR_FILE_NOT_UPLOADED;
|
||||
}else if(!$upload->moveUploadedFile($_GET['folder']))
|
||||
{
|
||||
$error = ERR_FILE_MOVE_FAILED;
|
||||
}
|
||||
elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
|
||||
{
|
||||
$error = ERR_FILE_TYPE_NOT_ALLOWED;
|
||||
}elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
|
||||
{
|
||||
$error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE));
|
||||
}else
|
||||
{
|
||||
include_once(CLASS_FILE);
|
||||
$path = $upload->getFilePath();
|
||||
$obj = new file($path);
|
||||
$tem = $obj->getFileInfo();
|
||||
if(sizeof($tem))
|
||||
{
|
||||
include_once(CLASS_MANAGER);
|
||||
|
||||
$manager = new manager($upload->getFilePath(), false);
|
||||
|
||||
$fileType = $manager->getFileType($upload->getFileName());
|
||||
|
||||
foreach($fileType as $k=>$v)
|
||||
{
|
||||
$tem[$k] = $v;
|
||||
}
|
||||
|
||||
$tem['path'] = backslashToSlash($path);
|
||||
$tem['type'] = "file";
|
||||
$tem['size'] = transformFileSize($tem['size']);
|
||||
$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
|
||||
$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
|
||||
$tem['short_name'] = shortenFileName($tem['name']);
|
||||
$tem['flag'] = 'noFlag';
|
||||
$obj->close();
|
||||
foreach($tem as $k=>$v)
|
||||
{
|
||||
$info .= sprintf(", %s:'%s'", $k, $v);
|
||||
}
|
||||
|
||||
$info .= sprintf(", url:'%s'", getFileUrl($path));
|
||||
$info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME);
|
||||
|
||||
|
||||
}else
|
||||
{
|
||||
$error = ERR_FILE_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
echo "error:'" . $error . "'";
|
||||
echo $info;
|
||||
echo "}";
|
||||
|
||||
?>
|
||||
@@ -1,139 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* the php script used to get the list of file or folders under a specific folder
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
|
||||
if(!isset($manager))
|
||||
{
|
||||
/**
|
||||
* this is part of script for processing file paste
|
||||
*/
|
||||
//$_GET = $_POST;
|
||||
include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
include_once(CLASS_PAGINATION);
|
||||
$pagination = new pagination(false);
|
||||
if(!empty($_GET['search']))
|
||||
{
|
||||
include_once(CLASS_SEARCH);
|
||||
|
||||
$search = new Search($_GET['search_folder']);
|
||||
$search->addSearchKeyword('recursive', @$_GET['search_recursively']);
|
||||
$search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']);
|
||||
$search->addSearchKeyword('mtime_to', @$_GET['search_mtime_to']);
|
||||
$search->addSearchKeyword('size_from', @$_GET['search_size_from']);
|
||||
$search->addSearchKeyword('size_to', @$_GET['search_size_to']);
|
||||
$search->addSearchKeyword('recursive', @$_GET['search_recursively']);
|
||||
$search->addSearchKeyword('name', @$_GET['search_name']);
|
||||
$search->doSearch();
|
||||
$fileList = $search->getFoundFiles();
|
||||
$folderInfo = $search->getRootFolderInfo();
|
||||
|
||||
}else
|
||||
{
|
||||
include_once(CLASS_MANAGER);
|
||||
include_once(CLASS_SESSION_ACTION);
|
||||
$sessionAction = new SessionAction();
|
||||
include_once(DIR_AJAX_INC . "class.manager.php");
|
||||
|
||||
$manager = new manager();
|
||||
$manager->setSessionAction($sessionAction);
|
||||
|
||||
$fileList = $manager->getFileList();
|
||||
$folderInfo = $manager->getFolderInfo();
|
||||
|
||||
}
|
||||
$pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER);
|
||||
|
||||
}else
|
||||
{
|
||||
include_once(CLASS_PAGINATION);
|
||||
$pagination = new pagination(false);
|
||||
}
|
||||
|
||||
|
||||
$pagination->setTotal(sizeof($fileList));
|
||||
$pagination->setFirstText(PAGINATION_FIRST);
|
||||
$pagination->setPreviousText(PAGINATION_PREVIOUS);
|
||||
$pagination->setNextText(PAGINATION_NEXT);
|
||||
$pagination->setLastText(PAGINATION_LAST);
|
||||
$pagination->setLimit(!empty($_GET['limit'])?(int)($_GET['limit']):CONFIG_DEFAULT_PAGINATION_LIMIT);
|
||||
echo $pagination->getPaginationHTML();
|
||||
echo "<script type=\"text/javascript\">\n";
|
||||
|
||||
echo "parentFolder = {path:'" . getParentFolderPath($folderInfo['path']). "'};\n";
|
||||
echo 'currentFolder ={';
|
||||
$count =1;
|
||||
foreach($folderInfo as $k=>$v)
|
||||
{
|
||||
echo ($count++ == 1?'':',') . "'" . $k . "':'" . ($k=='ctime'|| $k=='mtime'?date(DATE_TIME_FORMAT, $v):$v) . "'";
|
||||
|
||||
}
|
||||
echo "};\n";
|
||||
$fileList = array_slice($fileList, $pagination->getPageOffset(), $pagination->getLimit());
|
||||
echo 'numRows = ' . sizeof($fileList) . ";\n";
|
||||
echo "files = {\n";
|
||||
$count = 1;
|
||||
|
||||
|
||||
foreach($fileList as $file)
|
||||
{
|
||||
echo (($count > 1)?",":'').$count++ . ":{";
|
||||
$j = 1;
|
||||
foreach($file as $k=>$v)
|
||||
{
|
||||
|
||||
if($k == 'ctime' || $k == 'mtime')
|
||||
{
|
||||
$v = @date(DATE_TIME_FORMAT, $v);
|
||||
}
|
||||
if($k == 'size')
|
||||
{
|
||||
$v = transformFileSize($v);
|
||||
}
|
||||
echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'";
|
||||
}
|
||||
echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'";
|
||||
echo "}\n";
|
||||
}
|
||||
echo "};</script>\n";
|
||||
if(!empty($_GET['view']))
|
||||
{
|
||||
switch($_GET['view'])
|
||||
{
|
||||
case 'detail':
|
||||
case 'thumbnail':
|
||||
case 'text':
|
||||
$view = $_GET['view'];
|
||||
break;
|
||||
default:
|
||||
$view = CONFIG_DEFAULT_VIEW;
|
||||
}
|
||||
}else
|
||||
{
|
||||
$view = CONFIG_DEFAULT_VIEW;
|
||||
}
|
||||
switch($view)
|
||||
{
|
||||
case 'text':
|
||||
//list file name only
|
||||
include_once(DIR_AJAX_ROOT . '_ajax_get_text_listing.php');
|
||||
break;
|
||||
case 'thumbnail':
|
||||
//list file with thumbnail
|
||||
include_once(DIR_AJAX_ROOT . '_ajax_get_thumbnail_listing.php');
|
||||
break;
|
||||
case 'detail':
|
||||
default:
|
||||
include_once(DIR_AJAX_ROOT . '_ajax_get_details_listing.php');
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
echo '{';
|
||||
$count = 1;
|
||||
foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
|
||||
{
|
||||
|
||||
|
||||
echo (($count > 1)?', ':''). "'" . $v . "':'" . $k . "'";
|
||||
$count++;
|
||||
}
|
||||
echo "}";
|
||||
?>
|
||||
@@ -1,210 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* Ajax image editor platform
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
|
||||
{
|
||||
die(SYS_DISABLED);
|
||||
}
|
||||
//$session->gc();
|
||||
$_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path'];
|
||||
if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
|
||||
{
|
||||
$path = $_GET['path'];
|
||||
}else
|
||||
{
|
||||
die(IMG_GEN_IMG_NOT_EXISTS);
|
||||
}
|
||||
require_once(CLASS_HISTORY);
|
||||
$history = new History($path, $session);
|
||||
if(CONFIG_SYS_DEMO_ENABLE)
|
||||
{
|
||||
$sessionImageInfo = $history->getLastestRestorable();
|
||||
$originalSessionImageInfo = $history->getOriginalImage();
|
||||
if(sizeof($originalSessionImageInfo))
|
||||
{
|
||||
$path = backslashToSlash($session->getSessionDir() . $originalSessionImageInfo['info']['name']);
|
||||
}
|
||||
}
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "class.image.php");
|
||||
$image = new Image();
|
||||
|
||||
$imageInfo = $image->getImageInfo($path);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="author" content="Logan Cai" />
|
||||
<meta name="website" content="http://www.phpletter.com" />
|
||||
<script type="text/javascript" src="jscripts/ajaximageeditor_c.js"></script>
|
||||
<!--
|
||||
<script type="text/javascript" src="jscripts/jquery.js"></script>
|
||||
<script type="text/javascript" src="jscripts/form.js"></script>
|
||||
<script type="text/javascript" src="jscripts/select.js"></script>
|
||||
<script type="text/javascript" src="jscripts/jqModal.js"></script>
|
||||
<script type="text/javascript" src="jscripts/rotate.js"></script>
|
||||
<script type="text/javascript" src="jscripts/interface.js"></script>
|
||||
|
||||
-->
|
||||
<script type="text/javascript" src="jscripts/ajaximageeditor.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var imageHistory = false;
|
||||
var currentFolder = '<?php echo removeTrailingSlash(backslashToSlash(dirname($path))); ?>';
|
||||
var warningLostChanges = '<?php echo IMG_WARNING_LOST_CHANAGES; ?>';
|
||||
var warningReset = '<?php echo IMG_WARNING_REST; ?>';
|
||||
var warningResetEmpty = '<?php echo IMG_WARNING_EMPTY_RESET; ?>';
|
||||
var warningEditorClose = '<?php echo IMG_WARING_WIN_CLOSE; ?>';
|
||||
var warningUndoImage = '<?php echo IMG_WARNING_UNDO; ?>';
|
||||
var warningFlipHorizotal = '<?php echo IMG_WARING_FLIP_H; ?>';
|
||||
var warningFlipVertical = '<?php echo IMG_WARING_FLIP_V; ?>';
|
||||
var numSessionHistory = <?php echo $history->getNumRestorable(); ?>;
|
||||
var noChangeMadeBeforeSave = '<?php echo IMG_WARNING_NO_CHANGE_BEFORE_SAVE; ?>';
|
||||
var warningInvalidNewName = '<?php echo IMG_SAVE_AS_ERR_NAME_INVALID; ?>';
|
||||
var wordCloseWindow = '<?php echo LBL_ACTION_CLOSE; ?>';
|
||||
var warningNoFolderSelected = '<?php echo IMG_SAVE_AS_NOT_FOLDER_SELECTED; ?>';
|
||||
var urlGetFolderList = '<?php echo appendQueryString(CONFIG_URL_GET_FOLDER_LIST, makeQueryString(array('path'))); ?>';
|
||||
$(document).ready(
|
||||
function()
|
||||
{
|
||||
$('#windowSaveAs').jqm();
|
||||
$('#image_mode').val('');
|
||||
$('#angle').val(0);
|
||||
$(getImageElement()).clone().appendTo("#hiddenImage");
|
||||
changeMode();
|
||||
initDisabledButtons(true);
|
||||
}
|
||||
);
|
||||
|
||||
</script>
|
||||
<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/ajaximageeditor.css" type="text/css" rel="stylesheet" />
|
||||
<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/jqModal.css" type="text/css" rel="stylesheet" />
|
||||
<title>Ajax Image Editor</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
//displayArray($_SESSION);
|
||||
|
||||
?>
|
||||
<div id="controls">
|
||||
<fieldset id="modes">
|
||||
<legend>Modes</legend>
|
||||
<form name="formAction" id="formAction" method="post" action="<?php echo appendQueryString(CONFIG_URL_IMAGE_UNDO, makeQueryString(array('path'))); ?>">
|
||||
<input type="hidden" name="file_path" id="file_path" value="<?php echo $_GET['path']; ?>" />
|
||||
|
||||
<p><label><?php echo IMG_MODE_RESIZE; ?></label> <input type="radio" name="mode" value="resize" class="input" checked="checked" onclick="return changeMode();"/>
|
||||
<label><?php echo IMG_MODE_CROP; ?></label> <input type="radio" name="mode" value="crop" class="input" onclick="return changeMode();" />
|
||||
<label><?php echo IMG_MODE_ROTATE; ?></label> <input type="radio" name="mode" value="rotate" class="input" onclick="return changeMode();" />
|
||||
<label><?php echo IMG_MODE_FLIP; ?></label> <input type="radio" name="mode" value="flip" class="input" onclick="return changeMode();" />
|
||||
<label><?php echo IMG_CHECKBOX_CONSTRAINT; ?></label> <input type="checkbox" name="constraint" id="constraint" value="1" class="input" onclick="return toggleConstraint();" />
|
||||
<!-- <label>Watermark:</label> <input type="radio" name="mode" value="watermark" class="input" onclick="return false;" />-->
|
||||
|
||||
<button id="actionRotateLeft" class="disabledButton" onclick="return leftRotate();" disabled><?php echo IMG_BTN_ROTATE_LEFT; ?></button>
|
||||
<button id="actionRotateRight" class="disabledButton" onclick="return rightRotate();" disabled><?php echo IMG_BTN_ROTATE_RIGHT; ?></button>
|
||||
<button id="actionFlipH" class="disabledButton" onclick="return flipHorizontal();" disabled><?php echo IMG_BTN_FLIP_H; ?></button>
|
||||
<button id="actionFlipV" class="disabledButton" onclick="return flipVertical();" disabled><?php echo IMG_BTN_FLIP_V; ?></button>
|
||||
<button id="actionReset" class="button" onclick="return resetEditor();"><?php echo IMG_BTN_RESET; ?></button>
|
||||
<button id="actionUndo" class="button" onclick="return undoImage();"><?php echo IMG_BTN_UNDO; ?></button>
|
||||
<button id="actionSave" class="button" onclick="return saveImage();"><?php echo IMG_BTN_SAVE; ?></button>
|
||||
<button id="actionSaveAs" class="button" onclick="return saveAsImagePre();"><?php echo IMG_BTN_SAVE_AS; ?></button>
|
||||
<button id="actionClose" class="button" onclick="return editorClose();"><?php echo IMG_BTN_CLOSE; ?></button></p>
|
||||
</form>
|
||||
</fieldset>
|
||||
<fieldset id="imageInfo">
|
||||
<legend id="imageInfoLegend"><?php echo IMG_INFO; ?></legend>
|
||||
<form name="formImageInfo" action="<?php echo appendQueryString(CONFIG_URL_IMAGE_SAVE, makeQueryString(array('path'))); ?>" method="post" id="formImageInfo">
|
||||
<p><input type="hidden" name="mode" id="image_mode" value="" />
|
||||
<input type="hidden" name="new_name" id="hidden_new_name" value="" />
|
||||
<input type="hidden" name="save_to" id="hidden_save_to" value="" />
|
||||
<input type="hidden" name="path" id="path" value="<?php echo $_GET['path']; ?>" />
|
||||
<input type="hidden" name="flip_angle" id="flip_angle" value="" />
|
||||
<label><?php echo IMG_LBL_WIDTH; ?></label> <input type="text" name="width" id="width" value="" class="input imageInput" />
|
||||
<label><?php echo IMG_LBL_HEIGHT; ?></label> <input type="text" name="height" id="height" value="" class="input imageInput" />
|
||||
<label><?php echo IMG_LBL_X; ?></label> <input type="text" name="x" id="x" value="" class="input imageInput"/>
|
||||
<label><?php echo IMG_LBL_Y; ?></label> <input type="text" name="y" id="y" value="" class="input imageInput"/>
|
||||
<!-- <b>Percentage:</b> <input type="text" name="percentage" id="percentage" value="" class="input imageInput"/>-->
|
||||
<label><?php echo IMG_LBL_RATIO; ?></label> <input type="text" name="ratio" id="ratio" value="" class="input imageInput"/>
|
||||
<label><?php echo IMG_LBL_ANGLE; ?></label> <input type="text" name="angle" id="angle" value="" class="input imageInput" />
|
||||
|
||||
</p>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="imageArea">
|
||||
<div id="imageContainer">
|
||||
<img src="<?php echo $path; ?>" name="<?php echo basename($path); ?>" width="<?php echo $imageInfo['width']; ?>" height="<?php echo $imageInfo['height']; ?>" />
|
||||
</div>
|
||||
<div id="resizeMe">
|
||||
<div id="resizeSE"></div>
|
||||
<div id="resizeE"></div>
|
||||
<div id="resizeNE"></div>
|
||||
<div id="resizeN"></div>
|
||||
<div id="resizeNW"></div>
|
||||
<div id="resizeW"></div>
|
||||
<div id="resizeSW"></div>
|
||||
<div id="resizeS"></div>
|
||||
<img id="loading" style="display:none;" src="theme/<?php echo CONFIG_THEME_NAME; ?>/images/ajaxLoading.gif" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="hiddenImage">
|
||||
</div>
|
||||
<div id="windowSaveAs" class="jqmWindow" style="display:none">
|
||||
<a href="#" class="jqmClose" id="windowSaveClose"><?php echo LBL_ACTION_CLOSE; ?></a>
|
||||
<form id="formSaveAs" name="formSaveAs" action="" method="post">
|
||||
<table class="tableForm" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo IMG_LBL_SAVE_AS; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php echo IMG_LBL_NEW_NAME; ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text" id="new_name" class="input" name="new_name" value="" /> .<?php echo getFileExt($path); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php echo IMG_LBL_SAVE_TO; ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select class="input" name="save_to" id="save_to"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<td>
|
||||
<span class="comments">*</span>
|
||||
<?php echo IMG_NEW_NAME_COMMENTS; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<td><input type="button" class="button" value="<?php echo IMG_BTN_SAVE_AS; ?>" onclick="return saveAsImage();" /></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,196 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* image save function
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
|
||||
|
||||
$error = "";
|
||||
$info = "";
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(empty($_POST['path']))
|
||||
{
|
||||
$error = IMG_SAVE_EMPTY_PATH;
|
||||
}elseif(!file_exists($_POST['path']))
|
||||
{
|
||||
$error = IMG_SAVE_NOT_EXISTS;
|
||||
}elseif(!isUnderRoot($_POST['path']))
|
||||
{
|
||||
$error = IMG_SAVE_PATH_DISALLOWED;
|
||||
}elseif(($sessionDir = $session->getSessionDir()) == '')
|
||||
{
|
||||
$error = SESSION_PERSONAL_DIR_NOT_FOUND;
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(CLASS_HISTORY);
|
||||
$history = new History($_POST['path'], $session);
|
||||
if(!empty($_POST['mode']))
|
||||
{
|
||||
//get the original image which is the lastest session image if any when the system is in demo
|
||||
$lastestSessionImageInfo = $history->getLastestRestorable();
|
||||
if(sizeof($lastestSessionImageInfo) && CONFIG_SYS_DEMO_ENABLE)
|
||||
{
|
||||
$originalSessionImageInfo = $history->getOriginalImage();
|
||||
if(sizeof($originalSessionImageInfo))
|
||||
{
|
||||
$originalImage = $sessionDir . $originalSessionImageInfo['info']['name'];
|
||||
}
|
||||
}
|
||||
if(empty($originalImage))
|
||||
{
|
||||
$originalImage = $_POST['path'];
|
||||
}
|
||||
|
||||
include_once(CLASS_IMAGE);
|
||||
$image = new Image();
|
||||
if($image->loadImage($originalImage))
|
||||
{
|
||||
|
||||
switch($_POST['mode'])
|
||||
{
|
||||
case "resize":
|
||||
if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false)))
|
||||
{
|
||||
$error = IMG_SAVE_RESIZE_FAILED;
|
||||
}
|
||||
break;
|
||||
case "crop":
|
||||
if(!$image->crop($_POST['x'], $_POST['y'], $_POST['width'], $_POST['height']))
|
||||
{
|
||||
$error = IMG_SAVE_CROP_FAILED;
|
||||
}
|
||||
break;
|
||||
case "flip":
|
||||
if(!$image->flip($_POST['flip_angle']))
|
||||
{
|
||||
$error = IMG_SAVE_FLIP_FAILED;
|
||||
}
|
||||
break;
|
||||
case "rotate":
|
||||
|
||||
if(!$image->rotate((int)($_POST['angle'])))
|
||||
{
|
||||
$error = IMG_SAVE_ROTATE_FAILED;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
$error = IMG_SAVE_UNKNOWN_MODE;
|
||||
}
|
||||
|
||||
|
||||
if(empty($error))
|
||||
{
|
||||
$sessionNewPath = $sessionDir . uniqid(md5(time())) . "." . getFileExt($_POST['path']);
|
||||
if(!@copy($originalImage, $sessionNewPath))
|
||||
{//keep a copy under the session folder
|
||||
$error = IMG_SAVE_BACKUP_FAILED;
|
||||
}else
|
||||
{
|
||||
|
||||
$isSaveAsRequest = (!empty($_POST['new_name']) && !empty($_POST['save_to'])?true:false);
|
||||
//save the modified image
|
||||
$sessionImageInfo = array('name'=>basename($sessionNewPath), 'restorable'=>1);
|
||||
$history->add($sessionImageInfo);
|
||||
if(CONFIG_SYS_DEMO_ENABLE)
|
||||
{//demo only
|
||||
if(isset($originalSessionImageInfo) && sizeof($originalSessionImageInfo))
|
||||
{
|
||||
$imagePath = $sessionDir . $originalSessionImageInfo['info']['name'];
|
||||
}else
|
||||
{
|
||||
$imagePath = $sessionDir . uniqid(md5(time())) . "." . getFileExt($_POST['path']);
|
||||
}
|
||||
}else
|
||||
{
|
||||
if($isSaveAsRequest)
|
||||
{//save as request
|
||||
//check save to folder if exists
|
||||
$imagePath = addTrailingSlash(backslashToSlash($_POST['save_to'])) . $_POST['new_name'] . "." . getFileExt($_POST['path']);
|
||||
if(!file_exists($_POST['save_to']) || !is_dir($_POST['save_to']))
|
||||
{
|
||||
$error = IMG_SAVE_AS_FOLDER_NOT_FOUND;
|
||||
}elseif(file_exists($imagePath))
|
||||
{
|
||||
$error = IMG_SAVE_AS_NEW_IMAGE_EXISTS;
|
||||
}elseif(!preg_match("/^[a-zA-Z0-9_\- ]+$/", $_POST['new_name']))
|
||||
{
|
||||
$error = IMG_SAVE_AS_ERR_NAME_INVALID;
|
||||
}
|
||||
|
||||
}else
|
||||
{//save request
|
||||
$imagePath = $originalImage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($image->saveImage($imagePath))
|
||||
{
|
||||
|
||||
if(CONFIG_SYS_DEMO_ENABLE)
|
||||
{
|
||||
if(!isset($originalSessionImageInfo) || !sizeof($originalSessionImageInfo))
|
||||
{//keep this original image information on session for future reference if demo only
|
||||
$originalSessionImageInfo = array('name'=>basename($imagePath), 'restorable'=>0, 'is_original'=>1);
|
||||
$history->add($originalSessionImageInfo);
|
||||
}
|
||||
}
|
||||
$imageInfo = $image->getFinalImageInfo();
|
||||
}else
|
||||
{
|
||||
$error = IMG_SAVE_FAILED;
|
||||
|
||||
}
|
||||
if(isset($imageInfo))
|
||||
{
|
||||
$info .= ",width:" . $imageInfo['width'] . "";
|
||||
$info .= ",height:" . $imageInfo['height'] . "";
|
||||
$info .= ",size:'" . transformFileSize($imageInfo['size']) . "'";
|
||||
if($isSaveAsRequest)
|
||||
{
|
||||
$info .= ",save_as:'1'";
|
||||
}else
|
||||
{
|
||||
$info .= ",save_as:'0'";
|
||||
}
|
||||
$info .= ",folder_path:'" . dirname($imagePath) . "'";
|
||||
$info .= ",path:'" . backslashToSlash($imagePath) . "'";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}else
|
||||
{
|
||||
$error = IMG_SAVE_IMG_OPEN_FAILED;
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
$error = IMG_SAVE_UNKNOWN_MODE;
|
||||
}
|
||||
}
|
||||
echo "{";
|
||||
echo "error:'" . $error . "'";
|
||||
if(isset($image) && is_object($image))
|
||||
{
|
||||
$image->DestroyImages();
|
||||
}
|
||||
echo $info;
|
||||
echo ",history:" . (isset($history) && is_object($history)?($history->getNumRestorable()):0) . "";
|
||||
echo "}";
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* ajax preview
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/April/2007
|
||||
*
|
||||
*/
|
||||
include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']))
|
||||
{
|
||||
include_once(CLASS_IMAGE);
|
||||
$image = new Image(true);
|
||||
if($image->loadImage($_GET['path']))
|
||||
{
|
||||
if($image->resize(CONFIG_IMG_THUMBNAIL_MAX_X, CONFIG_IMG_THUMBNAIL_MAX_Y, true, true))
|
||||
{
|
||||
$image->showImage();
|
||||
}else
|
||||
{
|
||||
echo PREVIEW_NOT_PREVIEW . ".";
|
||||
}
|
||||
}else
|
||||
{
|
||||
echo PREVIEW_NOT_PREVIEW . "..";
|
||||
}
|
||||
|
||||
|
||||
}else
|
||||
{
|
||||
echo PREVIEW_NOT_PREVIEW . "...";
|
||||
}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* ajax image undo function
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
require_once(CLASS_HISTORY);
|
||||
$history = new History($_POST['file_path'], $session);
|
||||
$lastestSessionImageInfo = $history->getLastestRestorable();
|
||||
echo "{";
|
||||
$error = "";
|
||||
$info = "";
|
||||
if(CONFIG_SYS_VIEW_ONLY)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(empty($_POST['file_path']))
|
||||
{
|
||||
$error = IMG_SAVE_EMPTY_PATH;
|
||||
}elseif(!file_exists($_POST['file_path']))
|
||||
{
|
||||
$error = IMG_SAVE_NOT_EXISTS;
|
||||
}elseif(!isUnderRoot($_POST['file_path']))
|
||||
{
|
||||
$error = IMG_SAVE_PATH_DISALLOWED;
|
||||
}else if(!sizeof($lastestSessionImageInfo))
|
||||
{
|
||||
$error = IMG_UNDO_NO_HISTORY_AVAIALBE;
|
||||
}
|
||||
else
|
||||
{
|
||||
//get the original image which is the lastest session image if any when the system is in demo
|
||||
$sessionImage = $session->getSessionDir() . $lastestSessionImageInfo['name'];
|
||||
$originalSessionImageInfo = $history->getOriginalImage();
|
||||
if(CONFIG_SYS_DEMO_ENABLE && sizeof($originalSessionImageInfo))
|
||||
{
|
||||
$originalImage = $session->getSessionDir() . $originalSessionImageInfo['info']['name'];
|
||||
}else
|
||||
{
|
||||
$originalImage = $_POST['file_path'];
|
||||
}
|
||||
|
||||
include_once(CLASS_IMAGE);
|
||||
$image = new Image();
|
||||
if($image->loadImage($sessionImage))
|
||||
{
|
||||
$imageInfo = $image->getOriginalImageInfo();
|
||||
if(!@copy($sessionImage, $originalImage))
|
||||
{
|
||||
$error = IMG_UNDO_COPY_FAILED;
|
||||
}else
|
||||
{
|
||||
|
||||
//remove the session image
|
||||
if(@unlink($sessionImage))
|
||||
{
|
||||
$history->restore();
|
||||
}
|
||||
//only one left, remove the session original if demo
|
||||
|
||||
if($history->getNumRestorable() == 0 && CONFIG_SYS_DEMO_ENABLE && sizeof($originalSessionImageInfo))
|
||||
{
|
||||
@unlink($session->getSessionDir() . $originalSessionImageInfo['info']['name']);
|
||||
$originalImage = $_POST['file_path'];
|
||||
}
|
||||
}
|
||||
$imagePath = $originalImage;
|
||||
|
||||
}else
|
||||
{
|
||||
$error = IMG_SAVE_IMG_OPEN_FAILED;
|
||||
}
|
||||
if(isset($imageInfo))
|
||||
{
|
||||
$info .= ",width:" . $imageInfo['width'] . "\n";
|
||||
$info .= ",height:" . $imageInfo['height'] . "\n";
|
||||
$info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n";
|
||||
$info .= ",path:'" . backslashToSlash($imagePath) . "'\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "error:'" . $error . "'\n";
|
||||
if(isset($image) && is_object($image))
|
||||
{
|
||||
$image->DestroyImages();
|
||||
}
|
||||
echo $info;
|
||||
echo ",history:" . ($history->getNumRestorable()) . "\n";
|
||||
echo "}";
|
||||
?>
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* access control login form
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/April/2007
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
//Code added to adjust for local admin rights.
|
||||
if(!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] === false) {
|
||||
|
||||
if(isset($_POST['username']))
|
||||
{
|
||||
if($auth->login())
|
||||
{
|
||||
header('Location: ' . appendQueryString(CONFIG_URL_HOME, makeQueryString()));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$_SESSION['ajax_user'] = true;
|
||||
header('Location: ' . appendQueryString(CONFIG_URL_HOME, makeQueryString()));
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/login.css" rel="stylesheet" />
|
||||
<title><?php echo LOGIN_PAGE_TITLE; ?></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="content">
|
||||
<form name="frmLogin" method="post" action="">
|
||||
<table class="adminLoginTable" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo LOGIN_FORM_TITLE; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="padTop"><label><?php echo LOGIN_USERNAME; ?> </label></th>
|
||||
<td class="padTop"><input type="text" value="" class="input" name="username" id="username" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label><?php echo LOGIN_PASSWORD; ?> </label></th>
|
||||
<td><input type="password" value="" class="input" name="password" id="password" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="submit" class="button" value="Login" /></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* ajax preview
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/April/2007
|
||||
*
|
||||
*/
|
||||
include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
echo getRealPath($_GET['path']);
|
||||
if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']))
|
||||
{
|
||||
|
||||
include_once(CLASS_MANAGER);
|
||||
$manager = new manager($_GET['path'], false);
|
||||
$fileTypes = $manager->getFileType(basename($_GET['path']));
|
||||
if($fileTypes['preview'])
|
||||
{
|
||||
switch($fileTypes['fileType'])
|
||||
{
|
||||
case "image":
|
||||
$imageInfo = @getimagesize($_GET['path']);
|
||||
if(!empty($imageInfo[0]) && !empty($imageInfo[1]))
|
||||
{
|
||||
$thumInfo = getThumbWidthHeight($imageInfo[0], $imageInfo[1], 400, 135);
|
||||
printf("<img src=\"%s\" width=\"%s\" height=\"%s\" />", getFileUrl($_GET['path']), $thumInfo['width'], $thumInfo['height']);
|
||||
|
||||
}else
|
||||
{
|
||||
echo PREVIEW_IMAGE_LOAD_FAILED;
|
||||
}
|
||||
|
||||
break;
|
||||
case "txt":
|
||||
if(($fp = @fopen($_GET['path'], 'r')))
|
||||
{
|
||||
echo @fread($fp, @filesize($_GET['path']));
|
||||
@fclose($fp);
|
||||
}else
|
||||
{
|
||||
echo PREVIEW_OPEN_FAILED . ".";
|
||||
}
|
||||
break;
|
||||
|
||||
case "video":
|
||||
break;
|
||||
}
|
||||
}else
|
||||
{
|
||||
echo PREVIEW_NOT_PREVIEW . "..";
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
echo PREVIEW_NOT_PREVIEW . "...";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Untitled Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a href="#" class="jqmClose" id="windowSaveClose"><?php echo IMG_BTN_CANCEL; ?></a>
|
||||
<form id="formSaveAs" name="formSaveAs" action="" method="post">
|
||||
<table class="tableForm" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo IMG_LBL_SAVE_AS; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php echo IMG_LBL_NEW_NAME; ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text" id="new_name" class="input" name="new_name" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php echo IMG_LBL_SAVE_TO; ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select class="input" name="save_to">
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<td>
|
||||
<span class="comments">*</span>
|
||||
<?php echo IMG_NEW_NAME_COMMENTS; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<td><input type="button" class="button" value="<?php echo IMG_BTN_SAVE_AS; ?>" onclick="return saveAsImage();" /></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* ajax save name
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
$error = '';
|
||||
$fileInfo = array();
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_RENAME)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(empty($_POST['name']))
|
||||
{
|
||||
$error = ERR_RENAME_EMPTY;
|
||||
}elseif(!preg_match("/^[a-zA-Z0-9 _\-.]+$/", $_POST['name']))
|
||||
{
|
||||
$error = ERR_RENAME_FORMAT;
|
||||
}elseif(empty($_POST['original_path']) || !file_exists($_POST['original_path']))
|
||||
{
|
||||
$error = ERR_RENAME_FILE_NOT_EXISTS;
|
||||
}elseif(substr(slashToBackslash(removeTrailingSlash($_POST['original_path'])), strrpos(slashToBackslash(removeTrailingSlash($_POST['original_path'])), "/") + 1) == $_POST['name'])
|
||||
{
|
||||
$error = ERR_NO_CHANGES_MADE;
|
||||
}elseif(file_exists(addTrailingSlash(getParentPath($_POST['original_path'])) . $_POST['name']))
|
||||
{
|
||||
$error = ERR_RENAME_EXISTS;
|
||||
}elseif(is_file($_POST['original_path']) && !isValidExt($_POST['name'], explode(",", CONFIG_UPLOAD_VALID_EXTS), explode(",", CONFIG_UPLOAD_INVALID_EXTS)))
|
||||
{
|
||||
$error = ERR_RENAME_FILE_TYPE_NOT_PERMITED;
|
||||
}elseif(!rename(removeTrailingSlash($_POST['original_path']), addTrailingSlash(getParentPath($_POST['original_path'])) . $_POST['name']))
|
||||
{
|
||||
$error = ERR_RENAME_FAILED;
|
||||
}else
|
||||
{
|
||||
//update record of session if image exists in session for cut or copy
|
||||
include_once(CLASS_SESSION_ACTION);
|
||||
$sessionAction = new SessionAction();
|
||||
$selectedDocuments = $sessionAction->get();
|
||||
if(removeTrailingSlash($sessionAction->getFolder()) == getParentPath($_POST['original_path']) && sizeof($selectedDocuments))
|
||||
{
|
||||
if(($key = array_search(basename($_POST['original_path']), $selectedDocuments)) !== false)
|
||||
{
|
||||
$selectedDocuments[$key] = $_POST['name'];
|
||||
$sessionAction->set($selectedDocuments);
|
||||
|
||||
}
|
||||
|
||||
}elseif(removeTrailingSlash($sessionAction->getFolder()) == removeTrailingSlash($_POST['original_path']))
|
||||
{
|
||||
$sessionAction->setFolder($_POST['original_path']);
|
||||
}
|
||||
$path = addTrailingSlash(getParentPath($_POST['original_path'])) . $_POST['name'];
|
||||
if(is_file($path))
|
||||
{
|
||||
include_once(CLASS_FILE);
|
||||
$file = new file($path);
|
||||
$fileInfo = $file->getFileInfo();
|
||||
}else
|
||||
{
|
||||
include_once(CLASS_MANAGER);
|
||||
$manager = new manager($path, false);
|
||||
$fileInfo = $manager->getFolderInfo();
|
||||
}
|
||||
}
|
||||
|
||||
echo "{";
|
||||
echo "error:'" . $error . "' ";
|
||||
foreach ($fileInfo as $k=>$v)
|
||||
{
|
||||
echo "," . $k . ":'" . $v . "' ";
|
||||
}
|
||||
echo "}";
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,90 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* ajax save name
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
$error = '';
|
||||
$path = addTrailingSlash(backslashToSlash($_POST['folder'])) . $_POST['name'];
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(isset($_POST['save_as_request']))
|
||||
{
|
||||
if(!preg_match('/^[a-zA-Z0-9_\-.]+$/', $_POST['name']))
|
||||
{
|
||||
$error = TXT_SAVE_AS_ERR_NAME_INVALID;
|
||||
}elseif(array_search(strtolower(getFileExt($_POST['name'])), getValidTextEditorExts()) === false)
|
||||
{
|
||||
$error = TXT_DISALLOWED_EXT;
|
||||
}elseif(!isUnderRoot($_POST['folder']))
|
||||
{
|
||||
$error = ERR_FOLDER_PATH_NOT_ALLOWED;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(!empty($_POST['save_as_request']))
|
||||
{//save as request
|
||||
if(file_exists($path))
|
||||
{
|
||||
$error = TXT_FILE_EXIST;
|
||||
}else
|
||||
{
|
||||
if(($fp = @fopen($path, 'w+')) !== false)
|
||||
{
|
||||
if(@fwrite($fp, $_POST['text']))
|
||||
{
|
||||
@fclose($fp);
|
||||
}else
|
||||
{
|
||||
$error = TXT_CONTENT_WRITE_FAILED;
|
||||
}
|
||||
}else
|
||||
{
|
||||
$error = TXT_CREATE_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}else
|
||||
{
|
||||
if(!file_exists($path))
|
||||
{
|
||||
$error = TXT_FILE_NOT_EXIST;
|
||||
}else
|
||||
{
|
||||
if(($fp = @fopen($path, 'w')) !== false)
|
||||
{
|
||||
if(@fwrite($fp, $_POST['text']))
|
||||
{
|
||||
@fclose($fp);
|
||||
}else
|
||||
{
|
||||
$error = TXT_CONTENT_UPDATE_FAILED;
|
||||
}
|
||||
}else
|
||||
{
|
||||
$error = TXT_FILE_OPEN_FAILED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
$error = TXT_UNKNOWN_REQUEST;
|
||||
}
|
||||
echo "{";
|
||||
echo "error:'" . $error . "',\n";
|
||||
echo "path:'" . $path . "'";
|
||||
echo "}";
|
||||
|
||||
?>
|
||||
@@ -1,168 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* Ajax image editor platform
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
|
||||
{
|
||||
die(SYS_DISABLED);
|
||||
}
|
||||
//$session->gc();
|
||||
$_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path'];
|
||||
if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
|
||||
{
|
||||
$path = $_GET['path'];
|
||||
}else
|
||||
{
|
||||
die(TXT_FILE_NOT_FOUND);
|
||||
}
|
||||
if(file_exists(DIR_AJAX_EDIT_AREA . "reg_syntax" . DIRECTORY_SEPARATOR . getFileExt($path) . ".js"))
|
||||
{
|
||||
$syntax = getFileExt($path);
|
||||
}else
|
||||
{
|
||||
switch (getFileExt($path))
|
||||
{
|
||||
case 'htm':
|
||||
$syntax = 'html';
|
||||
break;
|
||||
default:
|
||||
$syntax = 'basic';
|
||||
}
|
||||
}
|
||||
if(array_search(getFileExt($path), getValidTextEditorExts())=== false)
|
||||
{
|
||||
die(TXT_DISALLOWED_EXT);
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="author" content="Logan Cai" />
|
||||
<meta name="website" content="http://www.phpletter.com" />
|
||||
<script type="text/javascript" src="jscripts/ajaxtexteditor_c.js"></script>
|
||||
<!--<script type="text/javascript" src="jscripts/jquery.js"></script>
|
||||
<script type="text/javascript" src="jscripts/form.js"></script>
|
||||
<script type="text/javascript" src="jscripts/select.js"></script>
|
||||
<script type="text/javascript" src="jscripts/jqModal.js"></script>
|
||||
<script type="text/javascript" src="jscripts/ajaxtexteditor.js"></script>
|
||||
-->
|
||||
<script type="text/javascript" src="jscripts/edit_area/edit_area_full.js"></script>
|
||||
<script type="text/javascript">
|
||||
var warningExtNotSelected = '<?php echo TXT_EXT_NOT_SELECTED; ?>';
|
||||
var urlGetFolderList = '<?php echo appendQueryString(CONFIG_URL_GET_FOLDER_LIST, makeQueryString(array('path'))); ?>';
|
||||
var warningInvalidName = '<?php echo TXT_SAVE_AS_ERR_NAME_INVALID; ?>';
|
||||
var waringFolderNotSelected = '<?php echo TXT_DEST_FOLDER_NOT_SELECTED; ?>';
|
||||
var currentFolder = '<?php echo dirname($path); ?>';
|
||||
var currentName = '<?php echo basename($path); ?>';
|
||||
|
||||
jQuery(document).ready(
|
||||
function()
|
||||
{
|
||||
editAreaLoader.init({
|
||||
id: "content" // id of the textarea to transform
|
||||
,start_highlight: false // if start with highlight
|
||||
,allow_resize: "both"
|
||||
,gecko_spellcheck:true
|
||||
,allow_toggle: true
|
||||
,toolbar:"search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, highlight, reset_highlight, |, save, save_as"
|
||||
,save_callback:"save"
|
||||
,save_as_callback:"save_as"
|
||||
,language: "<?php echo (file_exists(DIR_AJAX_EDIT_AREA . 'langs' . DIRECTORY_SEPARATOR .CONFIG_LANG_INDEX . ".js")?CONFIG_LANG_INDEX:'en'); ?>"
|
||||
,syntax: "<?php echo $syntax; ?>"
|
||||
});
|
||||
jQuery('#windowSaveAs').jqm();
|
||||
jQuery('#windowProcessing').jqm({modal:true});
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/ajaxtexteditor.css" type="text/css" rel="stylesheet" />
|
||||
<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/jqModal.css" type="text/css" rel="stylesheet" />
|
||||
<title>Ajax Text Editor</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="pageBody">
|
||||
<textarea name="content" id="content" style="height:500px; width: 97%;"><?php echo getFileContent($path); ?></textarea>
|
||||
</div>
|
||||
<div id="windowProcessing" class="jqmWindow" style="display:none">
|
||||
<form name="frmProcessing" id="frmProcessing" method="POST" action="<?php echo appendQueryString(CONFIG_URL_SAVE_TEXT, makeQueryString(array('path')));?>">
|
||||
<input type="hidden" name="folder" id="folder" value="<?php echo dirname($path); ?>" />
|
||||
<input type="hidden" name="name" id="name" value="<?php echo basename($path); ?>" />
|
||||
<input type="hidden" name="save_as_request" id="save_as_request" value="0" />
|
||||
<div style="display:none"><textarea name="text" id="text"></textarea></div>
|
||||
</form>
|
||||
<a href="#" class="jqmClose" id="windowSaveClose"><?php echo IMG_BTN_CANCEL; ?></a>
|
||||
<p><img src="theme/<?php echo CONFIG_THEME_NAME; ?>/images/loading.gif" /></p>
|
||||
</div>
|
||||
<div id="windowSaveAs" class="jqmWindow" style="display:none">
|
||||
<a href="#" class="jqmClose" id="windowSaveClose"><?php echo IMG_BTN_CANCEL; ?></a>
|
||||
<form id="formSaveAs" name="formSaveAs" action="" method="post">
|
||||
<table class="tableForm" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo IMG_LBL_SAVE_AS; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php echo IMG_LBL_NEW_NAME; ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text" id="new_name" class="input" name="new_name" value="" />
|
||||
. <select id="ext" name="ext">
|
||||
<?php
|
||||
foreach(getValidTextEditorExts() as $v)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $v; ?>" <?php echo (strtolower($v) == strtolower(getFileExt($path))?'selected':''); ?>><?php echo $v; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php echo IMG_LBL_SAVE_TO; ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select class="input" name="save_to" id="save_to">
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<td>
|
||||
<span class="comments">*</span>
|
||||
<?php echo IMG_NEW_NAME_COMMENTS; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<td><input type="button" class="button" value="<?php echo IMG_BTN_SAVE_AS; ?>" onclick="return do_save_as();" /></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body></html>
|
||||
|
||||
@@ -1,689 +0,0 @@
|
||||
<?php
|
||||
require_once('../../config/config.inc.php');
|
||||
require_once('../init.php');
|
||||
/**
|
||||
* file manager platform
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
|
||||
//$session->gc();
|
||||
require_once(CLASS_SESSION_ACTION);
|
||||
$sessionAction = new SessionAction();
|
||||
if(CONFIG_LOAD_DOC_LATTER)
|
||||
{
|
||||
$fileList = array();
|
||||
$folderInfo = array('path'=>getCurrentFolderPath());
|
||||
}else
|
||||
{
|
||||
require_once(CLASS_MANAGER);
|
||||
|
||||
|
||||
$manager = new manager();
|
||||
$manager->setSessionAction($sessionAction);
|
||||
$fileList = $manager->getFileList();
|
||||
$folderInfo = $manager->getFolderInfo();
|
||||
}
|
||||
if(CONFIG_SYS_THUMBNAIL_VIEW_ENABLE)
|
||||
{
|
||||
$views = array(
|
||||
'detail'=>LBL_BTN_VIEW_DETAILS,
|
||||
'thumbnail'=>LBL_BTN_VIEW_THUMBNAIL,
|
||||
);
|
||||
}else
|
||||
{
|
||||
$views = array(
|
||||
'detail'=>LBL_BTN_VIEW_DETAILS,
|
||||
);
|
||||
}
|
||||
|
||||
if(!empty($_GET['view']))
|
||||
{
|
||||
switch($_GET['view'])
|
||||
{
|
||||
case 'detail':
|
||||
case 'thumbnail':
|
||||
$view = $_GET['view'];
|
||||
break;
|
||||
default:
|
||||
$view = CONFIG_DEFAULT_VIEW;
|
||||
}
|
||||
}else
|
||||
{
|
||||
$view = CONFIG_DEFAULT_VIEW;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" debug="true">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Ajax File Manager</title>
|
||||
<script type="text/javascript" src="jscripts/ajaxfilemanager_c.js"></script>
|
||||
<!--<script type="text/javascript" src="jscripts/jquery.js"></script>
|
||||
<script type="text/javascript" src="jscripts/form.js"></script>
|
||||
<script type="text/javascript" src="jscripts/select.js"></script>
|
||||
<script type="text/javascript" src="jscripts/thickbox.js"></script>
|
||||
<script type="text/javascript" src="jscripts/calendar.js"></script>
|
||||
<script type="text/javascript" src="jscripts/contextmenu.js"></script>
|
||||
<script type="text/javascript" src="jscripts/media.js"></script>
|
||||
<script type="text/javascript" src="jscripts/ajaxfileupload.js"></script>
|
||||
<script type="text/javascript" src="jscripts/ajaxfilemanager.js"></script>-->
|
||||
<script type="text/javascript">
|
||||
var globalSettings = {'upload_init':false};
|
||||
var queryString = '<?php echo makeQueryString(array('path')); ?>';
|
||||
var paths = {'root':'<?php echo addTrailingSlash(backslashToSlash(CONFIG_SYS_ROOT_PATH)); ?>', 'root_title':'<?php echo LBL_FOLDER_ROOT; ?>'};
|
||||
var parentFolder = {};
|
||||
var urls = {
|
||||
'upload':'<?php echo CONFIG_URL_UPLOAD; ?>',
|
||||
'preview':'<?php echo CONFIG_URL_PREVIEW; ?>',
|
||||
'cut':'<?php echo CONFIG_URL_CUT; ?>',
|
||||
'copy':'<?php echo CONFIG_URL_COPY; ?>',
|
||||
'paste':'<?php echo CONFIG_URL_FILE_PASTE; ?>',
|
||||
'delete':'<?php echo CONFIG_URL_DELETE; ?>',
|
||||
'rename':'<?php echo CONFIG_URL_SAVE_NAME; ?>',
|
||||
'thumbnail':'<?php echo CONFIG_URL_IMG_THUMBNAIL; ?>',
|
||||
'create_folder':'<?php echo CONFIG_URL_CREATE_FOLDER; ?>',
|
||||
'text_editor':'<?php echo CONFIG_URL_TEXT_EDITOR; ?>',
|
||||
'image_editor':'<?php echo CONFIG_URL_IMAGE_EDITOR; ?>',
|
||||
'download':'<?php echo CONFIG_URL_DOWNLOAD; ?>',
|
||||
'present':'<?php echo getCurrentUrl(); ?>',
|
||||
'home':'<?php echo CONFIG_URL_HOME; ?>',
|
||||
'view':'<?php echo CONFIG_URL_LIST_LISTING; ?>'
|
||||
};
|
||||
var permits = {'del':<?php echo (CONFIG_OPTIONS_DELETE?1:0); ?>, 'cut':<?php echo (CONFIG_OPTIONS_CUT?'1':'0'); ?>, 'copy':<?php echo (CONFIG_OPTIONS_COPY?1:0); ?>, 'newfolder':<?php echo (CONFIG_OPTIONS_NEWFOLDER?1:0); ?>, 'rename':<?php echo (CONFIG_OPTIONS_RENAME?1:0); ?>, 'upload':<?php echo (CONFIG_OPTIONS_UPLOAD?1:0); ?>, 'edit':<?php echo (CONFIG_OPTIONS_EDITABLE?1:0); ?>, 'view_only':<?php echo (CONFIG_SYS_VIEW_ONLY?1:0); ?>};
|
||||
var currentFolder = {};
|
||||
var warningDelete = '<?php echo WARNING_DELETE; ?>';
|
||||
var newFile = {'num':1, 'label':'<?php echo FILE_LABEL_SELECT; ?>', 'upload':'<?php echo FILE_LBL_UPLOAD; ?>'};
|
||||
var counts = {'new_file':1};
|
||||
var thickbox = {'width':'<?php echo CONFIG_THICKBOX_MAX_WIDTH; ?>',
|
||||
'height':'<?php echo CONFIG_THICKBOX_MAX_HEIGHT; ?>',
|
||||
'next':'<?php echo THICKBOX_NEXT; ?>',
|
||||
'previous':'<?php echo THICKBOX_PREVIOUS; ?>',
|
||||
'close':'<?php echo THICKBOX_CLOSE; ?>'
|
||||
|
||||
};
|
||||
|
||||
var tb_pathToImage = "theme/<?php echo CONFIG_THEME_NAME; ?>/images/loadingAnimation.gif";
|
||||
var msgInvalidFolderName = '<?php echo ERR_FOLDER_FORMAT; ?>';
|
||||
var msgInvalidFileName = '<?php echo ERR_FILE_NAME_FORMAT; ?>';
|
||||
var msgInvalidExt = '<?php echo ERR_FILE_TYPE_NOT_ALLOWED; ?>';
|
||||
var msgNotPreview = '<?php echo PREVIEW_NOT_PREVIEW; ?>';
|
||||
|
||||
var warningCutPaste = '<?php echo WARNING_CUT_PASTE; ?>';
|
||||
var warningCopyPaste = '<?php echo WARNING_COPY_PASTE; ?>';
|
||||
var warningDel = '<?php echo WARNING_DELETE; ?>';
|
||||
var warningNotDocSelected = '<?php echo ERR_NOT_DOC_SELECTED; ?>';
|
||||
var noFileSelected = '<?php echo ERR_NOT_FILE_SELECTED; ?>';
|
||||
var unselectAllText = '<?php echo TIP_UNSELECT_ALL; ?>';
|
||||
var selectAllText = '<?php echo TIP_SELECT_ALL; ?>';
|
||||
var action = '<?php echo $sessionAction->getAction(); ?>';
|
||||
var numFiles = <?php echo $sessionAction->count(); ?>;
|
||||
var warningCloseWindow = '<?php echo WARING_WINDOW_CLOSE; ?>';
|
||||
var numRows = 0;
|
||||
|
||||
var wordCloseWindow = '<?php echo LBL_ACTION_CLOSE; ?>';
|
||||
var wordPreviewClick = '<?php echo LBL_CLICK_PREVIEW; ?>';
|
||||
|
||||
var searchRequired = false;
|
||||
var supporedPreviewExts = '<?php echo CONFIG_VIEWABLE_VALID_EXTS; ?>';
|
||||
var supportedUploadExts = '<?php echo CONFIG_UPLOAD_VALID_EXTS; ?>'
|
||||
var elementId = <?php echo (!empty($_GET['elementId'])?"'" . $_GET['elementId'] . "'":'null'); ?>;
|
||||
var files = {};
|
||||
$(document).ready(
|
||||
function()
|
||||
{
|
||||
jQuery(document).bind('keypress', function(event) {
|
||||
var code=event.charCode || event.keyCode;
|
||||
if(code && code == 13) {// if enter is pressed
|
||||
event.preventDefault(); //prevent browser from following the actual href
|
||||
};
|
||||
});
|
||||
if(typeof(cancelSelectFile) != 'undefined')
|
||||
{
|
||||
$('#linkClose').show();
|
||||
}
|
||||
$('input[@name=view]').each(
|
||||
function()
|
||||
{
|
||||
|
||||
if(this.value == '<?php echo $view; ?>')
|
||||
{
|
||||
this.checked = true;
|
||||
}else
|
||||
{
|
||||
this.checked = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
popUpCal.clearText = '<?php echo CALENDAR_CLEAR; ?>';
|
||||
popUpCal.closeText = '<?php echo CALENDAR_CLOSE; ?>';
|
||||
popUpCal.prevText = '<?php echo CALENDAR_PREVIOUS; ?>';
|
||||
popUpCal.nextText = '<?php echo CALENDAR_NEXT; ?>';
|
||||
popUpCal.currentText = '<?php echo CALENDAR_CURRENT; ?>';
|
||||
popUpCal.buttonImageOnly = true;
|
||||
popUpCal.dayNames = new Array('<?php echo CALENDAR_SUN; ?>','<?php echo CALENDAR_MON; ?>','<?php echo CALENDAR_TUE; ?>','<?php echo CALENDAR_WED; ?>','<?php echo CALENDAR_THU; ?>','<?php echo CALENDAR_FRI; ?>','<?php echo CALENDAR_SAT; ?>');
|
||||
popUpCal.monthNames = new Array('<?php echo CALENDAR_JAN; ?>','<?php echo CALENDAR_FEB; ?>','<?php echo CALENDAR_MAR; ?>','<?php echo CALENDAR_APR; ?>','<?php echo CALENDAR_MAY; ?>','<?php echo CALENDAR_JUN; ?>','<?php echo CALENDAR_JUL; ?>','<?php echo CALENDAR_AUG; ?>','<?php echo CALENDAR_SEP; ?>','<?php echo CALENDAR_OCT; ?>','<?php echo CALENDAR_NOV; ?>','<?php echo CALENDAR_DEC; ?>');
|
||||
popUpCal.dateFormat = 'YMD-';
|
||||
$('.inputMtime').calendar({autoPopUp:'both', buttonImage:'theme/<?php echo CONFIG_THEME_NAME; ?>/images/standard/date_picker.png'});
|
||||
|
||||
|
||||
initAfterListingLoaded();
|
||||
//addMoreFile();
|
||||
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
<?php
|
||||
if(file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'jscripts' . DIRECTORY_SEPARATOR . 'for_' . CONFIG_EDITOR_NAME . ".js")
|
||||
{
|
||||
?>
|
||||
<script type="text/javascript" src="jscripts/<?php echo 'for_' . CONFIG_EDITOR_NAME . '.js'; ?>"></script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/template.css" />
|
||||
<link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/jquery-calendar.css" />
|
||||
<link rel="stylesheet" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/thickbox.css" type="text/css" media="screen" />
|
||||
<!--[if IE 6]>
|
||||
<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/ie6.css" type="text/css" rel="Stylesheet" media="screen">
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body style="background-color:#E8E8E8;">
|
||||
<div id="wrapper">
|
||||
<div id="header">
|
||||
<dl id="currentFolderInfo">
|
||||
<dt><?php echo LBL_CURRENT_FOLDER_PATH; ?></dt>
|
||||
<dd id="currentFolderPath"><?php echo $folderInfo['path']; ?></dd>
|
||||
</dl>
|
||||
<div id="viewList">
|
||||
|
||||
|
||||
<label><?php echo LBL_BTN_VIEW_OPTIONS; ?></label>
|
||||
<?php
|
||||
foreach($views as $k=>$v)
|
||||
{
|
||||
?>
|
||||
<input type="radio" name="view" class="radio" onclick="changeView(this);" value="<?php echo $k; ?>" <?php echo ($k==$view?'checked':''); ?>> <?php echo $v; ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?></div>
|
||||
<ul id="actionHeader">
|
||||
<li><a href="#" id="actionRefresh" onclick="return windowRefresh();"><span><?php echo LBL_ACTION_REFRESH; ?></span></a></li>
|
||||
<li><a href="#" id="actionSelectAll" class="check_all" onclick="return checkAll(this);"><span><?php echo LBL_ACTION_SELECT_ALL; ?></span></a></li>
|
||||
<?php
|
||||
if(CONFIG_OPTIONS_DELETE)
|
||||
{
|
||||
?>
|
||||
<li><a href="#" id="actionDelete" onclick="return deleteDocuments();"><span><?php echo LBL_ACTION_DELETE; ?></span></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if(CONFIG_OPTIONS_CUT)
|
||||
{
|
||||
?>
|
||||
<li><a href="#" id="actionCut" onclick="return cutDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_CUT; ?>');"><span><?php echo LBL_ACTION_CUT; ?></span></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if(CONFIG_OPTIONS_COPY)
|
||||
{
|
||||
?>
|
||||
<li><a href="#" id="actionCopy" onclick="return copyDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_COPY; ?>');"><span><?php echo LBL_ACTION_COPY; ?></span></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if(CONFIG_OPTIONS_CUT || CONFIG_OPTIONS_COPY)
|
||||
{
|
||||
?>
|
||||
<li><a href="#" id="actionPaste" onclick="return pasteDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_PASTE; ?>');"><span><?php echo LBL_ACTION_PASTE; ?></span></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if(CONFIG_OPTIONS_NEWFOLDER)
|
||||
{
|
||||
?>
|
||||
<li><a id="actionNewFolder" href="#" onclick="return newFolderWin(this);"><span><?php echo LBL_BTN_NEW_FOLDER; ?></span></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if(CONFIG_OPTIONS_UPLOAD)
|
||||
{
|
||||
?>
|
||||
<li><a id="actionUpload" href="#" onclick="return uploadFileWin(this);"><span><?php echo LBL_BTN_UPLOAD; ?></span></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <li><a href="#" id="actionClose" onclick="closeWindow('<?php echo IMG_WARING_WIN_CLOSE; ?>');"><?php echo IMG_BTN_CLOSE; ?></a></li>-->
|
||||
<li><a href="#" class="thickbox" id="actionInfo" onclick="return infoWin(this);"><span>Info</span></a></li>
|
||||
<!-- thest functions will be added in the near future
|
||||
<li ><a href="#" id="actionZip"><span>Zip</span></a><li>
|
||||
<li ><a href="#" id="actionUnzip"><span>Unzip</span></a><li>-->
|
||||
</ul>
|
||||
<form action="" method="POST" name="formAction" id="formAction"><input type="hidden" name="currentFolderPath" id="currentFolderPathVal" value="" /><select name="selectedDoc[]" id="selectedDoc" style="display:none;" multiple="multiple"></select><input type="hidden" name="action_value" value="" id="action_value" /></form>
|
||||
</div>
|
||||
|
||||
<div id="body">
|
||||
|
||||
|
||||
<div id="rightCol">
|
||||
<?php
|
||||
if(CONFIG_LOAD_DOC_LATTER )
|
||||
{
|
||||
$currentPath = getCurrentFolderPath();
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
parentFolder = {path:'<?php echo getParentFolderPath($currentPath); ?>'};
|
||||
currentFolder = {'friendly_path':'<?php echo transformFilePath($currentPath); ?>'};
|
||||
$(document).ready(
|
||||
function()
|
||||
{
|
||||
var url = getUrl('view', false, false, false);
|
||||
$('#rightCol').empty();
|
||||
ajaxStart('#rightCol');
|
||||
|
||||
$('#rightCol').load(url,
|
||||
{},
|
||||
function(){
|
||||
ajaxStop('#rightCol img.ajaxLoadingImg');
|
||||
urls.present = getUrl('home', true, true);
|
||||
initAfterListingLoaded();
|
||||
});
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<?php
|
||||
}else
|
||||
{
|
||||
include_once(CONFIG_URL_LIST_LISTING);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div id="leftCol">
|
||||
|
||||
|
||||
|
||||
<fieldset id="folderFieldSet" >
|
||||
|
||||
<legend><?php echo LBL_FOLDER_INFO; ?></legend>
|
||||
<table cellpadding="0" cellspacing="0" class="tableSummary" id="folderInfo">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo LBL_FOLDER_PATH; ?></th>
|
||||
<td colspan="3" id="folderPath"><?php echo transformFilePath($folderInfo['path']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo LBL_FOLDER_CREATED; ?></th>
|
||||
<td colspan="3" id="folderCtime"><?php echo (!empty($folderInfo['ctime'])?date(DATE_TIME_FORMAT,$folderInfo['ctime']):' ') ; ?></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo LBL_FOLDER_MODIFIED; ?></th>
|
||||
<td colspan="3" id="folderMtime"><?php echo (!empty($folderInfo['mtime'])?date(DATE_TIME_FORMAT,$folderInfo['mtime']):' '); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo LBL_FOLDER_SUDDIR; ?></th>
|
||||
<td colspan="3" id="folderSubdir"><?php echo (isset($folderInfo['subdir'])?$folderInfo['subdir']:" "); ?></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo LBL_FOLDER_FIELS; ?></th>
|
||||
<td colspan="3" id="folderFile"><?php echo (isset($folderInfo['file'])?$folderInfo['file']:' '); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php echo LBL_FOLDER_WRITABLE; ?></th>
|
||||
<td id="folderWritable"><span class="<?php echo (isset($folderInfo['is_readable'])?($folderInfo['is_readable']?'flagYes':'flagNo'):' '); ?>"> </span></td>
|
||||
<th><?php echo LBL_FOLDER_READABLE; ?></th>
|
||||
<td id="folderReadable"><span class="<?php echo (isset($folderInfo['is_writable'])?($folderInfo['is_writable']?'flagYes':'flagNo'):' '); ?>"> </span></td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset id="fileFieldSet" style="display:none" >
|
||||
<legend><?php echo LBL_FILE_INFO; ?></legend>
|
||||
<table cellpadding="0" cellspacing="0" class="tableSummary" id="fileInfo">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo LBL_FILE_NAME; ?></th>
|
||||
<td colspan="3" id="fileName"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo LBL_FILE_CREATED; ?></th>
|
||||
<td colspan="3" id="fileCtime"></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo LBL_FILE_MODIFIED; ?></th>
|
||||
<td colspan="3" id="fileMtime"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo LBL_FILE_SIZE; ?></th>
|
||||
<td colspan="3" id="fileSize"></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo LBL_FILE_TYPE; ?></th>
|
||||
<td colspan="3" id="fileType"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo LBL_FILE_WRITABLE; ?></th>
|
||||
<td id="fileWritable"><span class="flagYes"> </span></td>
|
||||
<th><?php echo LBL_FILE_READABLE; ?></th>
|
||||
<td id="fileReadable"><span class="flagNo"> </span></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p class="searchButtons" id="returnCurrentUrl">
|
||||
|
||||
<span class="right" id="linkSelect">
|
||||
<input type="button" value="<?php echo MENU_SELECT; ?>" id="selectCurrentUrl" class="button">
|
||||
</span>
|
||||
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
<fieldset class="boxSearch">
|
||||
<legend><?php echo LBL_SEARCH; ?></legend>
|
||||
|
||||
|
||||
|
||||
<table cellpadding="0" cellspacing="0" class="tableSearch">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php echo LBL_SEARCH_NAME; ?></b> <br />
|
||||
<input type="text" class="input inputSearch" name="search_name" id="search_name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td >
|
||||
<b><?php echo LBL_SEARCH_FOLDER; ?></b><br />
|
||||
<span id="searchFolderContainer">
|
||||
<?php
|
||||
if(CONFIG_LOAD_DOC_LATTER)
|
||||
{
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(
|
||||
function()
|
||||
{
|
||||
ajaxStart('#searchFolderContainer');
|
||||
$('#searchFolderContainer').load('<?php echo CONFIG_URL_LOAD_FOLDERS; ?>');
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<?php
|
||||
}else
|
||||
{
|
||||
?>
|
||||
<select class="input inputSearch" name="search_folder" id="search_folder">
|
||||
<?php
|
||||
|
||||
foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $v; ?>" <?php echo (removeTrailingSlash(backslashToSlash(($folderInfo['path']))) == removeTrailingSlash(backslashToSlash(($v)))?' selected="selected"':''); ?>><?php echo shortenFileName($k, 30); ?></option>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php echo LBL_SEARCH_MTIME; ?></b><br />
|
||||
<input type="text" class="input inputMtime" name="search_mtime_from" id="search_mtime_from" value="<?php echo (!empty($_GET['search_mtime_from'])?$_GET['search_mtime_from']:''); ?>" />
|
||||
<span class="leftToRightArrow"> </span>
|
||||
<input type="text" class="input inputMtime" name="search_mtime_to" id="search_mtime_to" value="<?php echo (!empty($_GET['search_mtime_to'])?$_GET['search_mtime_to']:''); ?>" />
|
||||
</td></tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<b><?php echo LBL_SEARCH_RECURSIVELY; ?></b>
|
||||
<input type="radio" name="search_recursively" value="1" id="search_recursively_1" class="radio" <?php echo (!empty($_GET['search_recursively'])?'checked="checked"':''); ?> /> <?php echo LBL_RECURSIVELY_YES; ?>
|
||||
<input type="radio" name="search_recursively" value="0" id="search_recursively_0" class="radio" <?php echo (empty($_GET['search_recursively'])?'checked="checked"':''); ?> /> <?php echo LBL_RECURSIVELY_NO; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="searchButtons">
|
||||
<span class="left" id="linkClose" style="display:none">
|
||||
<input type="button" value="<?php echo LBL_ACTION_CLOSE; ?>" onclick="return cancelSelectFile();" class="button">
|
||||
</span>
|
||||
<span class="right" id="linkSearch">
|
||||
<input type="button" value="<?php echo BTN_SEARCH; ?>" onclick="return search();" class="button">
|
||||
</span>
|
||||
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
|
||||
<div id="ajaxLoading" style="display:none"><img class="ajaxLoadingImg" src="theme/<?php echo CONFIG_THEME_NAME; ?>/images/ajaxLoading.gif" /></div>
|
||||
<div id="winUpload" style="display:none">
|
||||
<div class="jqmContainer">
|
||||
<div class="jqmHeader">
|
||||
<a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
|
||||
</div>
|
||||
<div class="jqmBody">
|
||||
<form id="formUpload" name="formUpload" method="POST" enctype="multipart/form-data" action="">
|
||||
<table class="tableForm" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo FILE_FORM_TITLE; ?><a class="action" href="#" title="<?php echo FILE_LBL_MORE; ?>" onclick="return addMoreFile();"><span class="addMore"> </span></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="fileUploadBody">
|
||||
<tr style="display:none">
|
||||
<th><label><?php echo FILE_LABEL_SELECT; ?></label></th>
|
||||
<td><input type="file" class="input" name="file" /> <input type="button" class="button" value="<?php echo FILE_LBL_UPLOAD; ?>" /> <a href="#" class="action" title="Cancel" style="display:none" ><span class="cancel"> </span></a> <span class="uploadProcessing" style="display:none"> <span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="winNewFolder" style="display:none">
|
||||
<div class="jqmContainer">
|
||||
<div class="jqmHeader">
|
||||
<a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
|
||||
</div>
|
||||
<div class="jqmBody">
|
||||
<form id="formNewFolder" name="formNewFolder" method="POST" action="">
|
||||
<input type="hidden" name="currentFolderPath" value="" id="currentNewfolderPath" />
|
||||
<table class="tableForm" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo FOLDER_FORM_TITLE; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><label><?php echo FOLDER_LBL_TITLE; ?></label></th>
|
||||
<td><input type="text" name="new_folder" id="new_folder" value="" class="input"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<td><input type="button" value="<?php echo FOLDER_LBL_CREATE; ?>" class="button" onclick="return doCreateFolder();" /></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="winPlay" style="display:none">
|
||||
<div class="jqmContainer">
|
||||
<div class="jqmHeader">
|
||||
<a href="#" onclick="closeWinPlay();"><?php echo LBL_ACTION_CLOSE; ?></a>
|
||||
</div>
|
||||
<div class="jqmBody">
|
||||
<div id="playGround"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="winRename" style="display:none">
|
||||
<div class="jqmContainer">
|
||||
<div class="jqmHeader">
|
||||
<a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
|
||||
</div>
|
||||
<div class="jqmBody">
|
||||
<form id="formRename" name="formRename" method="POST" action="">
|
||||
<input type="hidden" name="original_path" id="original_path" />
|
||||
<input type="hidden" name="num" id="renameNum" value="" />
|
||||
<table class="tableForm" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo RENAME_FORM_TITLE; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><label><?php echo RENAME_NEW_NAME; ?></label></th>
|
||||
<td><input type="name" id="renameName" class="input" name="name" style="width:250px" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<td><input type="button" value="<?php echo RENAME_LBL_RENAME; ?>" class="button" onclick="return doRename();" /></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="winInfo" style="display:none">
|
||||
<div class="jqmContainer">
|
||||
<div class="jqmHeader">
|
||||
<a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
|
||||
</div>
|
||||
<div class="jqmBody">
|
||||
<table class="tableInfo" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th nowrap>
|
||||
<label>Author:</label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="mailto:cailongqun@yahoo.com.cn">Logan Cai</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th nowrap>
|
||||
<label>Template Designer:</label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="mailto:Gabriel@4v.com.br">Gabriel</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th nowrap>
|
||||
<label>Official Website:</label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="http://www.phpletter.com">http://www.phpletter.com</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th nowrap>
|
||||
<label>Support Forum:</label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="http://www.phpletter.com/forum/">http://www.phpletter.com/forum/</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th nowrap>
|
||||
<label>©Copyright:</label>
|
||||
</th>
|
||||
<td>
|
||||
All copyright declarations in the source must remain unchange. Please contact us if you need to make changes to it, in order to avoid any Legal Issues.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="contextMenu" style="display:none">
|
||||
<ul>
|
||||
<li><a href="#" class="contentMenuItem" id="menuSelect"><?php echo MENU_SELECT; ?></a></li>
|
||||
<li><a href="#" class="contentMenuItem" id="menuPreview"><?php echo MENU_PREVIEW; ?></a></li>
|
||||
<li><a href="#" class="contentMenuItem" id="menuDownload"><?php echo MENU_DOWNLOAD; ?></a></li>
|
||||
<li><a href="#" class="contentMenuItem" id="menuRename"><?php echo MENU_RENAME; ?></a></li>
|
||||
<li><a href="#" class="contentMenuItem" id="menuEdit"><?php echo MENU_EDIT; ?></a></li>
|
||||
<li><a href="#" class="contentMenuItem" id="menuCut"><?php echo MENU_CUT; ?></a></li>
|
||||
<li><a href="#" class="contentMenuItem" id="menuCopy"><?php echo MENU_COPY; ?></a></li>
|
||||
<li><a href="#" class="contentMenuItem" id="menuPaste"><?php echo MENU_PASTE; ?></a></li>
|
||||
<li><a href="#" class="contentMenuItem" id="menuDelete"><?php echo MENU_DELETE; ?></a></li>
|
||||
<li><a href="#" class="contentMenuItem" id="menuPlay"><?php echo MENU_PLAY; ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* the purpose I added this class is to make the file system much flexible
|
||||
* for customization.
|
||||
* Actually, this is a kind of interface and you should modify it to fit your system
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 4/August/2007
|
||||
*/
|
||||
class Auth
|
||||
{
|
||||
var $__loginIndexInSession = 'ajax_user';
|
||||
function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function Auth()
|
||||
{
|
||||
$this->__construct();
|
||||
}
|
||||
/**
|
||||
* check if the user has logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function isLoggedIn()
|
||||
{
|
||||
return (!empty($_SESSION[$this->__loginIndexInSession])?true:false);
|
||||
}
|
||||
/**
|
||||
* validate the username & password
|
||||
* @return boolean
|
||||
*
|
||||
*/
|
||||
function login()
|
||||
{
|
||||
if($_POST['username'] == CONFIG_LOGIN_USERNAME && $_POST['password'] == CONFIG_LOGIN_PASSWORD)
|
||||
{
|
||||
$_SESSION[$this->__loginIndexInSession] = true;
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,436 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* file modification
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/April/2007
|
||||
*
|
||||
*/
|
||||
class file
|
||||
{
|
||||
var $fileInfo = "";
|
||||
var $filePath = "";
|
||||
var $fileStat = "";
|
||||
var $mask = '0775';
|
||||
var $debug = false;
|
||||
var $errors = array();
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $path the path to a file or folder
|
||||
*/
|
||||
function __construct($path = null)
|
||||
{
|
||||
if(!is_null($path))
|
||||
{
|
||||
if(file_exists($path))
|
||||
{
|
||||
$this->filePath = $path;
|
||||
if(is_file($this->filePath))
|
||||
{
|
||||
$this->fileStat = @stat($path);
|
||||
$this->fileInfo['size'] = $this->fileStat[7];
|
||||
$this->fileInfo['atime'] = $this->fileStat[8];
|
||||
$this->fileInfo['ctime'] = $this->fileStat[10];
|
||||
$this->fileInfo['mtime'] = $this->fileStat[9];
|
||||
$this->fileInfo['path'] = $path;
|
||||
$this->fileInfo['name'] = basename($path);
|
||||
$this->fileInfo['is_writable'] = $this->isWritable();
|
||||
$this->fileInfo['is_readable'] = $this->isReadable();
|
||||
}elseif(is_dir($this->filePath))
|
||||
{
|
||||
$this->fileStat = @stat($path);
|
||||
$this->fileInfo['name'] = basename($path);
|
||||
$this->fileInfo['path'] = $path;
|
||||
$this->fileInfo['atime'] = $this->fileStat[8];
|
||||
$this->fileInfo['ctime'] = $this->fileStat[10];
|
||||
$this->fileInfo['mtime'] = $this->fileStat[9];
|
||||
$this->fileInfo['is_writable'] = $this->isWritable();
|
||||
$this->fileInfo['is_readable'] = $this->isReadable();
|
||||
}
|
||||
}else
|
||||
{
|
||||
trigger_error('No such file exists. ' . $path, E_USER_NOTICE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* contructor
|
||||
*
|
||||
* @param string $path
|
||||
*/
|
||||
function file($path=null)
|
||||
{
|
||||
$this->__construct($path);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check if a file or folder writable
|
||||
*
|
||||
* @param file path $path
|
||||
* @return boolean
|
||||
*/
|
||||
function isWritable($path=null)
|
||||
{
|
||||
$path = (is_null($path)?$this->filePath:$path);
|
||||
if (DIRECTORY_SEPARATOR == "\\")
|
||||
{
|
||||
$path = slashToBackslash($path);
|
||||
if(is_file($path))
|
||||
{
|
||||
$fp = @fopen($path,'ab');
|
||||
if($fp)
|
||||
{
|
||||
@fclose($fp);
|
||||
return true;
|
||||
}
|
||||
}elseif(is_dir($path))
|
||||
{
|
||||
$path = addTrailingSlash($path);
|
||||
$tmp = uniqid(time());
|
||||
if (@touch($path . $tmp))
|
||||
{
|
||||
@unlink($path . $tmp);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}else
|
||||
{
|
||||
return @is_writable(slashToBackslash($path));
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Returns true if the files is readable.
|
||||
*
|
||||
* @return boolean true if the files is readable.
|
||||
*/
|
||||
function isReadable($path =null)
|
||||
{
|
||||
$path = is_null($path)?$this->filePath:$path;
|
||||
return @is_readable(slashToBackslash($path));
|
||||
}
|
||||
/**
|
||||
* change the modified time
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $time
|
||||
* @return boolean
|
||||
*/
|
||||
function setLastModified($path=null, $time)
|
||||
{
|
||||
$path = is_null($path)?$this->filePath:$path;
|
||||
$time = is_null($time)?time():$time;
|
||||
return @touch(slashToBackslash($path), $time);
|
||||
}
|
||||
|
||||
/**
|
||||
* create a new folder
|
||||
*
|
||||
* @path the path for the new folder
|
||||
* @mask
|
||||
* @dirOwner
|
||||
* @return boolean
|
||||
*/
|
||||
function mkdir($path = null, $mask=null, $dirOwner='')
|
||||
{
|
||||
$path = is_null($path)?$this->filePath:$path;
|
||||
if(!file_exists($path))
|
||||
{
|
||||
$mask = is_null($mask)?$this->mask:$mask;
|
||||
$status = @mkdir(slashToBackslash($path));
|
||||
if ($mask)
|
||||
{
|
||||
@chmod(slashToBackslash($path), intval($mask, 8));
|
||||
}
|
||||
if($dirOwner)
|
||||
{
|
||||
$this->chown(slashToBackslash($path), $dirOwner);
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
/**
|
||||
* change the own of a file or folder
|
||||
*
|
||||
* @param the file path $path
|
||||
* @param $owner
|
||||
*/
|
||||
function chown($path, $owner)
|
||||
{
|
||||
if(!empty($owner))
|
||||
{
|
||||
$owners = explode(":", $owner);
|
||||
if(!empty($owners[0]))
|
||||
@chown($path, $owners[0]);
|
||||
if(!empty($owners[1]))
|
||||
@chgrp($path, $owner[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a file, or recursively copy a folder and its contents
|
||||
* @author Aidan Lister <aidan@php.net>
|
||||
* @author Paul Scott
|
||||
* @version 1.0.1
|
||||
* @param string $source Source path
|
||||
* @param string $dest Destination path
|
||||
* @return bool Returns TRUE on success, FALSE on failure
|
||||
*/
|
||||
function copyTo($source, $dest)
|
||||
{
|
||||
$source = removeTrailingSlash(backslashToSlash($source));
|
||||
$dest = removeTrailingSlash(backslashToSlash($dest));
|
||||
if(!file_exists($dest) || !is_dir($dest))
|
||||
{
|
||||
if(!$this->mkdir($dest))
|
||||
{
|
||||
$this->_debug('Unable to create folder (' . $dest . ")");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Copy in to your self?
|
||||
if (getAbsPath($source) == getAbsPath($dest))
|
||||
{
|
||||
$this->_debug('Unable to copy itself. source: ' . getAbsPath($source) . "; dest: " . getAbsPath($dest));
|
||||
return false;
|
||||
}
|
||||
// Simple copy for a file
|
||||
if (is_file($source))
|
||||
{
|
||||
$dest = addTrailingSlash($dest) . (basename($source));
|
||||
if(file_exists($dest))
|
||||
{
|
||||
return false;
|
||||
}else {
|
||||
|
||||
return copy($source, $dest);
|
||||
}
|
||||
|
||||
|
||||
}elseif(is_dir($source))
|
||||
{
|
||||
// Loop through the folder
|
||||
if(file_exists(addTrailingSlash($dest) . basename($source)))
|
||||
{
|
||||
return false;
|
||||
}else
|
||||
{
|
||||
if(!file_exists(addTrailingSlash($dest) . basename($source)) || !is_dir(addTrailingSlash($dest) . basename($source)))
|
||||
{
|
||||
if(!$this->mkdir(addTrailingSlash($dest) . basename($source)))
|
||||
{
|
||||
$this->_debug('Unable to create folder (' . addTrailingSlash($dest) . basename($source) . ")");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$handle = opendir($source);
|
||||
while(false !== ($readdir = readdir($handle)))
|
||||
{
|
||||
if($readdir != '.' && $readdir != '..')
|
||||
{
|
||||
$path = addTrailingSlash($source).'/'.$readdir;
|
||||
$this->copyTo($path, addTrailingSlash($dest) . basename($source));
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* get next available file name
|
||||
*
|
||||
* @param string $fileToMove the path of the file will be moved to
|
||||
* @param string $destFolder the path of destination folder
|
||||
* @return string
|
||||
*/
|
||||
function getNextAvailableFileName($fileToMove, $destFolder)
|
||||
{
|
||||
|
||||
$folderPath = addslashes(backslashToSlash(getParentPath($fileToMove)));
|
||||
$destFolder = addslashes(backslashToSlash(getParentPath($destFolder)));
|
||||
$finalPath = $destFolder . basename($fileToMove);
|
||||
if(file_exists($fileToMove))
|
||||
{
|
||||
if(is_file())
|
||||
{
|
||||
$fileExt = getFileExt($fileToMove);
|
||||
$fileBaseName = basename($fileToMove, '.' . $fileExt);
|
||||
$count = 1;
|
||||
while(file_exists($destFolder . $fileBaseName . $count . "." . $fileExt))
|
||||
{
|
||||
$count++;
|
||||
}
|
||||
$filePath = $destFolder . $fileBaseName . $count . "." . $fileExt;
|
||||
}elseif(is_dir())
|
||||
{
|
||||
$folderName = basename($fileToMove);
|
||||
$count = 1;
|
||||
while(file_exists($destFolder . $folderName . $count))
|
||||
{
|
||||
$count++;
|
||||
}
|
||||
$filePath = $destFolder . $fileBaseName . $count;
|
||||
}
|
||||
|
||||
}
|
||||
return $finalPath;
|
||||
}
|
||||
/**
|
||||
* get file information
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getFileInfo()
|
||||
{
|
||||
return $this->fileInfo;
|
||||
}
|
||||
/**
|
||||
* close
|
||||
*
|
||||
*/
|
||||
function close()
|
||||
{
|
||||
$this->fileInfo = null;
|
||||
$this->fileStat = null;
|
||||
}
|
||||
/**
|
||||
* delete a file or a folder and all contents within that folder
|
||||
*
|
||||
* @param string $path
|
||||
* @return boolean
|
||||
*/
|
||||
function delete($path = null)
|
||||
{
|
||||
$path = is_null($path)?$this->filePath:$path;
|
||||
if(file_exists($path))
|
||||
{
|
||||
if(is_file($path))
|
||||
{
|
||||
return @unlink($path);
|
||||
}elseif(is_dir($path))
|
||||
{
|
||||
return $this->__recursive_remove_directory($path);
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* empty a folder
|
||||
*
|
||||
* @param string $path
|
||||
* @return boolean
|
||||
*/
|
||||
function emptyFolder($path)
|
||||
{
|
||||
$path = is_null($path)?$this->filePath:"";
|
||||
if(file_exists($path) && is_dir($path))
|
||||
{
|
||||
return $this->__recursive_remove_directory($path, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function _debug($info)
|
||||
{
|
||||
if($this->debug)
|
||||
{
|
||||
echo $info . "<br>\n";
|
||||
}else
|
||||
{
|
||||
$this->errors[] = $info;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* recursive_remove_directory( directory to delete, empty )
|
||||
* expects path to directory and optional TRUE / FALSE to empty
|
||||
* of course PHP has to have the rights to delete the directory
|
||||
* you specify and all files and folders inside the directory
|
||||
*
|
||||
* to use this function to totally remove a directory, write:
|
||||
* recursive_remove_directory('path/to/directory/to/delete');
|
||||
* to use this function to empty a directory, write:
|
||||
* recursive_remove_directory('path/to/full_directory',TRUE);
|
||||
* @param string $directory
|
||||
* @param boolean $empty
|
||||
* @return boolean
|
||||
*/
|
||||
function __recursive_remove_directory($directory, $empty=FALSE)
|
||||
{
|
||||
// if the path has a slash at the end we remove it here
|
||||
if(substr($directory,-1) == '/')
|
||||
{
|
||||
$directory = substr($directory,0,-1);
|
||||
}
|
||||
|
||||
// if the path is not valid or is not a directory ...
|
||||
if(!file_exists($directory) || !is_dir($directory))
|
||||
{
|
||||
// ... we return false and exit the function
|
||||
return FALSE;
|
||||
|
||||
// ... if the path is not readable
|
||||
}elseif(!is_readable($directory))
|
||||
{
|
||||
// ... we return false and exit the function
|
||||
return FALSE;
|
||||
|
||||
// ... else if the path is readable
|
||||
}else{
|
||||
|
||||
// we open the directory
|
||||
$handle = @opendir($directory);
|
||||
|
||||
// and scan through the items inside
|
||||
while (FALSE !== ($item = @readdir($handle)))
|
||||
{
|
||||
// if the filepointer is not the current directory
|
||||
// or the parent directory
|
||||
if($item != '.' && $item != '..')
|
||||
{
|
||||
// we build the new path to delete
|
||||
$path = $directory.'/'.$item;
|
||||
|
||||
// if the new path is a directory
|
||||
if(is_dir($path)) {
|
||||
// we call this function with the new path
|
||||
$this->__recursive_remove_directory($path);
|
||||
|
||||
// if the new path is a file
|
||||
}else{
|
||||
// we remove the file
|
||||
@unlink($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
// close the directory
|
||||
@closedir($handle);
|
||||
|
||||
// if the option to empty is not set to true
|
||||
if($empty == FALSE)
|
||||
{
|
||||
// try to delete the now empty directory
|
||||
if(!@rmdir($directory))
|
||||
{
|
||||
// return false if not possible
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
// return success
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,155 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* class history
|
||||
* this class used to keep records of any changed to uploaded images under a session
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
class History
|
||||
{
|
||||
var $history = array(); //keep all changes
|
||||
var $path = ''; //path to the iamge
|
||||
var $session = null;
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $path the path to the image
|
||||
* @param object $session an instance of session class
|
||||
*/
|
||||
function __construct($path, &$session)
|
||||
{
|
||||
$this->path = $path;
|
||||
$this->session = &$session;
|
||||
if(!isset($_SESSION[$this->path]))
|
||||
{
|
||||
$_SESSION[$this->path] = array();
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $path the path to the image
|
||||
* @param object $session an instance of session class
|
||||
*/
|
||||
function History($path, &$session)
|
||||
{
|
||||
$this->__construct($path, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* keep tracks of each changes made to an image
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $info array('name', 'restorable', 'is_original')
|
||||
*/
|
||||
function add($info)
|
||||
{
|
||||
$_SESSION[$this->path][] = $info;
|
||||
}
|
||||
/**
|
||||
* get the lastest changes for restore
|
||||
*
|
||||
* @return array array('name', 'restorable', 'is_original')
|
||||
*/
|
||||
function getNumRestorable()
|
||||
{
|
||||
$output = 0;
|
||||
if(isset($_SESSION[$this->path]) && is_array($_SESSION[$this->path]))
|
||||
{
|
||||
foreach($_SESSION[$this->path] as $k=>$v)
|
||||
{
|
||||
if(!empty($v['restorable']) && empty($v['is_original']))
|
||||
{
|
||||
if(file_exists($this->session->getSessionDir() . $v['name']))
|
||||
{
|
||||
$output++;
|
||||
}else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the path of image which keep the lastest changes
|
||||
*
|
||||
* @return return empty array when failed
|
||||
*/
|
||||
function getLastestRestorable()
|
||||
{
|
||||
if(isset($_SESSION[$this->path]) && is_array($_SESSION[$this->path]) && sizeof($_SESSION[$this->path]))
|
||||
{
|
||||
$sessionImages = array_reverse($_SESSION[$this->path], true);
|
||||
$lastestKey = '';
|
||||
foreach($sessionImages as $k=>$v)
|
||||
{
|
||||
if($v['restorable'] && empty($v['is_original']) && file_exists($this->session->getSessionDir() . $v['name']))
|
||||
{
|
||||
return $sessionImages[$k];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return array();
|
||||
|
||||
}
|
||||
/**
|
||||
* get the original image which is kept in the session folder
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getOriginalImage()
|
||||
{
|
||||
$outputs = array();
|
||||
if(isset($_SESSION[$this->path]) && is_array($_SESSION[$this->path]))
|
||||
{
|
||||
$sessionImages = array_reverse($_SESSION[$this->path], true);
|
||||
foreach($sessionImages as $k=>$v)
|
||||
{
|
||||
if(!empty($v['is_original']))
|
||||
{
|
||||
if(file_exists($this->session->getSessionDir() . $v['name']))
|
||||
{
|
||||
return array('info'=>$_SESSION[$this->path][$k], 'key'=>$k);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return $outputs;
|
||||
|
||||
}
|
||||
/**
|
||||
* remove the lastest restorable state
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function restore()
|
||||
{
|
||||
if(isset($_SESSION[$this->path]) && is_array($_SESSION[$this->path]) && sizeof($_SESSION[$this->path]))
|
||||
{
|
||||
$sessionImages = array_reverse($_SESSION[$this->path], true);
|
||||
$lastestKey = '';
|
||||
foreach($sessionImages as $k=>$v)
|
||||
{
|
||||
if($v['restorable'] && empty($v['is_original']))
|
||||
{
|
||||
unset($_SESSION[$k]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,789 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* this class provide functions to edit an image, e.g. resize, rotate, flip, crop
|
||||
* @author Logan Cai cailongqun [at] yahoo [dot] com [dot] cn
|
||||
* @link www.phpletter.com
|
||||
* @version 0.9
|
||||
* @since 14/May/2007
|
||||
* @name Image
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
class Image
|
||||
{
|
||||
var $_debug = false;
|
||||
var $_errors = array();
|
||||
var $gdInfo = array(); //keep all information of GD extension
|
||||
var $_imgOrig = null; //the hanlder of original image
|
||||
var $_imgFinal = null; //the handler of final image
|
||||
var $imageFile = null;
|
||||
var $transparentColorRed = null;
|
||||
var $transparentColorGreen = null;
|
||||
var $transparentColorBlue = null;
|
||||
var $chmod = 0755;
|
||||
var $_imgInfoOrig = array(
|
||||
'name'=>'',
|
||||
'ext'=>'',
|
||||
'size'=>'',
|
||||
'width'=>'',
|
||||
'height'=>'',
|
||||
'type'=>'',
|
||||
'path'=>'',
|
||||
);
|
||||
var $_imgInfoFinal = array(
|
||||
'name'=>'',
|
||||
'ext'=>'',
|
||||
'size'=>'',
|
||||
'width'=>'',
|
||||
'height'=>'',
|
||||
'type'=>'',
|
||||
'path'=>'',
|
||||
);
|
||||
var $_imgQuality = 90;
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param boolean $debug
|
||||
* @return Image
|
||||
*/
|
||||
|
||||
function __construct($debug = false)
|
||||
{
|
||||
$this->enableDebug($debug);
|
||||
$this->gdInfo = $this->getGDInfo();
|
||||
}
|
||||
function Image($debug = false)
|
||||
{
|
||||
$this->__construct($debug);
|
||||
}
|
||||
/**
|
||||
* enable to debug
|
||||
*
|
||||
* @param boolean $value
|
||||
*/
|
||||
function enableDebug($value)
|
||||
{
|
||||
$this->_debug = ($value?true:false);
|
||||
}
|
||||
/**
|
||||
* check if debug enable
|
||||
* @return boolean
|
||||
*/
|
||||
function _isDebugEnable()
|
||||
{
|
||||
return $this->_debug;
|
||||
}
|
||||
|
||||
/**
|
||||
* append to errors array and shown the each error when the debug turned on
|
||||
*
|
||||
* @param string $string
|
||||
* @return void
|
||||
* @access private
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function _debug($value)
|
||||
{
|
||||
$this->_errors[] = $value;
|
||||
if ($this->_debug)
|
||||
{
|
||||
echo $value . "<br />\n";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* show erros
|
||||
*
|
||||
*/
|
||||
function showErrors()
|
||||
{
|
||||
if(sizeof($this->_errors))
|
||||
{
|
||||
foreach($this->_errors as $error)
|
||||
{
|
||||
echo $error . "<br />\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Load an image from the file system.
|
||||
*
|
||||
* @param string $filename
|
||||
* @return bool
|
||||
* @access public
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function loadImage($filename)
|
||||
{
|
||||
$ext = strtolower($this->_getExtension($filename));
|
||||
$func = 'imagecreatefrom' . ($ext == 'jpg' ? 'jpeg' : $ext);
|
||||
if (!$this->_isSupported($filename, $ext, $func, false)) {
|
||||
return false;
|
||||
}
|
||||
if($ext == "gif")
|
||||
{
|
||||
// the following part gets the transparency color for a gif file
|
||||
// this code is from the PHP manual and is written by
|
||||
// fred at webblake dot net and webmaster at webnetwizard dotco dotuk, thanks!
|
||||
$fp = @fopen($filename, "rb");
|
||||
$result = @fread($fp, 13);
|
||||
$colorFlag = ord(substr($result,10,1)) >> 7;
|
||||
$background = ord(substr($result,11));
|
||||
if ($colorFlag) {
|
||||
$tableSizeNeeded = ($background + 1) * 3;
|
||||
$result = @fread($fp, $tableSizeNeeded);
|
||||
$this->transparentColorRed = ord(substr($result, $background * 3, 1));
|
||||
$this->transparentColorGreen = ord(substr($result, $background * 3 + 1, 1));
|
||||
$this->transparentColorBlue = ord(substr($result, $background * 3 + 2, 1));
|
||||
}
|
||||
fclose($fp);
|
||||
// -- here ends the code related to transparency handling
|
||||
}
|
||||
$this->_imgOrig = @$func($filename);
|
||||
if ($this->_imgOrig == null) {
|
||||
$this->_debug("The image could not be created from the '$filename' file using the '$func' function.");
|
||||
return false;
|
||||
}else
|
||||
{
|
||||
$this->imageFile = $filename;
|
||||
$this->_imgInfoOrig = array(
|
||||
'name'=>basename($filename),
|
||||
'ext'=>$ext,
|
||||
'size'=>filesize($filename),
|
||||
'path'=>$filename,
|
||||
);
|
||||
$imgInfo = $this->_getImageInfo($filename);
|
||||
if(sizeof($imgInfo))
|
||||
{
|
||||
foreach($imgInfo as $k=>$v)
|
||||
{
|
||||
$this->_imgInfoOrig[$k] = $v;
|
||||
$this->_imgInfoFinal[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an image from a string (eg. from a database table)
|
||||
*
|
||||
* @param string $string
|
||||
* @return bool
|
||||
* @access public
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function loadImageFromString($string)
|
||||
{
|
||||
$this->imageFile = $filename;
|
||||
$this->_imgOrig = imagecreatefromstring($string);
|
||||
if (!$this->_imgOrig) {
|
||||
$this->_debug('The image (supplied as a string) could not be created.');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save the modified image
|
||||
*
|
||||
* @param string $filename
|
||||
* @param int $quality
|
||||
* @param string $forcetype
|
||||
* @return bool
|
||||
* @access public
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function saveImage($filename, $quality = 90, $forcetype = '')
|
||||
{
|
||||
if ($this->_imgFinal == null) {
|
||||
$this->_debug('No changes intend to be made.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$ext = ($forcetype == '') ? $this->_getExtension($filename) : strtolower($forcetype);
|
||||
$func = 'image' . ($ext == 'jpg' ? 'jpeg' : $ext);
|
||||
if (!$this->_isSupported($filename, $ext, $func, true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$saved = false;
|
||||
switch($ext)
|
||||
{
|
||||
case 'gif':
|
||||
if ($this->gdInfo['Truecolor Support'] && imageistruecolor($this->_imgFinal))
|
||||
{
|
||||
imagetruecolortopalette($this->_imgFinal, false, 255);
|
||||
}
|
||||
case 'png':
|
||||
$saved = $func($this->_imgFinal, $filename);
|
||||
break;
|
||||
case 'jpg':
|
||||
$saved = $func($this->_imgFinal, $filename, $quality);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($saved === false)
|
||||
{
|
||||
$this->_debug("The image could not be saved to the '$filename' file as the file type '$ext' using the '$func' function.");
|
||||
return false;
|
||||
}else
|
||||
{
|
||||
$this->_imgInfoFinal['size'] = @filesize($filename);
|
||||
@chmod($filename, intval($this->chmod, 8));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Shows the masked image without any saving
|
||||
*
|
||||
* @param string $type
|
||||
* @param int $quality
|
||||
* @return bool
|
||||
* @access public
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function showImage($type = '', $quality = '')
|
||||
{
|
||||
if ($this->_imgFinal == null) {
|
||||
$this->_debug('There is no cropped image to show.');
|
||||
return false;
|
||||
}
|
||||
$type = (!empty($type)?$type:$this->_imgInfoOrig['ext']);
|
||||
$quality = (!empty($quality)?$quality:$this->_imgQuality);
|
||||
|
||||
$type = strtolower($type);
|
||||
$func = 'image' . ($type == 'jpg' ? 'jpeg' : $type);
|
||||
$head = 'image/' . ($type == 'jpg' ? 'jpeg' : $type);
|
||||
|
||||
if (!$this->_isSupported('[showing file]', $type, $func, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
header("Content-type: $head");
|
||||
switch($type)
|
||||
{
|
||||
case 'gif':
|
||||
if ($this->gdInfo['Truecolor Support'] && imageistruecolor($this->_imgFinal))
|
||||
{
|
||||
@imagetruecolortopalette($this->_imgFinal, false, 255);
|
||||
}
|
||||
case 'png':
|
||||
$func($this->_imgFinal);
|
||||
break;
|
||||
case 'jpg':
|
||||
$func($this->_imgFinal, '', $quality);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for cropping image
|
||||
*
|
||||
* @param int $dst_x
|
||||
* @param int $dst_y
|
||||
* @param int $dst_w
|
||||
* @param int $dst_h
|
||||
* @return bool
|
||||
* @access public
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function crop($dst_x, $dst_y, $dst_w, $dst_h)
|
||||
{
|
||||
if ($this->_imgOrig == null) {
|
||||
$this->_debug('The original image has not been loaded.');
|
||||
return false;
|
||||
}
|
||||
if (($dst_w <= 0) || ($dst_h <= 0)) {
|
||||
$this->_debug('The image could not be cropped because the size given is not valid.');
|
||||
return false;
|
||||
}
|
||||
if (($dst_w > imagesx($this->_imgOrig)) || ($dst_h > imagesy($this->_imgOrig))) {
|
||||
$this->_debug('The image could not be cropped because the size given is larger than the original image.');
|
||||
return false;
|
||||
}
|
||||
$this->_createFinalImageHandler($dst_w, $dst_h);
|
||||
if ($this->gdInfo['Truecolor Support'])
|
||||
{
|
||||
if(!@imagecopyresampled($this->_imgFinal, $this->_imgOrig, 0, 0, $dst_x, $dst_y, $dst_w, $dst_h, $dst_w, $dst_h))
|
||||
{
|
||||
$this->_debug('Unable crop the image.');
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(!@imagecopyresized($this->_imgFinal, $this->_imgOrig, 0, 0, $dst_x, $dst_y, $dst_w, $dst_h, $dst_w, $dst_h))
|
||||
{
|
||||
$this->_debug('Unable crop the image.');
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
$this->_imgInfoFinal['width'] = $dst_w;
|
||||
$this->_imgInfoFinal['height'] = $dst_h;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resize the Image in the X and/or Y direction
|
||||
* If either is 0 it will be scaled proportionally
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $new_x
|
||||
* @param mixed $new_y
|
||||
* @param boolean $constraint keep to resize the image proportionally
|
||||
* @param boolean $unchangeIfsmaller keep the orignial size if the orignial smaller than the new size
|
||||
*
|
||||
*
|
||||
* @return mixed none or PEAR_error
|
||||
*/
|
||||
function resize( $new_x, $new_y, $constraint= false, $unchangeIfsmaller=false)
|
||||
{
|
||||
if(!$this->_imgOrig)
|
||||
{
|
||||
$this->_debug('No image fould.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$new_x = (int)($new_x);
|
||||
$new_y = (int)($new_y);
|
||||
if($new_x <=0 || $new_y <= 0)
|
||||
{
|
||||
$this->_debug('either of new width or height can be zeor or less.');
|
||||
}else
|
||||
{
|
||||
|
||||
if($constraint)
|
||||
{
|
||||
if($new_x < 1 && $new_y < 1)
|
||||
{
|
||||
$new_x = $this->_imgInfoOrig['width'];
|
||||
$new_y = $this->_imgInfoOrig['height'];
|
||||
}elseif($new_x < 1)
|
||||
{
|
||||
$new_x = floor($new_y / $this->_imgInfoOrig['height'] * $this->_imgInfoOrig['width']);
|
||||
|
||||
}elseif($new_y < 1)
|
||||
{
|
||||
$new_y = floor($new_x / $this->_imgInfoOrig['width'] * $this->_imgInfoOrig['height']);
|
||||
}else
|
||||
{
|
||||
$scale = min($new_x/$this->_imgInfoOrig['width'], $new_y/$this->_imgInfoOrig['height']) ;
|
||||
$new_x = floor($scale*$this->_imgInfoOrig['width']);
|
||||
$new_y = floor($scale*$this->_imgInfoOrig['height']);
|
||||
}
|
||||
}
|
||||
if($unchangeIfsmaller)
|
||||
{
|
||||
if($this->_imgInfoOrig['width'] < $new_x && $this->_imgInfoOrig['height'] < $new_y )
|
||||
{
|
||||
$new_x = $this->_imgInfoOrig['width'];
|
||||
$new_y = $this->_imgInfoOrig['height'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(is_null($this->_imgOrig))
|
||||
{
|
||||
$this->loadImage($filePath);
|
||||
}
|
||||
if(sizeof($this->_errors) == 0)
|
||||
{
|
||||
return $this->_resize($new_x, $new_y);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
} // End resize
|
||||
/**
|
||||
* resize the image and return the thumbnail image details array("width"=>, "height"=>, "name")
|
||||
*
|
||||
* @param string $fileName
|
||||
* @param int $new_x the thumbnail width
|
||||
* @param int $new_y the thumbnail height
|
||||
* @param string $mode can be save, view and both
|
||||
* @return unknown
|
||||
*/
|
||||
function _resize( $new_x, $new_y)
|
||||
{
|
||||
$this->_createFinalImageHandler($new_x, $new_y);
|
||||
// hacks fot transparency of png24 files
|
||||
if ($this->_imgInfoOrig['type'] == 'png')
|
||||
{
|
||||
@imagealphablending($this->_imgFinal, false);
|
||||
if(function_exists('ImageCopyResampled'))
|
||||
{
|
||||
@ImageCopyResampled($this->_imgFinal, $this->_imgOrig, 0, 0, 0, 0, $new_x, $new_y, $this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']);
|
||||
} else {
|
||||
@ImageCopyResized($this->_imgFinal, $this->_imgOrig, 0, 0, 0, 0, $new_x, $new_y, $this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']);
|
||||
}
|
||||
@imagesavealpha($this->_imgFinal, true);
|
||||
|
||||
}else
|
||||
{//for the rest image
|
||||
if(function_exists('ImageCopyResampled'))
|
||||
{
|
||||
@ImageCopyResampled($this->_imgFinal, $this->_imgOrig, 0, 0, 0, 0, $new_x, $new_y, $this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']);
|
||||
} else {
|
||||
@ImageCopyResized($this->_imgFinal, $this->_imgOrig, 0, 0, 0, 0, $new_x, $new_y, $this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->_imgInfoFinal['width'] = $new_x;
|
||||
$this->_imgInfoFinal['height'] = $new_y;
|
||||
$this->_imgInfoFinal['name'] = basename($this->_imgInfoOrig['name']);
|
||||
$this->_imgInfoFinal['path'] = $this->_imgInfoOrig['path'];
|
||||
if($this->_imgFinal)
|
||||
{
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
$this->_debug('Unable to resize the image on the fly.');
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Get the extension of a file name
|
||||
*
|
||||
* @param string $file
|
||||
* @return string
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function _getExtension($file)
|
||||
{
|
||||
$ext = '';
|
||||
if (strrpos($file, '.')) {
|
||||
$ext = strtolower(substr($file, (strrpos($file, '.') ? strrpos($file, '.') + 1 : strlen($file)), strlen($file)));
|
||||
}
|
||||
return $ext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate whether image reading/writing routines are valid.
|
||||
*
|
||||
* @param string $filename
|
||||
* @param string $extension
|
||||
* @param string $function
|
||||
* @param bool $write
|
||||
* @return bool
|
||||
* @access private
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function _isSupported($filename, $extension, $function, $write = false)
|
||||
{
|
||||
|
||||
$giftype = ($write) ? ' Create Support' : ' Read Support';
|
||||
$support = strtoupper($extension) . ($extension == 'gif' ? $giftype : ' Support');
|
||||
|
||||
if (!isset($this->gdInfo[$support]) || $this->gdInfo[$support] == false) {
|
||||
$request = ($write) ? 'saving' : 'reading';
|
||||
$this->_debug("Support for $request the file type '$extension' cannot be found.");
|
||||
return false;
|
||||
}
|
||||
if (!function_exists($function)) {
|
||||
$request = ($write) ? 'save' : 'read';
|
||||
$this->_debug("The '$function' function required to $request the '$filename' file cannot be found.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* flip image horizotally or vertically
|
||||
*
|
||||
* @param string $direction
|
||||
* @return boolean
|
||||
*/
|
||||
function flip($direction="horizontal")
|
||||
{
|
||||
$this->_createFinalImageHandler($this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']);
|
||||
if($direction != "vertical")
|
||||
{
|
||||
$dst_x = 0;
|
||||
$dst_y = 0;
|
||||
$src_x = $this->_imgInfoOrig['width'] -1;
|
||||
$src_y = 0;
|
||||
$dst_w = $this->_imgInfoOrig['width'];
|
||||
$dst_h = $this->_imgInfoOrig['height'];
|
||||
$src_w = 0 - $this->_imgInfoOrig['width'];
|
||||
$src_h = $this->_imgInfoOrig['height'];
|
||||
|
||||
}else
|
||||
{
|
||||
$dst_x = 0;
|
||||
$dst_y = 0;
|
||||
$src_x = 0;
|
||||
$src_y = $this->_imgInfoOrig['height'] - 1;
|
||||
$dst_w = $this->_imgInfoOrig['width'];
|
||||
$dst_h = $this->_imgInfoOrig['height'];
|
||||
$src_w = $this->_imgInfoOrig['width'];
|
||||
$src_h = 0 - $this->_imgInfoOrig['height'];
|
||||
}
|
||||
if(function_exists('ImageCopyResampled')){
|
||||
ImageCopyResampled($this->_imgFinal, $this->_imgOrig, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
||||
} else {
|
||||
ImageCopyResized($this->_imgFinal, $this->_imgOrig, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
||||
}
|
||||
$this->_imgInfoFinal['width'] = $dst_w;
|
||||
$this->_imgInfoFinal['height'] = $dst_h;
|
||||
$this->_imgInfoFinal['name'] = basename($this->imageFile);
|
||||
$this->_imgInfoFinal['path'] = $this->imageFile;
|
||||
if($this->_imgFinal)
|
||||
{
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
$this->_debug('Unable to resize the image on the fly.');
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* flip vertically
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function flipVertical()
|
||||
{
|
||||
return $this->flip('vertical');
|
||||
}
|
||||
/**
|
||||
* flip horizontal
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function flipHorizontal()
|
||||
{
|
||||
return $this->flip('horizontal');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get the GD version information
|
||||
*
|
||||
* @param bool $versionOnly
|
||||
* @return array
|
||||
* @access private
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function getGDInfo($versionOnly = false)
|
||||
{
|
||||
$outputs = array();
|
||||
if (function_exists('gd_info'))
|
||||
{
|
||||
$outputs = gd_info();
|
||||
} else
|
||||
{
|
||||
$gd = array(
|
||||
'GD Version' => '',
|
||||
'GIF Read Support' => false,
|
||||
'GIF Create Support' => false,
|
||||
'JPG Support' => false,
|
||||
'PNG Support' => false,
|
||||
'FreeType Support' => false,
|
||||
'FreeType Linkage' => '',
|
||||
'T1Lib Support' => false,
|
||||
'WBMP Support' => false,
|
||||
'XBM Support' => false
|
||||
);
|
||||
ob_start();
|
||||
phpinfo();
|
||||
$buffer = ob_get_contents();
|
||||
ob_end_clean();
|
||||
foreach (explode("\n", $buffer) as $line) {
|
||||
$line = array_map('trim', (explode('|', strip_tags(str_replace('</td>', '|', $line)))));
|
||||
if (isset($gd[$line[0]])) {
|
||||
if (strtolower($line[1]) == 'enabled') {
|
||||
$gd[$line[0]] = true;
|
||||
} else {
|
||||
$gd[$line[0]] = $line[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
$outputs = $gd;
|
||||
}
|
||||
|
||||
if (isset($outputs['JIS-mapped Japanese Font Support'])) {
|
||||
unset($outputs['JIS-mapped Japanese Font Support']);
|
||||
}
|
||||
if (function_exists('imagecreatefromgd')) {
|
||||
$outputs['GD Support'] = true;
|
||||
}
|
||||
if (function_exists('imagecreatefromgd2')) {
|
||||
$outputs['GD2 Support'] = true;
|
||||
}
|
||||
if (preg_match('/^(bundled|2)/', $outputs['GD Version'])) {
|
||||
$outputs['Truecolor Support'] = true;
|
||||
} else {
|
||||
$outputs['Truecolor Support'] = false;
|
||||
}
|
||||
if ($outputs['GD Version'] != '') {
|
||||
$match = array();
|
||||
if (preg_match('/([0-9\.]+)/', $outputs['GD Version'], $match)) {
|
||||
$foo = explode('.', $match[0]);
|
||||
$outputs['Version'] = array('major' => isset($foo[0])?$foo[0]:'', 'minor' => isset($foo[1])?$foo[1]:'', 'patch' => isset($foo[2])?$foo:"");
|
||||
}
|
||||
}
|
||||
|
||||
return ($versionOnly) ? $outputs['Version'] : $outputs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the resources used by the images.
|
||||
*
|
||||
* @param bool $original
|
||||
* @return void
|
||||
* @access public
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function DestroyImages($original = true)
|
||||
{
|
||||
if(!is_null($this->_imgFinal))
|
||||
{
|
||||
@imagedestroy($this->_imgFinal);
|
||||
}
|
||||
$this->_imgFinal = null;
|
||||
if ($original && !is_null($this->_imgOrig)) {
|
||||
@imagedestroy($this->_imgOrig);
|
||||
$this->_imgOrig = null;
|
||||
}
|
||||
}
|
||||
|
||||
function getImageInfo($imagePath)
|
||||
{
|
||||
return $this->_getImageInfo($imagePath);
|
||||
}
|
||||
/**
|
||||
* get image information, e.g. width, height, type
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
function _getImageInfo($imagePath)
|
||||
{
|
||||
$outputs = array();
|
||||
$imageInfo = @GetImageSize($imagePath);
|
||||
if ($imageInfo && is_array($imageInfo))
|
||||
{
|
||||
switch($imageInfo[2]){
|
||||
case 1:
|
||||
$type = 'gif';
|
||||
break;
|
||||
case 2:
|
||||
$type = 'jpeg';
|
||||
break;
|
||||
case 3:
|
||||
$type = 'png';
|
||||
break;
|
||||
case 4:
|
||||
$type = 'swf';
|
||||
break;
|
||||
case 5:
|
||||
$type = 'psd';
|
||||
case 6:
|
||||
$type = 'bmp';
|
||||
case 7:
|
||||
case 8:
|
||||
$type = 'tiff';
|
||||
default:
|
||||
$type = '';
|
||||
}
|
||||
$outputs['width'] = $imageInfo[0];
|
||||
$outputs['height'] = $imageInfo[1];
|
||||
$outputs['type'] = $type;
|
||||
$outputs['ext'] = $this->_getExtension($imagePath);
|
||||
} else {
|
||||
$this->_debug('Unable locate the image or read images information.');
|
||||
}
|
||||
return $outputs;
|
||||
|
||||
}
|
||||
function rotate($angle, $bgColor=0)
|
||||
{
|
||||
$angle = (int)($angle) -360;
|
||||
while($angle <0)
|
||||
{
|
||||
$angle += 360;
|
||||
}
|
||||
|
||||
|
||||
if($this->_imgFinal = imagerotate($this->_imgOrig, $angle))
|
||||
{
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* get the original image info
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getOriginalImageInfo()
|
||||
{
|
||||
return $this->_imgInfoOrig;
|
||||
}
|
||||
/**
|
||||
* return the final image info
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getFinalImageInfo()
|
||||
{
|
||||
if($this->_imgInfoFinal['width'] == '')
|
||||
{
|
||||
if(is_null($this->_imgFinal))
|
||||
{
|
||||
$this->_imgInfoFinal = $this->_imgInfoOrig;
|
||||
}else
|
||||
{
|
||||
$this->_imgInfoFinal['width'] = @imagesx($this->_imgFinal);
|
||||
$this->_imgInfoFinal['height'] = @imagesy($this->_imgFinal);
|
||||
}
|
||||
}
|
||||
return $this->_imgInfoFinal;
|
||||
}
|
||||
|
||||
/**
|
||||
* create final image handler
|
||||
*
|
||||
* @access private
|
||||
* @param $dst_w width
|
||||
* @param $dst_h height
|
||||
* @return boolean
|
||||
* @copyright original from noname at nivelzero dot ro
|
||||
*/
|
||||
function _createFinalImageHandler($dst_w, $dst_h)
|
||||
{
|
||||
if(function_exists('ImageCreateTrueColor'))
|
||||
{
|
||||
$this->_imgFinal = @ImageCreateTrueColor($dst_w,$dst_h);
|
||||
} else {
|
||||
$this->_imgFinal = @ImageCreate($dst_w,$dst_h);
|
||||
}
|
||||
if (!is_null($this->transparentColorRed) && !is_null($this->transparentColorGreen) && !is_null($this->transparentColorBlue)) {
|
||||
|
||||
$transparent = @imagecolorallocate($targetImageIdentifier, $this->transparentColorRed, $this->transparentColorGreen, $this->transparentColorBlue);
|
||||
@imagefilledrectangle($this->_imgFinal, 0, 0, $dst_w, $dst_h, $transparent);
|
||||
@imagecolortransparent($this->_imgFinal, $transparent);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,373 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* file listing
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/April/2007
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.file.php");
|
||||
class manager
|
||||
{
|
||||
var $currentFolderPath;
|
||||
var $sessionAction = null; //object to session action
|
||||
var $flags = array('no'=>'noFlag', 'cut'=>'cutFlag', 'copy'=>'copyFlag');
|
||||
var $forceFolderOnTop = false; //forced to have folder shown on the top of the list
|
||||
var $currentFolderInfo = array(
|
||||
'name'=>'',
|
||||
'subdir'=>0,
|
||||
'file'=>0,
|
||||
'ctime'=>'',
|
||||
'mtime'=>'',
|
||||
'is_readable'=>'',
|
||||
'is_writable'=>'',
|
||||
'size'=>0,
|
||||
'path'=>'',
|
||||
'type'=>'folder',
|
||||
'flag'=>'noFlag',
|
||||
'friendly_path'=>'',
|
||||
);
|
||||
|
||||
var $lastVisitedFolderPathIndex = 'ajax_last_visited_folder';
|
||||
var $folderPathIndex = "path";
|
||||
var $calculateSubdir = true;
|
||||
var $fileTypes = array(
|
||||
array(array("exe", "com"), "fileExe", SEARCH_TYPE_EXE, 0),
|
||||
array(array("gif", "jpg", "png", "bmp", "tif"), "filePicture", SEARCH_TYPE_IMG, 1),
|
||||
array(array("zip", "sit", "rar", "gz", "tar"), "fileZip", SEARCH_TYPE_ARCHIVE, 0),
|
||||
array(array("htm", "html", "php", "jsp", "asp", 'js', 'css'), "fileCode", SEARCH_TYPE_HTML, 1),
|
||||
array(array("mov", "ram", "rm", "asx", "dcr", "wmv"), "fileVideo", SEARCH_TYPE_VIDEO, 1),
|
||||
array(array("mpg", "avi", "asf", "mpeg"), "fileVideo", SEARCH_TYPE_MOVIE, 1),
|
||||
array(array("aif", "aiff", "wav", "mp3", "wma"), "fileMusic", SEARCH_TYPE_MUSIC, 1),
|
||||
array(array("swf", 'flv'), "fileFlash", SEARCH_TYPE_FLASH, 1),
|
||||
array(array("ppt"), "filePPT", SEARCH_TYPE_PPT, 0),
|
||||
array(array("rtf"), "fileRTF", SEARCH_TYPE_DOC, 0),
|
||||
array(array("doc"), "fileWord", SEARCH_TYPE_WORD, 0),
|
||||
array(array("pdf"), "fileAcrobat", SEARCH_TYPE_PDF, 0),
|
||||
array(array("xls", "csv"), "fileExcel", SEARCH_TYPE_EXCEL, 0),
|
||||
array(array("txt"), "fileText", SEARCH_TYPE_TEXT, 1),
|
||||
array(array("xml", "xsl", "dtd"), "fileXml", SEARCH_TYPE_XML, 1)
|
||||
);
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @path the path to a folder
|
||||
* @calculateSubdir force to get the subdirectories information
|
||||
*/
|
||||
function __construct($path = null, $calculateSubdir=true)
|
||||
{
|
||||
|
||||
$this->calculateSubdir = $calculateSubdir;
|
||||
if(defined('CONFIG_SYS_FOLDER_SHOWN_ON_TOP'))
|
||||
{
|
||||
$this->forceFolderOnTop = CONFIG_SYS_FOLDER_SHOWN_ON_TOP;
|
||||
}
|
||||
if(!is_null($path))
|
||||
{
|
||||
$this->currentFolderPath = $path;
|
||||
|
||||
}elseif(isset($_GET[$this->folderPathIndex]) && file_exists($_GET[$this->folderPathIndex]) && !is_file($_GET[$this->folderPathIndex]) )
|
||||
{
|
||||
$this->currentFolderPath = $_GET[$this->folderPathIndex];
|
||||
}
|
||||
elseif(isset($_SESSION[$this->lastVisitedFolderPathIndex]) && file_exists($_SESSION[$this->lastVisitedFolderPathIndex]) && !is_file($_SESSION[$this->lastVisitedFolderPathIndex]))
|
||||
{
|
||||
$this->currentFolderPath = $_SESSION[$this->lastVisitedFolderPathIndex];
|
||||
}else
|
||||
{
|
||||
$this->currentFolderPath = CONFIG_SYS_DEFAULT_PATH;
|
||||
}
|
||||
|
||||
$this->currentFolderPath = (isUnderRoot($this->currentFolderPath)?backslashToSlash((addTrailingSlash($this->currentFolderPath))):CONFIG_SYS_DEFAULT_PATH);
|
||||
|
||||
if($this->calculateSubdir)
|
||||
{// keep track of this folder path in session
|
||||
$_SESSION[$this->lastVisitedFolderPathIndex] = $this->currentFolderPath;
|
||||
}
|
||||
if(is_dir($this->currentFolderPath))
|
||||
{
|
||||
$file = new file($this->currentFolderPath);
|
||||
$folderInfo = $file->getFileInfo();
|
||||
if(sizeof($folderInfo))
|
||||
{
|
||||
$this->currentFolderInfo['name']=basename($this->currentFolderPath);
|
||||
$this->currentFolderInfo['subdir']=0;
|
||||
$this->currentFolderInfo['file']=0;
|
||||
$this->currentFolderInfo['ctime']=$folderInfo['ctime'];
|
||||
$this->currentFolderInfo['mtime']=$folderInfo['mtime'];
|
||||
$this->currentFolderInfo['is_readable']=$folderInfo['is_readable'];
|
||||
$this->currentFolderInfo['is_writable']=$folderInfo['is_writable'];
|
||||
$this->currentFolderInfo['path'] = $this->currentFolderPath;
|
||||
$this->currentFolderInfo['friendly_path'] = transformFilePath($this->currentFolderPath);
|
||||
$this->currentFolderInfo['type'] = "folder";
|
||||
$this->currentFolderInfo['cssClass']='folder';
|
||||
|
||||
//$this->currentFolderInfo['flag'] = $folderInfo['flag'];
|
||||
}
|
||||
}
|
||||
if($calculateSubdir && !file_exists($this->currentFolderPath))
|
||||
{
|
||||
die(ERR_FOLDER_NOT_FOUND . $this->currentFolderPath);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function setSessionAction(&$session)
|
||||
{
|
||||
$this->sessionAction = $session;
|
||||
}
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
function manager($path = null, $calculateSubdir=true)
|
||||
{
|
||||
$this->__construct($path, $calculateSubdir);
|
||||
}
|
||||
/**
|
||||
* get current folder path
|
||||
* @return string
|
||||
*/
|
||||
function getCurrentFolderPath()
|
||||
{
|
||||
return $this->currentFolderPath;
|
||||
}
|
||||
/**
|
||||
* get the list of files and folders under this current fold
|
||||
* @return array
|
||||
*/
|
||||
function getFileList()
|
||||
{
|
||||
$outputs = array();
|
||||
$files = array();
|
||||
$folders = array();
|
||||
$tem = array();
|
||||
$dirHandler = @opendir($this->currentFolderPath);
|
||||
if($dirHandler)
|
||||
{
|
||||
while(false !== ($file = readdir($dirHandler)))
|
||||
{
|
||||
if($file != '.' && $file != '..')
|
||||
{
|
||||
$flag = $this->flags['no'];
|
||||
|
||||
if($this->sessionAction->getFolder() == $this->currentFolderPath)
|
||||
{//check if any flag associated with this folder or file
|
||||
$folder = addTrailingSlash(backslashToSlash($this->currentFolderPath));
|
||||
if(in_array($folder . $file, $this->sessionAction->get()))
|
||||
{
|
||||
if($this->sessionAction->getAction() == "copy")
|
||||
{
|
||||
$flag = $this->flags['copy'];
|
||||
}else
|
||||
{
|
||||
$flag = $this->flags['cut'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$path=$this->currentFolderPath.$file;
|
||||
if(is_dir($path) && isListingDocument($path) )
|
||||
{
|
||||
$this->currentFolderInfo['subdir']++;
|
||||
if(!$this->calculateSubdir)
|
||||
{
|
||||
}else
|
||||
{
|
||||
|
||||
$folder = $this->getFolderInfo($path);
|
||||
$folder['flag'] = $flag;
|
||||
$folders[$file] = $folder;
|
||||
$outputs[$file] = $folders[$file];
|
||||
}
|
||||
|
||||
|
||||
}elseif(is_file($path) && isListingDocument($path))
|
||||
{
|
||||
|
||||
$obj = new file($path);
|
||||
$tem = $obj->getFileInfo();
|
||||
if(sizeof($tem))
|
||||
{
|
||||
$fileType = $this->getFileType($file);
|
||||
foreach($fileType as $k=>$v)
|
||||
{
|
||||
$tem[$k] = $v;
|
||||
}
|
||||
$this->currentFolderInfo['size'] += $tem['size'];
|
||||
$this->currentFolderInfo['file']++;
|
||||
$tem['path'] = backslashToSlash($path);
|
||||
$tem['type'] = "file";
|
||||
$tem['flag'] = $flag;
|
||||
$files[$file] = $tem;
|
||||
$outputs[$file] = $tem;
|
||||
$tem = array();
|
||||
$obj->close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if($this->forceFolderOnTop)
|
||||
{
|
||||
uksort($folders, "strnatcasecmp");
|
||||
uksort($files, "strnatcasecmp");
|
||||
$outputs = array();
|
||||
foreach($folders as $v)
|
||||
{
|
||||
$outputs[] = $v;
|
||||
}
|
||||
foreach ($files as $v)
|
||||
{
|
||||
$outputs[] = $v;
|
||||
}
|
||||
}else
|
||||
{
|
||||
uksort($outputs, "strnatcasecmp");
|
||||
}
|
||||
|
||||
@closedir($dirHandler);
|
||||
}else
|
||||
{
|
||||
trigger_error('Unable to locate the folder ' . $this->currentFolderPath, E_NOTICE);
|
||||
}
|
||||
return $outputs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get current or the specified dir information
|
||||
*
|
||||
* @param string $path
|
||||
* @return array
|
||||
*/
|
||||
function getFolderInfo($path=null)
|
||||
{
|
||||
if(is_null($path))
|
||||
{
|
||||
return $this->currentFolderInfo;
|
||||
}else
|
||||
{
|
||||
$obj = new manager($path, false);
|
||||
$obj->setSessionAction($this->sessionAction);
|
||||
$obj->getFileList();
|
||||
return $obj->getFolderInfo();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* return the file type of a file.
|
||||
*
|
||||
* @param string file name
|
||||
* @return array
|
||||
*/
|
||||
function getFileType($fileName, $checkIfDir = false)
|
||||
{
|
||||
|
||||
$ext = strtolower($this->_getExtension($fileName, $checkIfDir));
|
||||
|
||||
foreach ($this->fileTypes as $fileType)
|
||||
{
|
||||
if(in_array($ext, $fileType[0]))
|
||||
{
|
||||
return array("cssClass" => $fileType[1], "fileType" => $fileType[2], "preview" => $fileType[3], 'test'=>5);
|
||||
}
|
||||
}
|
||||
if(!empty($fileName))
|
||||
{//this is folder
|
||||
if(empty($ext))
|
||||
{
|
||||
if(is_dir($fileName))
|
||||
{
|
||||
|
||||
return array("cssClass" => ($checkIfDir && $this->isDirEmpty($fileName)?'folderEmpty':"folder") , "fileType" => "Folder", "preview" => 0, 'test'=>1);
|
||||
}else
|
||||
{
|
||||
return array("cssClass" => "fileUnknown", "fileType" => SEARCH_TYPE_UNKNOWN, "preview" => 0, 'test'=>2);
|
||||
}
|
||||
}else
|
||||
{
|
||||
return array("cssClass" => "fileUnknown", "fileType" => SEARCH_TYPE_UNKNOWN, "preview" => 0, 'test'=>3, 'ext'=>$ext , 'filename'=>$fileName);
|
||||
}
|
||||
|
||||
}else
|
||||
{//this is unknown file
|
||||
return array("cssClass" => "fileUnknown", "fileType" => SEARCH_TYPE_UNKNOWN, "preview" => 0, 'test'=>4);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* return the predefined file types
|
||||
*
|
||||
* @return arrray
|
||||
*/
|
||||
function getFileTypes()
|
||||
{
|
||||
return $this->fileTypes;
|
||||
}
|
||||
/**
|
||||
* print out the file types
|
||||
*
|
||||
*/
|
||||
function printFileTypes()
|
||||
{
|
||||
foreach($fileTypes as $fileType)
|
||||
{
|
||||
if(isset($fileType[0]) && is_array($fileType[0]))
|
||||
{
|
||||
foreach($fileType[0] as $type)
|
||||
{
|
||||
echo $type. ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the extension of a file name
|
||||
*
|
||||
* @param string $file
|
||||
* @return string
|
||||
* @copyright this function originally come from Andy's php
|
||||
*/
|
||||
function _getExtension($file, $checkIfDir = false)
|
||||
{
|
||||
if($checkIfDir && file_exists($file) && is_dir($file))
|
||||
{
|
||||
return '';
|
||||
}else
|
||||
{
|
||||
return @substr(@strrchr($file, "."), 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function isDirEmpty($path)
|
||||
{
|
||||
$dirHandler = @opendir($path);
|
||||
if($dirHandler)
|
||||
{
|
||||
while(false !== ($file = readdir($dirHandler)))
|
||||
{
|
||||
if($file != '.' && $file != '..')
|
||||
{
|
||||
@closedir($dirHandler);
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@closedir($dirHandler);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,584 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Pagination Class
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @since 27/Nov/20006
|
||||
*
|
||||
*/
|
||||
class pagination
|
||||
{
|
||||
var $totalItems = 0;
|
||||
var $itemsPerPage = 30;
|
||||
var $currentPage = 1;
|
||||
var $friendlyUrl = false;
|
||||
var $baseUrl = "";
|
||||
var $pageIndex = "page";
|
||||
var $groupLimit = 5;
|
||||
var $excludedQueryStrings = array();
|
||||
var $totalPages = 0;
|
||||
var $url = "";
|
||||
var $previousText = "Previous";
|
||||
var $nextText = "Next";
|
||||
var $lastText = "Last";
|
||||
var $firstText = "First";
|
||||
var $limitIndex ='limit';
|
||||
var $limits = array(5, 10, 20, 30, 50, 80, 150, 999);
|
||||
|
||||
|
||||
/**
|
||||
* Contructor
|
||||
*
|
||||
* @param boolean $friendlyUrl set the returned url
|
||||
* as search engine friendly or Normal Url
|
||||
*/
|
||||
function pagination($friendlyUrl=false)
|
||||
{
|
||||
$this->friendlyUrl = $friendlyUrl;
|
||||
$this->__resetCurrentPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* set maximum number of items per page
|
||||
*
|
||||
* @param integer $value maximum number of items per page
|
||||
*/
|
||||
function setLimit($value)
|
||||
{
|
||||
$this->itemsPerPage = (int)($value);
|
||||
}
|
||||
/**
|
||||
* get maximum number of items per page
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
function getLimit()
|
||||
{
|
||||
return $this->itemsPerPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the total number of items
|
||||
*
|
||||
* @param integer $value the total number of items
|
||||
*/
|
||||
function setTotal($value)
|
||||
{
|
||||
$this->totalItems = (int)($value);
|
||||
}
|
||||
/**
|
||||
* get the total number of items
|
||||
*
|
||||
* @return integer total number of items
|
||||
*/
|
||||
function getTotal()
|
||||
{
|
||||
return $this->totalItems;
|
||||
}
|
||||
/**
|
||||
* get total pages will be used to display all records
|
||||
*
|
||||
*/
|
||||
function getTotalPages()
|
||||
{
|
||||
|
||||
$output = floor(($this->totalItems / $this->itemsPerPage ));
|
||||
if($this->totalItems % $this->itemsPerPage)
|
||||
{
|
||||
$output++;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the index of URL Query String
|
||||
*
|
||||
* @param string $value e.g. page
|
||||
*/
|
||||
function setPageIndex($value)
|
||||
{
|
||||
$this->pageIndex = $value;
|
||||
$this->__resetCurrentPage();
|
||||
}
|
||||
|
||||
|
||||
function getPageIndex()
|
||||
{
|
||||
return $this->pageIndex;
|
||||
}
|
||||
/**
|
||||
* initiate or reset the current page number
|
||||
*
|
||||
*/
|
||||
function __resetCurrentPage()
|
||||
{
|
||||
$this->currentPage = ((isset($_GET[$this->pageIndex]) && (int)($_GET[$this->pageIndex]) > 0)?(int)($_GET[$this->pageIndex]):1);
|
||||
}
|
||||
|
||||
/**
|
||||
* set the base url used in the links, default is $PHP_SELF
|
||||
*
|
||||
* @param string $value the base url
|
||||
*/
|
||||
function setUrl($value="")
|
||||
{
|
||||
if(empty($value))
|
||||
{
|
||||
if($this->friendlyUrl)
|
||||
{
|
||||
$this->url = "http://" . $_SERVER['HTTP_HOST'] . "/";
|
||||
}else
|
||||
{
|
||||
$this->url = $_SERVER['PHP_SELF'];
|
||||
}
|
||||
}else
|
||||
{
|
||||
$this->url = $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get the base url variable
|
||||
*
|
||||
* @return string the base url
|
||||
*/
|
||||
function getUrl()
|
||||
{
|
||||
|
||||
if(empty($this->url))
|
||||
{
|
||||
$this->setUrl();
|
||||
|
||||
}
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* set base url for pagination links after exculed those keys
|
||||
* identified on excluded query strings
|
||||
*/
|
||||
function __setBaseUrl()
|
||||
{
|
||||
|
||||
if(empty($this->url))
|
||||
{
|
||||
$this->getUrl();
|
||||
}
|
||||
|
||||
if($this->friendlyUrl)
|
||||
{
|
||||
$this->baseUrl = $this->getUrl();
|
||||
}else
|
||||
{
|
||||
|
||||
$appendingQueryStrings = array();
|
||||
$this->excludedQueryStrings[$this->pageIndex] =$this->pageIndex;
|
||||
foreach($_GET as $k=>$v)
|
||||
{
|
||||
if((array_search($k, $this->excludedQueryStrings) === false ))
|
||||
{
|
||||
$appendingQueryStrings[$k] = $k . "=" . $v;
|
||||
}
|
||||
}
|
||||
if(sizeof($appendingQueryStrings))
|
||||
{
|
||||
$this->baseUrl = $this->__appendQueryString($this->url, implode("&", $appendingQueryStrings));
|
||||
}else
|
||||
{
|
||||
$this->baseUrl = $this->getUrl();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* get base url for pagination links aftr excluded those key
|
||||
* identified on excluded query strings
|
||||
*
|
||||
*/
|
||||
function __getBaseUrl()
|
||||
{
|
||||
|
||||
if(empty($this->baseUrl))
|
||||
{
|
||||
|
||||
$this->__setBaseUrl();
|
||||
}
|
||||
return $this->baseUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get the first item number
|
||||
*
|
||||
* @return interger the first item number displayed within current page
|
||||
*/
|
||||
function getFirstItem()
|
||||
{
|
||||
$output = 0;
|
||||
$temStartItemNumber = (($this->currentPage - 1) * $this->itemsPerPage + 1);
|
||||
if($this->totalItems && $temStartItemNumber <= $this->totalItems )
|
||||
{
|
||||
|
||||
$output = $temStartItemNumber;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
/**
|
||||
* get the last item number displayed within current page
|
||||
*
|
||||
* @return interger the last item number
|
||||
*/
|
||||
function getLastItem()
|
||||
{
|
||||
$output = 0;
|
||||
$temEndItemNumber = (($this->currentPage) * $this->itemsPerPage);
|
||||
if($this->totalItems)
|
||||
{
|
||||
if($temEndItemNumber <= $this->totalItems)
|
||||
{
|
||||
$output = $temEndItemNumber;
|
||||
}else
|
||||
{
|
||||
$output = $this->totalItems;
|
||||
}
|
||||
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
/**
|
||||
* set page groupings limit
|
||||
* used for previous 1 2 3 4 5 next
|
||||
*
|
||||
* @param unknown_type $value
|
||||
*/
|
||||
function setGroupLimit($value)
|
||||
{
|
||||
$this->groupLimit = (int)($value);
|
||||
}
|
||||
/**
|
||||
* get page grouping limit
|
||||
*
|
||||
* @return integer the page grouping limit
|
||||
*/
|
||||
function getGroupLimit()
|
||||
{
|
||||
return $this->groupLimit;
|
||||
}
|
||||
/**
|
||||
* get the page offset number
|
||||
* used for Query . e.g SELECT SQL_CALC_FOUND_ROWS *
|
||||
* FROM mytable LIMIT getPageOffset(), getItemsPerPage()
|
||||
*
|
||||
* @return iner
|
||||
*/
|
||||
function getPageOffset()
|
||||
{
|
||||
return (($this->currentPage - 1) * $this->itemsPerPage);
|
||||
}
|
||||
/**
|
||||
* get the last url if any
|
||||
* @return string the last url
|
||||
*/
|
||||
function getLastUrl()
|
||||
{
|
||||
|
||||
$url = "";
|
||||
$totalPages = $this->getTotalPages();
|
||||
if($this->currentPage < $totalPages)
|
||||
{
|
||||
$url = $this->__getBaseUrl();
|
||||
|
||||
if($this->friendlyUrl)
|
||||
{
|
||||
$url .= $this->pageIndex . $totalPages . "/";
|
||||
}else
|
||||
{
|
||||
$url = $this->__appendQueryString($url, $this->pageIndex . "=" . $totalPages);
|
||||
}
|
||||
$url = sprintf('<a href="%s" class="pagination_last"><span>%s</span></a>',
|
||||
$url,
|
||||
$this->lastText);
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* get the first url if any
|
||||
* @return string the first url
|
||||
*/
|
||||
|
||||
function getFirstUrl()
|
||||
{
|
||||
$url = "";
|
||||
if($this->currentPage > 1)
|
||||
{
|
||||
$url = $this->__getBaseUrl();
|
||||
if($this->friendlyUrl)
|
||||
{
|
||||
$url .= $this->pageIndex . "1/";
|
||||
}else
|
||||
{
|
||||
$url = $this->__appendQueryString($url, $this->pageIndex . "=1");
|
||||
}
|
||||
$url = sprintf('<a href="%s" class="pagination_first"><span>%s</span></a>',
|
||||
$url,
|
||||
$this->firstText);
|
||||
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the previous page url if anywhere
|
||||
*
|
||||
* @param array $excludedQueryStrings excluded the value from $_GET
|
||||
* @return string the previous page url
|
||||
*/
|
||||
function getPreviousUrl()
|
||||
{
|
||||
$url = "";
|
||||
if($this->currentPage > 1 && $this->totalItems > 0 )
|
||||
{
|
||||
$url = $this->__getBaseUrl();
|
||||
if($this->friendlyUrl)
|
||||
{
|
||||
$url .= $this->pageIndex . ($this->currentPage - 1) . "/";
|
||||
}else
|
||||
{
|
||||
$url = $this->__appendQueryString($url, $this->pageIndex . "=" . ($this->currentPage -1));
|
||||
}
|
||||
$url = sprintf('<a href="%s" class="pagination_previous"><span>%s</span></a>',
|
||||
$url,
|
||||
$this->previousText);
|
||||
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
/**
|
||||
* get the next page url if anywhere
|
||||
*
|
||||
* @param array $excludedQueryStrings excluded the value from $_GET
|
||||
* @return string the next page url
|
||||
*/
|
||||
function getNextUrl()
|
||||
{
|
||||
$url = "";
|
||||
if($this->totalItems > ($this->currentPage * $this->itemsPerPage))
|
||||
{
|
||||
$url = $this->__getBaseUrl();
|
||||
if($this->friendlyUrl)
|
||||
{
|
||||
$url .= $this->pageIndex . ($this->currentPage + 1) . "/";
|
||||
}else
|
||||
{
|
||||
$url = $this->__appendQueryString($url, $this->pageIndex . "=" . ($this->currentPage + 1));
|
||||
}
|
||||
$url = sprintf('<a href="%s" class="pagination_next"><span>%s</span></a>',
|
||||
$url,
|
||||
$this->nextText);
|
||||
}
|
||||
return $url;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get the group page links e.g. 1,2,3,4,5
|
||||
* return format
|
||||
* <a class="pagination_group" href='yoururl'>1</a>
|
||||
* <a class="pagination_group active" href='#'>2</a>
|
||||
* <a class="pagination_group" href='yoururl'>3</a>
|
||||
*/
|
||||
function getGroupUrls()
|
||||
{
|
||||
$output = "";
|
||||
if($this->totalItems > 0)
|
||||
{
|
||||
$displayedPages = 0;
|
||||
$url = $this->__getBaseUrl();
|
||||
$totalPages = $this->getTotalPages();
|
||||
// find halfway point
|
||||
$groupLimitHalf = floor($this->groupLimit / 2);
|
||||
// determine what item/page we start with
|
||||
$itemStart = $this->currentPage - $groupLimitHalf;
|
||||
$itemStart = ($itemStart > 0 && $itemStart <= $totalPages)?$itemStart:1;
|
||||
$itemEnd = $itemStart;
|
||||
|
||||
while($itemEnd < ($itemStart + $this->groupLimit - 1) && $itemEnd < $totalPages)
|
||||
{
|
||||
$itemEnd++;
|
||||
}
|
||||
|
||||
|
||||
if($totalPages > ($itemEnd - $itemStart))
|
||||
{
|
||||
for($i = $itemStart; $i > 1 && ($itemEnd - $itemStart + 1) < $this->groupLimit; $i--)
|
||||
{
|
||||
$itemStart--;
|
||||
}
|
||||
}
|
||||
|
||||
for($item = $itemStart; $item <= $itemEnd; $item++)
|
||||
{
|
||||
if($item != $this->currentPage)
|
||||
{//it is not the active link
|
||||
if($this->friendlyUrl)
|
||||
{
|
||||
$temUrl = $url . $this->pageIndex . $item . "/";
|
||||
}else
|
||||
{
|
||||
$temUrl = $this->__appendQueryString($url, $this->pageIndex . "=" . $item);
|
||||
}
|
||||
$output .= sprintf(' <a class="pagination_group" href="%s"><span>%d</span></a> ', $temUrl, $item);
|
||||
}else
|
||||
{//active link
|
||||
$output .= sprintf(' <a class="pagination_group pagination_active" href="#"><span>%d</span></a> ', $item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
/**
|
||||
* set the text of previous page link
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
function setPreviousText($value)
|
||||
{
|
||||
$this->previousText = $value;
|
||||
}
|
||||
/**
|
||||
* set the text of first page link
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
function setFirstText($value)
|
||||
{
|
||||
$this->firstText = $value;
|
||||
}
|
||||
/**
|
||||
* set the text of next page link
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
|
||||
function setNextText($value)
|
||||
{
|
||||
$this->nextText = $value;
|
||||
}
|
||||
/**
|
||||
* set the text of last page link
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
function setLastText($value)
|
||||
{
|
||||
$this->lastText = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the excluded query string from $_GET;
|
||||
*
|
||||
* @param array the lists of the query string keys
|
||||
*/
|
||||
|
||||
function setExcludedQueryString($values = array())
|
||||
{
|
||||
$this->excludedQueryStrings = $values;
|
||||
}
|
||||
|
||||
function getExcludedQueryString()
|
||||
{
|
||||
return $this->excludedQueryStrings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add extra query stiring to a url
|
||||
* @param string $baseUrl
|
||||
* @param string $extra the query string added to the base url
|
||||
*/
|
||||
function __appendQueryString($baseUrl, $extra)
|
||||
{
|
||||
$output = trim($baseUrl);
|
||||
if(strpos($baseUrl, "?") !== false)
|
||||
{
|
||||
$output .= "&" . $extra;
|
||||
}else
|
||||
{
|
||||
$output .= "?" . $extra;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
/**
|
||||
* return the html
|
||||
*
|
||||
* @param integer $type
|
||||
*/
|
||||
function getPaginationHTML($type=1, $cssClass="pagination")
|
||||
{
|
||||
$output = '';
|
||||
$output .= "<div class=\"pagination_content\"><p class=\"$cssClass\">\n";
|
||||
switch($type)
|
||||
{
|
||||
case "2":
|
||||
$output .= "<span class=\"pagination_summany\">" . $this->getFirstItem() . " to " . $this->getLastItem() . " of " . $this->getTotal() . " results.</span> ";
|
||||
if($previousUrl = $this->getPreviousUrl())
|
||||
{
|
||||
$output .= " " . $previousUrl;
|
||||
}
|
||||
|
||||
if($nextUrl = $this->getNextUrl())
|
||||
{
|
||||
$output .= " " . $nextUrl;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
//get full summary pagination
|
||||
default:
|
||||
$output .= "<span class=\"pagination_summany\">" . $this->getFirstItem() . "/" . $this->getLastItem() . " (" . $this->getTotal() . ")</span> ";
|
||||
if($firstUrl = $this->getFirstUrl())
|
||||
{
|
||||
$output .= " " . $firstUrl;
|
||||
}
|
||||
if($previousUrl = $this->getPreviousUrl())
|
||||
{
|
||||
$output .= " " . $previousUrl;
|
||||
}
|
||||
|
||||
if($groupUrls = $this->getGroupUrls())
|
||||
{
|
||||
$output .= " " . $groupUrls;
|
||||
}
|
||||
if($nextUrl = $this->getNextUrl())
|
||||
{
|
||||
$output .= " " . $nextUrl;
|
||||
}
|
||||
if($lastUrl = $this->getLastUrl())
|
||||
{
|
||||
$output .= " " . $lastUrl;
|
||||
}
|
||||
$itemPerPage = '';
|
||||
$itemPerPage .= "<select name=\"" . $this->limitIndex . "\" id=\"limit\" class=\"input inputLimit\" onchange=\"changePaginationLimit();\">\n";
|
||||
foreach ($this->limits as $v)
|
||||
{
|
||||
$itemPerPage .= "<option value=\"" . $v . "\" " . ($v==$this->itemsPerPage?'selected="selected"':'') . ">" . $v . "</option>\n";
|
||||
}
|
||||
$itemPerPage .= "</select>\n";
|
||||
$output .= "<span class=\"pagination_items_per_page\">";
|
||||
$output .= sprintf(PAGINATION_ITEMS_PER_PAGE, $itemPerPage);
|
||||
$output .= "</span>";
|
||||
$output .= "<span class=\"pagination_parent\"><a href=\"#\" onclick=\"goParentFolder();\" id=\"pagination_parent_link\" title=\"" . PAGINATION_GO_PARENT . "\"> </a></span>";
|
||||
}
|
||||
|
||||
$output .= "</p></div>";
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,184 +0,0 @@
|
||||
<?php
|
||||
include_once(CLASS_FILE);
|
||||
require_once(CLASS_SESSION_ACTION);
|
||||
require_once(CLASS_MANAGER);
|
||||
class Search
|
||||
{
|
||||
var $rootFolder = '';
|
||||
var $files = array();
|
||||
var $rootFolderInfo = array();
|
||||
var $searchkeywords = array(
|
||||
'mtime_from'=>'',
|
||||
'mtime_to'=>'',
|
||||
'name'=>'',
|
||||
'size_from'=>'',
|
||||
'size_to'=>'',
|
||||
'recursive'=>'0',
|
||||
|
||||
);
|
||||
var $sessionAction = null;
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $rootFolder
|
||||
*/
|
||||
function __construct($rootFolder)
|
||||
{
|
||||
$this->rootFolder = $rootFolder;
|
||||
$this->sessionAction = new SessionAction();
|
||||
$objRootFolder = new file($this->rootFolder);
|
||||
$tem = $objRootFolder->getFileInfo();
|
||||
$obj = new manager($this->rootFolder, false);
|
||||
$obj->setSessionAction($this->sessionAction);
|
||||
$selectedDocuments = $this->sessionAction->get();
|
||||
$fileType = $obj->getFolderInfo($this->rootFolder);
|
||||
|
||||
foreach($fileType as $k=>$v)
|
||||
{
|
||||
$tem[$k] = $v;
|
||||
}
|
||||
|
||||
$tem['path'] = backslashToSlash($this->rootFolder);
|
||||
$tem['type'] = (is_dir($this->rootFolder)?'folder':'file');
|
||||
$tem['size'] = (is_dir($this->rootFolder)?'':transformFileSize(@filesize($this->rootFolder)));
|
||||
//$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
|
||||
//$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
|
||||
$tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag');
|
||||
$tem['url'] = getFileUrl($this->rootFolder);
|
||||
$tem['friendly_path'] = transformFilePath($this->rootFolder);
|
||||
$tem['file'] = 0;
|
||||
$tem['subdir'] = 0;
|
||||
$manager = null;
|
||||
$this->rootFolderInfo = $tem;
|
||||
$tem = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $rootFolder
|
||||
*/
|
||||
function Search($rootFolder)
|
||||
{
|
||||
$this->__construct($rootFolder);
|
||||
}
|
||||
|
||||
/**
|
||||
* change the search keyword individually
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $value
|
||||
*/
|
||||
function addSearchKeyword($key, $value)
|
||||
{
|
||||
$this->searchkeywords[$key] = $value;
|
||||
}
|
||||
/**
|
||||
* change the search keywords
|
||||
*
|
||||
* @param array $keywords
|
||||
*/
|
||||
function addSearchKeywords($keywords)
|
||||
{
|
||||
foreach($this->searchkeywords as $k=>$v)
|
||||
{
|
||||
if(array_key_exists($k, $keywords) !== false)
|
||||
{
|
||||
$this->searchkeywords[$k] = $keywords[$k];
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* get the file according to the search keywords
|
||||
*
|
||||
*/
|
||||
function doSearch($baseFolderPath = null)
|
||||
{
|
||||
|
||||
$baseFolderPath = addTrailingSlash(backslashToSlash((is_null($baseFolderPath)?$this->rootFolder:$baseFolderPath)));
|
||||
|
||||
$dirHandler = @opendir($baseFolderPath);
|
||||
if($dirHandler)
|
||||
{
|
||||
while(false !== ($file = readdir($dirHandler)))
|
||||
{
|
||||
if($file != '.' && $file != '..')
|
||||
{
|
||||
$path = $baseFolderPath . $file;
|
||||
if(is_file($path))
|
||||
{
|
||||
$isValid = true;
|
||||
|
||||
$fileTime = @filemtime($path);
|
||||
$fileSize = @filesize($path);
|
||||
if($this->searchkeywords['name'] !== '' && @eregi($this->searchkeywords['name'], $file) === false)
|
||||
{
|
||||
$isValid = false;
|
||||
}
|
||||
if($this->searchkeywords['mtime_from'] != '' && $fileTime < @strtotime($this->searchkeywords['mtime_from']))
|
||||
{
|
||||
$isValid = false;
|
||||
}
|
||||
if($this->searchkeywords['mtime_to'] != '' && $fileTime > @strtotime($this->searchkeywords['mtime_to']))
|
||||
{
|
||||
$isValid = false;
|
||||
}
|
||||
if($this->searchkeywords['size_from'] != '' && $fileSize < @strtotime($this->searchkeywords['size_from']))
|
||||
{
|
||||
$isValid = false;
|
||||
}
|
||||
if($this->searchkeywords['size_to'] != '' && $fileSize > @strtotime($this->searchkeywords['size_to']))
|
||||
{
|
||||
$isValid = false;
|
||||
}
|
||||
if($isValid && isListingDocument($path))
|
||||
{
|
||||
$finalPath = $path;
|
||||
$objFile = new file($finalPath);
|
||||
$tem = $objFile->getFileInfo();
|
||||
$obj = new manager($finalPath, false);
|
||||
$obj->setSessionAction($this->sessionAction);
|
||||
$selectedDocuments = $this->sessionAction->get();
|
||||
$fileType = $obj->getFileType($finalPath);
|
||||
|
||||
foreach($fileType as $k=>$v)
|
||||
{
|
||||
$tem[$k] = $v;
|
||||
}
|
||||
|
||||
$tem['path'] = backslashToSlash($finalPath);
|
||||
$tem['type'] = (is_dir($finalPath)?'folder':'file');
|
||||
$tem['size'] = transformFileSize($tem['size']);
|
||||
$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
|
||||
$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
|
||||
$tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag');
|
||||
$tem['url'] = getFileUrl($tem['path']);
|
||||
$this->rootFolderInfo['file']++;
|
||||
$manager = null;
|
||||
$this->files[] = $tem;
|
||||
$tem = null;
|
||||
}
|
||||
}elseif(is_dir($path) && $this->searchkeywords['recursive'])
|
||||
{
|
||||
$this->Search($baseFolderPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dirHandler);
|
||||
}
|
||||
|
||||
function getFoundFiles()
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
function getRootFolderInfo()
|
||||
{
|
||||
|
||||
return $this->rootFolderInfo;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,228 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* this class provide a function like session handling engine
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.file.php");
|
||||
class Session
|
||||
{
|
||||
var $lifeTime;
|
||||
var $fp = null;
|
||||
var $dir = null;
|
||||
var $mTime = null;
|
||||
var $sessionDir = null;
|
||||
var $sessionFile = null;
|
||||
var $ext = '.txt';
|
||||
var $gcCounter = 5; //call gc to delete expired session each ten request
|
||||
var $gcCounterFileName = 'gc_counter.ajax.php';
|
||||
var $gcCounterFile = null;
|
||||
var $gcLogFileName = 'gc_log.ajax.php';
|
||||
var $gcLogFile = null;
|
||||
var $debug = true; //turn it on when you want to see gc log
|
||||
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//check if the session folder read and writable
|
||||
/*
|
||||
$dir = new file();
|
||||
if(!file_exists(CONFIG_SYS_DIR_SESSION_PATH))
|
||||
{
|
||||
if(!$dir->mkdir(CONFIG_SYS_DIR_SESSION_PATH))
|
||||
{
|
||||
die('Unable to create session folder.');
|
||||
}
|
||||
}
|
||||
if(!$dir->isReadable(CONFIG_SYS_DIR_SESSION_PATH))
|
||||
{
|
||||
die('Permission denied: ' . CONFIG_SYS_DIR_SESSION_PATH . " is not readable.");
|
||||
}
|
||||
if(!$dir->isWritable(CONFIG_SYS_DIR_SESSION_PATH))
|
||||
{
|
||||
die('Permission denied: ' . CONFIG_SYS_DIR_SESSION_PATH . " is not writable.");
|
||||
}
|
||||
$this->dir = backslashToSlash(addTrailingSlash(CONFIG_SYS_DIR_SESSION_PATH));
|
||||
$this->lifeTime = get_cfg_var("session.gc_maxlifetime");
|
||||
$this->gcCounterFile = $this->dir . $this->gcCounterFileName;
|
||||
$this->gcLogFile = $this->dir . $this->gcLogFileName;
|
||||
$this->sessionDir = backslashToSlash($this->dir.session_id().DIRECTORY_SEPARATOR);
|
||||
*/
|
||||
$this->init();
|
||||
}
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
*/
|
||||
function Session()
|
||||
{
|
||||
$this->__construct();
|
||||
}
|
||||
/**
|
||||
* session init
|
||||
* @return boolean
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function gc()
|
||||
{
|
||||
//init the counter file
|
||||
$fp = @fopen($this->gcCounterFile, 'a+');
|
||||
if($fp)
|
||||
{
|
||||
$count = (int)(fgets($fp, 999999)) + 1;
|
||||
if($count > $this->gcCounter || rand(0, 23) == date('h'))
|
||||
{
|
||||
$this->_gc();
|
||||
$count = 0;
|
||||
}
|
||||
@ftruncate($fp, 0);
|
||||
if(!@fputs($fp, $count))
|
||||
{
|
||||
die(SESSION_COUNTER_FILE_WRITE_FAILED);
|
||||
}
|
||||
@fclose($fp);
|
||||
}else
|
||||
{
|
||||
die(SESSION_COUNTER_FILE_CREATE_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function _gc()
|
||||
{
|
||||
//remove expired file from session folder
|
||||
$dirHandler = @opendir($this->dir);
|
||||
$output = '';
|
||||
$output .= "gc start at " . date('d/M/Y H:i:s') . "\n";
|
||||
$fo = new file();
|
||||
if($dirHandler)
|
||||
{
|
||||
while(false !== ($file = readdir($dirHandler)))
|
||||
{
|
||||
if($file != '.' && $file != '..' && $file != $this->gcCounterFileName && $file != $this->gcLogFileName && $file != session_id() )
|
||||
{
|
||||
$path=$this->dir.$file;
|
||||
$output .= $path ;
|
||||
//check if this is a expired session file
|
||||
if(filemtime($path) + $this->lifeTime < time())
|
||||
{
|
||||
if($fo->delete($path))
|
||||
{
|
||||
$output .= ' Deleted at ' . date('d/M/Y H:i:s');
|
||||
}else
|
||||
{
|
||||
$output .= " Failed at " . date('d/M/Y H:i:s');
|
||||
}
|
||||
}
|
||||
$output .= "\n";
|
||||
|
||||
}
|
||||
}
|
||||
if($this->debug)
|
||||
{
|
||||
$this->_log($output);
|
||||
}
|
||||
|
||||
@closedir($dirHandler);
|
||||
|
||||
}
|
||||
if(CONFIG_SYS_DEMO_ENABLE)
|
||||
{
|
||||
//remove expired files from uploaded folder
|
||||
$dirHandler = @opendir(CONFIG_SYS_ROOT_PATH);
|
||||
$output = '';
|
||||
$output .= "gc start at " . date('d/M/Y H:i:s') . "\n";
|
||||
$fo = new file();
|
||||
if($dirHandler)
|
||||
{
|
||||
while(false !== ($file = readdir($dirHandler)))
|
||||
{
|
||||
if($file != '.' && $file != '..')
|
||||
{
|
||||
$path=CONFIG_SYS_ROOT_PATH.$file;
|
||||
$output .= $path ;
|
||||
//check if this is a expired session file
|
||||
if(filemtime($path) + $this->lifeTime < time())
|
||||
{
|
||||
if($fo->delete($path))
|
||||
{
|
||||
$output .= ' Deleted at ' . date('d/M/Y H:i:s');
|
||||
}else
|
||||
{
|
||||
$output .= " Failed at " . date('d/M/Y H:i:s');
|
||||
}
|
||||
}
|
||||
$output .= "\n";
|
||||
|
||||
}
|
||||
}
|
||||
if($this->debug)
|
||||
{
|
||||
$this->_log($output);
|
||||
}
|
||||
|
||||
@closedir($dirHandler);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* log action taken by the gc
|
||||
*
|
||||
* @param unknown_type $msg
|
||||
*/
|
||||
function _log($msg)
|
||||
{
|
||||
$msg = "<?php die(); ?>\n" . $msg;
|
||||
$fp = @fopen($this->gcLogFile, 'w+');
|
||||
if($fp)
|
||||
{
|
||||
@ftruncate($fp, 0);
|
||||
!@fputs($fp, $msg);
|
||||
@fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the current session directory
|
||||
*
|
||||
* @return string return empty if failed
|
||||
*/
|
||||
function getSessionDir()
|
||||
{
|
||||
if(!file_exists($this->sessionDir) && !is_dir($this->sessionDir))
|
||||
{
|
||||
$dir = new file();
|
||||
if(!$dir->mkdir($this->sessionDir))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}else
|
||||
{
|
||||
if(!@is_dir($this->sessionDir))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
return $this->sessionDir;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,93 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*Session Action Class
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/May/2007
|
||||
*
|
||||
*/
|
||||
class SessionAction
|
||||
{
|
||||
var $actionIndex = 'ajax_file_action';
|
||||
var $selectedDocIndex = 'ajax_selected_doc';
|
||||
var $fromFolderIndex = 'ajax_from_folder';
|
||||
function __construct()
|
||||
{
|
||||
if(!isset($_SESSION[$this->actionIndex]))
|
||||
{
|
||||
$_SESSION[$this->actionIndex] = '';
|
||||
}
|
||||
if(!isset($_SESSION[$this->selectedDocIndex]) || !is_array($_SESSION[$this->selectedDocIndex]))
|
||||
{
|
||||
$_SESSION[$this->selectedDocIndex] = array();
|
||||
}
|
||||
if(!isset($_SESSION[$this->fromFolderIndex]))
|
||||
{
|
||||
$_SESSION[$this->fromFolderIndex] = '';
|
||||
}
|
||||
}
|
||||
|
||||
function SessionAction()
|
||||
{
|
||||
$this->__construct();
|
||||
}
|
||||
/**
|
||||
* count the number of selected documents
|
||||
*
|
||||
*/
|
||||
function count()
|
||||
{
|
||||
return (isset($_SESSION[$this->selectedDocIndex])?sizeof($_SESSION[$this->selectedDocIndex]):0);
|
||||
}
|
||||
/**
|
||||
* assign the selected documents
|
||||
*
|
||||
* @param array $selectedDocuments
|
||||
*/
|
||||
function set($selectedDocuments)
|
||||
{
|
||||
$_SESSION[$this->selectedDocIndex] = $selectedDocuments;
|
||||
|
||||
}
|
||||
/**
|
||||
* get the selected documents
|
||||
* @return array
|
||||
*/
|
||||
function get()
|
||||
{
|
||||
return (isset($_SESSION[$this->selectedDocIndex])?$_SESSION[$this->selectedDocIndex]:array());
|
||||
}
|
||||
|
||||
function setAction($action)
|
||||
{
|
||||
$_SESSION[$this->actionIndex] = $action;
|
||||
}
|
||||
/**
|
||||
* get the action
|
||||
*
|
||||
* @return unknown
|
||||
*/
|
||||
function getAction()
|
||||
{
|
||||
return (isset($_SESSION[$this->actionIndex])?$_SESSION[$this->actionIndex]:'');
|
||||
}
|
||||
/**
|
||||
* set the folder
|
||||
*
|
||||
* @param string $folder
|
||||
*/
|
||||
function setFolder($folder)
|
||||
{
|
||||
$_SESSION[$this->fromFolderIndex] = $folder;
|
||||
}
|
||||
/**
|
||||
* get the folder
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getFolder()
|
||||
{
|
||||
return (isset($_SESSION[$this->fromFolderIndex])?$_SESSION[$this->fromFolderIndex]:'');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,589 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* This class provide all file upload functionalities
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 22/April/2007
|
||||
*
|
||||
*/
|
||||
class Upload
|
||||
{
|
||||
var $fileType = ""; //the file type
|
||||
var $originalFileName = "";
|
||||
var $fileName = ""; //the file final name
|
||||
var $fileExtension = "";
|
||||
var $img_x = 0;
|
||||
var $img_y = 0;
|
||||
var $img_new_x = 0;
|
||||
var $img_new_y = 0;
|
||||
var $imgHandler = null;
|
||||
var $fileBaseName = ""; //file name without the file extension and .
|
||||
var $filePath = ""; //the file path which the file uploaded to
|
||||
var $fileSize = 0;
|
||||
var $validImageExts = array("gif", "jpg", "png");
|
||||
var $errors = array();
|
||||
var $_value = null; //an array holding the uploaded file details
|
||||
var $dirPath = "";
|
||||
var $invalidFileExt = array(); //var $invalidFileExt = array('php,inc,asp,aspx');
|
||||
var $errCode = "";
|
||||
var $safeMode;
|
||||
var $uploadFileMode = 0755;
|
||||
var $errorCodes = array(
|
||||
0=>'the file uploaded with success',
|
||||
1=>'The uploaded file exceeds the upload_max_filesize directive in php.ini',
|
||||
2=>'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
|
||||
3=>'The uploaded file was only partially uploaded',
|
||||
4=>'No file was uploaded.',
|
||||
6=>'Missing a temporary folder',
|
||||
7=>'Failed to write file to disk',
|
||||
8=>'File upload stopped by extension',
|
||||
999=>'No error code avaiable',
|
||||
);
|
||||
|
||||
|
||||
function Upload()
|
||||
{
|
||||
//doing nothing
|
||||
}
|
||||
|
||||
function isFileUploaded($indexInPost="file")
|
||||
{
|
||||
|
||||
$this->errCode = isset($_FILES[$indexInPost]['error'])?$_FILES[$indexInPost]['error']:999;
|
||||
if((isset($_FILES[$indexInPost]['error']) && $_FILES[$indexInPost] == 0) ||
|
||||
(!empty($_FILES[$indexInPost]['tmp_name']) && $_FILES[$indexInPost]['tmp_name'] != 'none')
|
||||
)
|
||||
{
|
||||
$this->_value = $_FILES[$indexInPost];
|
||||
$this->fileSize = @filesize($this->_value['tmp_name']);
|
||||
$this->originalFileName = $this->_value['name'];
|
||||
$this->fileType = $this->_value['type'];
|
||||
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
|
||||
array_push($this->errors, 'Unable to upload file');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getErrorCodeMsg()
|
||||
{
|
||||
return (isset($this->errorCodes[$this->errCode])?$this->errorCodes[$this->errCode]:"");
|
||||
}
|
||||
/**
|
||||
* check if the uploaded file extension is allowed against the validFile Extension
|
||||
* or against the invalid extension list when the list of valid file extension is not set
|
||||
*
|
||||
* @param array $validFileExt
|
||||
* @return boolean
|
||||
*/
|
||||
function isPermittedFileExt($validFileExt = array())
|
||||
{
|
||||
$tem = array();
|
||||
|
||||
if(sizeof($validFileExt))
|
||||
{
|
||||
foreach($validFileExt as $k=>$v)
|
||||
{
|
||||
$tem[$k] = strtolower(trim($v));
|
||||
}
|
||||
}
|
||||
$validFileExt = $tem;
|
||||
|
||||
if(sizeof($validFileExt) && sizeof($this->invalidFileExt))
|
||||
{
|
||||
foreach($validFileExt as $k=>$ext)
|
||||
{
|
||||
if(array_search(strtolower($ext), $this->invalidFileExt) !== false)
|
||||
{
|
||||
unset($validFileExt[$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(sizeof($validFileExt))
|
||||
{
|
||||
if(array_search(strtolower($this->getFileExt()), $validFileExt) !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}elseif(array_search(strtolower($this->getFileExt()), $this->invalidFileExt) === false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
$this->deleteUploadedFile();
|
||||
return false;
|
||||
|
||||
}
|
||||
/**
|
||||
* check if the uploaded file size is too big
|
||||
*
|
||||
* @param integer $maxSize
|
||||
*/
|
||||
function isSizeTooBig($maxSize="")
|
||||
{
|
||||
if($this->fileSize > $maxSize)
|
||||
{
|
||||
$this->deleteUploadedFile();
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* set the invali file extensions
|
||||
*
|
||||
* @param array $invalidFileExt
|
||||
*/
|
||||
function setInvalidFileExt($invalidFileExt=array())
|
||||
{
|
||||
$tem = array();
|
||||
if(sizeof($invalidFileExt))
|
||||
{
|
||||
foreach($invalidFileExt as $k=>$v)
|
||||
{
|
||||
$tem[$k]= strtolower(trim($v));
|
||||
}
|
||||
}
|
||||
|
||||
$this->invalidFileExt = $tem;
|
||||
}
|
||||
/**
|
||||
* get file type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getFileType()
|
||||
{
|
||||
return $this->fileType;
|
||||
}
|
||||
/**
|
||||
* get a file extension
|
||||
*
|
||||
* @param string $fileName the path to a file or just the file name
|
||||
*/
|
||||
function getFileExt()
|
||||
{
|
||||
//return strtolower(substr(strrchr($this->fileName, "."), 1));
|
||||
return substr(strrchr($this->originalFileName, "."), 1);
|
||||
}
|
||||
/**
|
||||
* move the uploaded file to a specific location
|
||||
*
|
||||
* @param string $dest the path to the directory which the uploaded file will be moved to
|
||||
* @param string $fileBaseName the base name which the uploaded file will be renamed to
|
||||
* @param unknown_type $overwrite
|
||||
* @return unknown
|
||||
*/
|
||||
function moveUploadedFile($dest, $fileBaseName = '', $overwrite=false)
|
||||
{
|
||||
|
||||
//ensure the directory path ending with /
|
||||
if ($dest != '' && substr($dest, -1) != '/') {
|
||||
$dest .= '/';
|
||||
}
|
||||
$this->dirPath = $dest;
|
||||
$fileName = basename($this->_value['name']);
|
||||
|
||||
$dotIndex = strrpos($fileName, '.');
|
||||
$this->fileExtension = '';
|
||||
if(is_int($dotIndex))
|
||||
{
|
||||
$this->fileExtension = substr($fileName, $dotIndex);
|
||||
$this->fileBaseName = substr($fileName, 0, $dotIndex);
|
||||
}
|
||||
if(!empty($fileBaseName))
|
||||
{
|
||||
$this->fileBaseName = $fileBaseName;
|
||||
}
|
||||
$fileName = $this->fileBaseName . $this->fileExtension;
|
||||
$filePath = $dest . $fileName;
|
||||
|
||||
if(!$overwrite && file_exists($filePath) && is_file($filePath))
|
||||
{//rename
|
||||
|
||||
$counter = 0;
|
||||
while(file_exists($dest.$fileName) && is_file($dest .$fileName))
|
||||
{
|
||||
$counter++;
|
||||
$fileName = $this->fileBaseName.'_'.$counter.$this->fileExtension;
|
||||
}
|
||||
$this->fileBaseName .= "_" . $counter;
|
||||
|
||||
}
|
||||
if (@move_uploaded_file($this->_value['tmp_name'], $dest . $fileName)) {
|
||||
@chmod($dest . $fileName, $this->uploadFileMode);
|
||||
$this->fileName = $fileName;
|
||||
$this->filePath = $dest . $fileName;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check if the uploaded is permitted to upload
|
||||
*
|
||||
* @param mixed $invalidImageExts invalid image extension
|
||||
* @param bool $delete force to delete the uploaded file
|
||||
*/
|
||||
function isImage($invalidImageExts = array(), $delete = true)
|
||||
{
|
||||
if(!is_array($invalidImageExts) && !empty($invalidImageExts))
|
||||
{
|
||||
$invalidImageExts = explode(",", $invalidImageExts);
|
||||
}
|
||||
foreach ($invalidImageExts as $k=>$v)
|
||||
{
|
||||
$invalidImageExts[$k] = strtolower(trim($v));
|
||||
}
|
||||
foreach ($this->validImageExts as $k=>$v)
|
||||
{
|
||||
$ValidImageExts[$k] = strtolower(trim($v));
|
||||
}
|
||||
if(sizeof($invalidImageExts))
|
||||
{
|
||||
foreach ($ValidImageExts as $k=>$v)
|
||||
{
|
||||
if(array_search(strtolower($v), $invalidImageExts) !== false)
|
||||
{
|
||||
unset($ValidImageExts[$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_search(strtolower($this->getFileExt()), $ValidImageExts)!==false)
|
||||
{
|
||||
$this->_get_image_details($this->filePath);
|
||||
if(!empty($this->fileType))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}else
|
||||
{
|
||||
if($delete)
|
||||
{
|
||||
$this->deleteUploadedFile();
|
||||
}
|
||||
}
|
||||
|
||||
array($this->errors, "This file is not a image type file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resize the Image in the X and/or Y direction
|
||||
* If either is 0 it will be scaled proportionally
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $new_x
|
||||
* @param mixed $new_y
|
||||
* @param string $thumb_suffix
|
||||
*
|
||||
* @return mixed none or PEAR_error
|
||||
*/
|
||||
function resize($filePath, $thumb_suffix="", $new_x = 0, $new_y = 0)
|
||||
{
|
||||
|
||||
if(empty($filePath))
|
||||
{
|
||||
$filePath = $this->dirPath . $this->fileBaseName . $thumb_suffix . $this->fileExtension;
|
||||
}
|
||||
// 0 means keep original size
|
||||
if ($this->img_x > $this->img_y)
|
||||
$new_y = (int)($new_y/$this->img_x*$this->img_y);
|
||||
else if ($this->img_y > $this->img_x)
|
||||
$new_x = (int)($new_x/$this->img_y*$this->img_x);
|
||||
// Now do the library specific resizing.
|
||||
return $this->_resize($filePath,$new_x, $new_y);
|
||||
} // End resize
|
||||
|
||||
/**
|
||||
* resize the image and return the thumbnail image details array("width"=>, "height"=>, "name")
|
||||
*
|
||||
* @param string $fileName
|
||||
* @param int $new_x the thumbnail width
|
||||
* @param int $new_y the thumbnail height
|
||||
* @return unknown
|
||||
*/
|
||||
function _resize($fileName, $new_x, $new_y) {
|
||||
$functionName = 'ImageCreateFrom' . $this->fileType;
|
||||
|
||||
|
||||
if(function_exists($functionName))
|
||||
{
|
||||
$this->imgHandler = $functionName($this->filePath);
|
||||
}else
|
||||
{
|
||||
array_push($this->errors, $functionName . " function is unavailable");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(function_exists('ImageCreateTrueColor')){
|
||||
$new_img =ImageCreateTrueColor($new_x,$new_y);
|
||||
} else {
|
||||
$new_img =ImageCreate($new_x,$new_y);
|
||||
}
|
||||
if(function_exists('ImageCopyResampled')){
|
||||
ImageCopyResampled($new_img, $this->imgHandler, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
|
||||
} else {
|
||||
ImageCopyResized($new_img, $this->imgHandler, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
|
||||
}
|
||||
if($this->_imageSave($new_img, $fileName, 80))
|
||||
{
|
||||
return array("width"=>$new_x, "height"=>$new_y, "name"=>basename($fileName));
|
||||
}else
|
||||
{
|
||||
|
||||
array_push($this->errors, "Unable to resize the image");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* save the thumbnail file and destroy the opened image
|
||||
*
|
||||
* @param resource $newImageHandler
|
||||
* @param string $fileName
|
||||
* @param int $quality
|
||||
* @return boolean
|
||||
*/
|
||||
function _imageSave($newImageHandler, $fileName, $quality = 90)
|
||||
{
|
||||
$functionName = 'image' . $this->fileType;
|
||||
if($functionName($newImageHandler, $fileName, $quality))
|
||||
{
|
||||
imagedestroy($newImageHandler);
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
imagedestroy($newImageHandler);
|
||||
array_push($this->errors, "Unable to save the thumbnail file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function _get_image_details($image)
|
||||
{
|
||||
|
||||
//echo $image;
|
||||
$data = @GetImageSize($image);
|
||||
#1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order,
|
||||
# 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC
|
||||
if (is_array($data)){
|
||||
switch($data[2]){
|
||||
case 1:
|
||||
$type = 'gif';
|
||||
break;
|
||||
case 2:
|
||||
$type = 'jpeg';
|
||||
break;
|
||||
case 3:
|
||||
$type = 'png';
|
||||
break;
|
||||
case 4:
|
||||
$type = 'swf';
|
||||
break;
|
||||
case 5:
|
||||
$type = 'psd';
|
||||
case 6:
|
||||
$type = 'bmp';
|
||||
case 7:
|
||||
case 8:
|
||||
$type = 'tiff';
|
||||
default:
|
||||
array_push($this->errors, "We do not recognize this image format");
|
||||
|
||||
}
|
||||
$this->img_x = $data[0];
|
||||
$this->img_y = $data[1];
|
||||
$this->fileType = $type;
|
||||
|
||||
return true;
|
||||
} else {
|
||||
array_push($this->errors, "Cannot fetch image or images details.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* caculate the thumbnail details from the original image file
|
||||
*
|
||||
* @param string $originalImageName
|
||||
* @param int $originaleImageWidth
|
||||
* @param int $originalImageHeight
|
||||
* @param string $thumbnailSuffix
|
||||
* @param int $thumbnailWidth
|
||||
* @param int $thumbnailHeight
|
||||
* @return array array("name"=>"image name", "width"=>"image width", "height"=>"image height")
|
||||
*/
|
||||
function getThumbInfo($originalImageName, $originaleImageWidth, $originalImageHeight, $thumbnailSuffix, $thumbnailWidth, $thumbnailHeight)
|
||||
{
|
||||
$outputs = array("name"=>"", "width"=>0, "height"=>0);
|
||||
$thumbnailWidth = (int)($thumbnailWidth);
|
||||
$thumbnailHeight = (int)($thumbnailHeight);
|
||||
if(!empty($originalImageName) && !empty($originaleImageWidth) && !empty($originalImageHeight))
|
||||
{
|
||||
$dotIndex = strrpos($originalImageName, '.');
|
||||
//begin to get the thumbnail image name
|
||||
$fileExtension = '';
|
||||
$fileBaseName = '';
|
||||
if(is_int($dotIndex))
|
||||
{
|
||||
$fileExtension = substr($originalImageName, $dotIndex);
|
||||
$fileBaseName = substr($originalImageName, 0, $dotIndex);
|
||||
}
|
||||
$outputs['name'] = $fileBaseName . $thumbnailSuffix . $fileExtension;
|
||||
//start to get the thumbnail width & height
|
||||
if($thumbnailWidth < 1 && $thumbnailHeight < 1)
|
||||
{
|
||||
$thumbnailWidth =$originaleImageWidth;
|
||||
$thumbnailHeight = $originalImageHeight;
|
||||
}elseif($thumbnailWidth < 1)
|
||||
{
|
||||
$thumbnailWidth = floor($thumbnailHeight / $originalImageHeight * $originaleImageWidth);
|
||||
|
||||
}elseif($thumbnailHeight < 1)
|
||||
{
|
||||
$thumbnailHeight = floor($thumbnailWidth / $originaleImageWidth * $originalImageHeight);
|
||||
}else
|
||||
{
|
||||
$scale = min($thumbnailWidth/$originaleImageWidth, $thumbnailHeight/$originalImageHeight);
|
||||
$thumbnailWidth = floor($scale*$originaleImageWidth);
|
||||
$thumbnailHeight = floor($scale*$originalImageHeight);
|
||||
}
|
||||
$outputs['width'] = $thumbnailWidth;
|
||||
$outputs['height'] = $thumbnailHeight;
|
||||
}
|
||||
return $outputs;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get the uploaded file
|
||||
*/
|
||||
function deleteUploadedFile()
|
||||
{
|
||||
@unlink($this->filePath);
|
||||
}
|
||||
/**
|
||||
* destroy the tmp file
|
||||
*
|
||||
*/
|
||||
function finish()
|
||||
{
|
||||
@unlink($this->_value['tmp_name']);
|
||||
}
|
||||
|
||||
function displayError()
|
||||
{
|
||||
if(sizeof($this->errors))
|
||||
{
|
||||
echo "<pre>";
|
||||
print_r($this->errors);
|
||||
echo "</pre>";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* get the path which the file uploaded to
|
||||
*
|
||||
*/
|
||||
function getFilePath()
|
||||
{
|
||||
return $this->filePath;
|
||||
}
|
||||
/**
|
||||
* return the directory path witch the file uploaded to
|
||||
*
|
||||
* @return unknown
|
||||
*/
|
||||
function getDirPath()
|
||||
{
|
||||
return $this->dirPath;
|
||||
}
|
||||
|
||||
function getFileBaseName()
|
||||
{
|
||||
return $this->fileBaseName;
|
||||
}
|
||||
|
||||
function getFileName()
|
||||
{
|
||||
return $this->fileName;
|
||||
}
|
||||
/**
|
||||
* get image width
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
function getImageWidth()
|
||||
{
|
||||
return $this->img_x;
|
||||
}
|
||||
/**
|
||||
* get image height
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
function getImageHeight()
|
||||
{
|
||||
return $this->img_y;
|
||||
}
|
||||
/**
|
||||
* get uploaded file size
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getFileSize()
|
||||
{
|
||||
return $this->fileSize;
|
||||
}
|
||||
/**
|
||||
* delete the uploaded image file & associated thumnails
|
||||
*
|
||||
* @param string $dirPath
|
||||
* @param string $originalImageName
|
||||
* @param string $arrayThumbnailSuffix
|
||||
*/
|
||||
function deleteFileAndThumbs($dirPath, $originalImageName, $arrayThumbnailSuffix)
|
||||
{
|
||||
//ensure the directory path ending with /
|
||||
if ($dirPath != '' && substr($dirPath, -1) != '/') {
|
||||
$dirPath .= '/';
|
||||
}
|
||||
if(!empty($originalImageName) && file_exists($dirPath . $originalImageName) && is_file($dirPath . $originalImageName))
|
||||
{
|
||||
@unlink($dirPath . $originalImageName);
|
||||
foreach($arrayThumbnailSuffix as $v)
|
||||
{
|
||||
$dotIndex = strrpos($originalImageName, '.');
|
||||
//begin to get the thumbnail image name
|
||||
$fileExtension = '';
|
||||
$fileBaseName = '';
|
||||
if(is_int($dotIndex))
|
||||
{
|
||||
$fileExtension = substr($originalImageName, $dotIndex);
|
||||
$fileBaseName = substr($originalImageName, 0, $dotIndex);
|
||||
}
|
||||
@unlink($dirPath . $fileBaseName . $v . $fileExtension);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,135 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* sysem base config setting
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 1/August/2007
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
//error_reporting(E_ALL);
|
||||
//error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
|
||||
|
||||
//Access Control Setting
|
||||
/**
|
||||
* turn off => false
|
||||
* by session => true
|
||||
*/
|
||||
define('CONFIG_ACCESS_CONTROL_MODE', false);
|
||||
define("CONFIG_LOGIN_USERNAME", 'sdfgdfgdfgdgfdgsdfsdfg3454dsfb5e');
|
||||
define('CONFIG_LOGIN_PASSWORD', 'ASDF@#%JHGSDFGasdkjfh3812764ksdjfbhkjxcf');
|
||||
define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page
|
||||
|
||||
|
||||
//SYSTEM MODE CONFIG
|
||||
/**
|
||||
* turn it on when you have this system for demo purpose
|
||||
* that means changes made to each image is not physically applied to it
|
||||
* and all uploaded files/created folders will be removed automatically
|
||||
*/
|
||||
define('CONFIG_SYS_DEMO_ENABLE', false);
|
||||
define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only
|
||||
define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false
|
||||
|
||||
//User Permissions
|
||||
define('CONFIG_OPTIONS_DELETE', true);
|
||||
define('CONFIG_OPTIONS_CUT', true);
|
||||
define('CONFIG_OPTIONS_COPY', true);
|
||||
define('CONFIG_OPTIONS_NEWFOLDER', true);
|
||||
define('CONFIG_OPTIONS_RENAME', true);
|
||||
define('CONFIG_OPTIONS_UPLOAD', true); //
|
||||
define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor
|
||||
//FILESYSTEM CONFIG
|
||||
/*
|
||||
* CONFIG_SYS_DEFAULT_PATH is the default folder where the files would be uploaded to
|
||||
and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder
|
||||
these two paths accept relative path only, don't use absolute path
|
||||
*/
|
||||
//check if folder exist
|
||||
if (!is_dir('../../img/cms'))
|
||||
mkdir('../../img/cms');
|
||||
|
||||
define('CONFIG_SYS_DEFAULT_PATH', '../../img/cms'); //accept relative path only
|
||||
define('CONFIG_SYS_ROOT_PATH', '../../img/cms'); //accept relative path only
|
||||
define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name
|
||||
define("CONFIG_SYS_DIR_SESSION_PATH", 'session/');
|
||||
define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns
|
||||
/**
|
||||
* reg => regulare expression
|
||||
* csv => a list of comma separated file/folder name, (exactly match the specified file/folders)
|
||||
* list => a list of comma spearated vague file/folder name (partially match the specified file/folders)
|
||||
*
|
||||
*/
|
||||
//more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php
|
||||
define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple
|
||||
define('CONFIG_SYS_EXC_DIR_PATTERN', 'CVS'); //will prevent listing of folders with such pattern(s). separated by , if multiple
|
||||
define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple
|
||||
define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple
|
||||
define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1
|
||||
|
||||
//UPLOAD OPTIONS CONFIG
|
||||
define('CONFIG_UPLOAD_MAXSIZE', 5000 * 1024 ); //by bytes
|
||||
//define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'txt');//
|
||||
|
||||
define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid
|
||||
|
||||
define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste
|
||||
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png');// //
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//
|
||||
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png');
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
|
||||
define('CONFIG_UPLOAD_INVALID_EXTS', '');
|
||||
|
||||
//Preview
|
||||
define('CONFIG_IMG_THUMBNAIL_MAX_X', 100);
|
||||
define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100);
|
||||
define('CONFIG_THICKBOX_MAX_WIDTH', 700);
|
||||
define('CONFIG_THICKBOX_MAX_HEIGHT', 430);
|
||||
|
||||
|
||||
/**
|
||||
* CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8
|
||||
* Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT
|
||||
* Howerver, some Web Hosts do not have standard php.ini setting
|
||||
* which you will find the file manager can not locate your files correctly
|
||||
* if you do have such issue, please change it to fit your system.
|
||||
* so what should you to do get it
|
||||
* 1. create a php script file (let's call it document_root.php)
|
||||
* 2. add the following codes in in
|
||||
* <?php
|
||||
* echo dirname(__FILE__);
|
||||
* ?>
|
||||
* 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer
|
||||
* 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that
|
||||
* 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be
|
||||
* 6. enjoy it
|
||||
|
||||
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define('CONFIG_WEBSITE_DOCUMENT_ROOT', '');
|
||||
//theme related setting
|
||||
/*
|
||||
* options avaialbe for CONFIG_EDITOR_NAME are:
|
||||
stand_alone
|
||||
tinymce
|
||||
fckeditor
|
||||
*/
|
||||
//CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8
|
||||
define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'tinymce'));
|
||||
define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default
|
||||
define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail
|
||||
define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10);
|
||||
define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client
|
||||
|
||||
//General Option Declarations
|
||||
//LANGAUGAE DECLARATIONNS
|
||||
define('CONFIG_LANG_INDEX', 'language'); //the index in the session
|
||||
define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php')?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en
|
||||
?>
|
||||
@@ -1,107 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* sysem config setting
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @version 1.0
|
||||
* @since 22/April/2007
|
||||
*
|
||||
*/
|
||||
|
||||
//FILESYSTEM CONFIG <br>
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.auth.php");
|
||||
define('CONFIG_QUERY_STRING_ENABLE', true); //Enable passed query string to setting the system configuration
|
||||
if(!isset($_SESSION))
|
||||
{
|
||||
session_start();
|
||||
}
|
||||
if(!headers_sent())
|
||||
{
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* secure file name which retrieve from query string
|
||||
*
|
||||
* @param string $input
|
||||
* @return string
|
||||
*/
|
||||
function secureFileName($input)
|
||||
{
|
||||
return preg_replace('/[^a-zA-Z0-9\-_]/', '', $input);
|
||||
}
|
||||
//Directories Declarations
|
||||
|
||||
define('DIR_AJAX_ROOT', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR) ; // the path to ajax file manager
|
||||
define('DIR_AJAX_INC', DIR_AJAX_ROOT . "inc" . DIRECTORY_SEPARATOR);
|
||||
define('DIR_AJAX_CLASSES', DIR_AJAX_ROOT . "classes" . DIRECTORY_SEPARATOR);
|
||||
define("DIR_AJAX_LANGS", DIR_AJAX_ROOT . "langs" . DIRECTORY_SEPARATOR);
|
||||
define('DIR_AJAX_JS', DIR_AJAX_ROOT . 'jscripts' . DIRECTORY_SEPARATOR);
|
||||
define('DIR_AJAX_EDIT_AREA', DIR_AJAX_JS . 'edit_area' . DIRECTORY_SEPARATOR);
|
||||
define('DIR_LANG', DIR_AJAX_ROOT . 'langs' . DIRECTORY_SEPARATOR);
|
||||
|
||||
|
||||
//Class Declarations
|
||||
define('CLASS_FILE', DIR_AJAX_INC .'class.file.php');
|
||||
define("CLASS_UPLOAD", DIR_AJAX_INC . 'class.upload.php');
|
||||
define('CLASS_MANAGER', DIR_AJAX_INC . 'class.manager.php');
|
||||
define('CLASS_IMAGE', DIR_AJAX_INC . "class.image.php");
|
||||
define('CLASS_HISTORY', DIR_AJAX_INC . "class.history.php");
|
||||
define('CLASS_SESSION_ACTION', DIR_AJAX_INC . "class.sessionaction.php");
|
||||
define('CLASS_PAGINATION', DIR_AJAX_INC . 'class.pagination.php');
|
||||
define('CLASS_SEARCH', DIR_AJAX_INC . "class.search.php");
|
||||
//SCRIPT FILES declarations
|
||||
define('SPT_FUNCTION_BASE', DIR_AJAX_INC . 'function.base.php');
|
||||
//include different config base file according to query string "config"
|
||||
$configBaseFileName = 'config.base.php';
|
||||
|
||||
if(CONFIG_QUERY_STRING_ENABLE && !empty($_GET['config']) && file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'config.' . secureFileName($_GET['config']) . ".php")
|
||||
{
|
||||
$configBaseFileName = 'config.' . secureFileName($_GET['config']) . ".php";
|
||||
}
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . $configBaseFileName);
|
||||
|
||||
|
||||
require_once(DIR_AJAX_LANGS . CONFIG_LANG_DEFAULT . ".php");
|
||||
require_once(DIR_AJAX_INC . "function.base.php");
|
||||
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.session.php");
|
||||
$session = new Session();
|
||||
$auth = new Auth();
|
||||
|
||||
if(CONFIG_ACCESS_CONTROL_MODE == 1)
|
||||
{//access control enabled
|
||||
if(!$auth->isLoggedIn() && strtolower(basename($_SERVER['PHP_SELF']) != strtolower(basename(CONFIG_LOGIN_PAGE))))
|
||||
{//
|
||||
header('Location: ' . appendQueryString(CONFIG_LOGIN_PAGE, makeQueryString()));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
addNoCacheHeaders();
|
||||
//URL Declartions
|
||||
define('CONFIG_URL_IMAGE_PREVIEW', 'ajax_image_preview.php');
|
||||
define('CONFIG_URL_CREATE_FOLDER', 'ajax_create_folder.php');
|
||||
define('CONFIG_URL_DELETE', 'ajax_delete_file.php');
|
||||
define('CONFIG_URL_HOME', 'ajaxfilemanager.php');
|
||||
define("CONFIG_URL_UPLOAD", 'ajax_file_upload.php');
|
||||
define('CONFIG_URL_PREVIEW', 'ajax_preview.php');
|
||||
define('CONFIG_URL_SAVE_NAME', 'ajax_save_name.php');
|
||||
define('CONFIG_URL_IMAGE_EDITOR', 'ajax_image_editor.php');
|
||||
define('CONFIG_URL_IMAGE_SAVE', 'ajax_image_save.php');
|
||||
define('CONFIG_URL_IMAGE_RESET', 'ajax_editor_reset.php');
|
||||
define('CONFIG_URL_IMAGE_UNDO', 'ajax_image_undo.php');
|
||||
define('CONFIG_URL_CUT', 'ajax_file_cut.php');
|
||||
define('CONFIG_URL_COPY', 'ajax_file_copy.php');
|
||||
define('CONFIG_URL_LOAD_FOLDERS', '_ajax_load_folders.php');
|
||||
|
||||
define('CONFIG_URL_DOWNLOAD', 'ajax_download.php');
|
||||
define('CONFIG_URL_TEXT_EDITOR', 'ajax_text_editor.php');
|
||||
define('CONFIG_URL_GET_FOLDER_LIST', 'ajax_get_folder_listing.php');
|
||||
define('CONFIG_URL_SAVE_TEXT', 'ajax_save_text.php');
|
||||
define('CONFIG_URL_LIST_LISTING', 'ajax_get_file_listing.php');
|
||||
define('CONFIG_URL_IMG_THUMBNAIL', 'ajax_image_thumbnail.php');
|
||||
define('CONFIG_URL_FILEnIMAGE_MANAGER', 'ajaxfilemanager.php');
|
||||
define('CONFIG_URL_FILE_PASTE', 'ajax_file_paste.php');
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,131 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* sysem base config setting
|
||||
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
|
||||
* @link www.phpletter.com
|
||||
* @since 1/August/2007
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
error_reporting(E_ALL);
|
||||
//error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
|
||||
|
||||
//Access Control Setting
|
||||
/**
|
||||
* turn off => false
|
||||
* by session => true
|
||||
*/
|
||||
define('CONFIG_ACCESS_CONTROL_MODE', false);
|
||||
define("CONFIG_LOGIN_USERNAME", 'ajax');
|
||||
define('CONFIG_LOGIN_PASSWORD', '123456');
|
||||
define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page
|
||||
|
||||
//SYSTEM MODE CONFIG
|
||||
/**
|
||||
* turn it on when you have this system for demo purpose
|
||||
* that means changes made to each image is not physically applied to it
|
||||
* and all uploaded files/created folders will be removed automatically
|
||||
*/
|
||||
define('CONFIG_SYS_DEMO_ENABLE', false);
|
||||
define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only
|
||||
define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false
|
||||
|
||||
//User Permissions
|
||||
define('CONFIG_OPTIONS_DELETE', true);
|
||||
define('CONFIG_OPTIONS_CUT', true);
|
||||
define('CONFIG_OPTIONS_COPY', true);
|
||||
define('CONFIG_OPTIONS_NEWFOLDER', true);
|
||||
define('CONFIG_OPTIONS_RENAME', true);
|
||||
define('CONFIG_OPTIONS_UPLOAD', true); //
|
||||
define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor
|
||||
//FILESYSTEM CONFIG
|
||||
/*
|
||||
* CONFIG_SYS_DEFAULT_PATH is the default folder where the files would be uploaded to
|
||||
and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder
|
||||
these two paths accept relative path only, don't use absolute path
|
||||
*/
|
||||
|
||||
define('CONFIG_SYS_DEFAULT_PATH', '../uploaded/'); //accept relative path only
|
||||
define('CONFIG_SYS_ROOT_PATH', '../uploaded/'); //accept relative path only
|
||||
define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name
|
||||
define("CONFIG_SYS_DIR_SESSION_PATH", 'session/');
|
||||
define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns
|
||||
/**
|
||||
* reg => regulare expression
|
||||
* csv => a list of comma separated file/folder name, (exactly match the specified file/folders)
|
||||
* list => a list of comma spearated vague file/folder name (partially match the specified file/folders)
|
||||
*
|
||||
*/
|
||||
//more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php
|
||||
define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple
|
||||
define('CONFIG_SYS_EXC_DIR_PATTERN', ''); //will prevent listing of folders with such pattern(s). separated by , if multiple
|
||||
define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple
|
||||
define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple
|
||||
define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1
|
||||
|
||||
//UPLOAD OPTIONS CONFIG
|
||||
define('CONFIG_UPLOAD_MAXSIZE', 5000 * 1024 ); //by bytes
|
||||
//define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'txt');//
|
||||
|
||||
define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid
|
||||
|
||||
define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste
|
||||
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//
|
||||
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf');
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
|
||||
define('CONFIG_UPLOAD_INVALID_EXTS', '');
|
||||
|
||||
//Preview
|
||||
define('CONFIG_IMG_THUMBNAIL_MAX_X', 100);
|
||||
define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100);
|
||||
define('CONFIG_THICKBOX_MAX_WIDTH', 700);
|
||||
define('CONFIG_THICKBOX_MAX_HEIGHT', 430);
|
||||
|
||||
|
||||
/**
|
||||
* CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8
|
||||
* Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT
|
||||
* Howerver, some Web Hosts do not have standard php.ini setting
|
||||
* which you will find the file manager can not locate your files correctly
|
||||
* if you do have such issue, please change it to fit your system.
|
||||
* so what should you to do get it
|
||||
* 1. create a php script file (let's call it document_root.php)
|
||||
* 2. add the following codes in in
|
||||
* <?php
|
||||
* echo dirname(__FILE__);
|
||||
* ?>
|
||||
* 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer
|
||||
* 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that
|
||||
* 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be
|
||||
* 6. enjoy it
|
||||
|
||||
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define('CONFIG_WEBSITE_DOCUMENT_ROOT', '');
|
||||
//theme related setting
|
||||
/*
|
||||
* options avaialbe for CONFIG_EDITOR_NAME are:
|
||||
stand_alone
|
||||
tinymce
|
||||
fckeditor
|
||||
*/
|
||||
//CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8
|
||||
define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone'));
|
||||
define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default
|
||||
define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail
|
||||
define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10);
|
||||
define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client
|
||||
|
||||
//General Option Declarations
|
||||
//LANGAUGAE DECLARATIONNS
|
||||
define('CONFIG_LANG_INDEX', 'language'); //the index in the session
|
||||
define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language'] . '.php'))?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en
|
||||
?>
|
||||
@@ -1,8 +0,0 @@
|
||||
<pre>Array
|
||||
(
|
||||
[currentFolderPath] => ../uploaded/
|
||||
[new_folder] => Test
|
||||
)
|
||||
</pre>
|
||||
|
||||
22/Sep/2008 13:17:12
|
||||
@@ -1,564 +0,0 @@
|
||||
//jquery.js. start
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7(1g 18.6=="I"){18.I=18.I;u 6=q(a,c){7(18==9||!9.3X)v 14 6(a,c);v 9.3X(a,c)};7(1g $!="I")6.1I$=$;u $=6;6.11=6.8r={3X:q(a,c){a=a||P;7(6.16(a))v 14 6(P)[6.11.1G?"1G":"1W"](a);7(1g a=="1s"){u m=/^[^<]*(<(.|\\s)+>)[^>]*$/.1V(a);7(m)a=6.31([m[1]]);B v 14 6(c).1L(a)}v 9.4E(a.15==2b&&a||(a.3C||a.C&&a!=18&&!a.1q&&a[0]!=I&&a[0].1q)&&6.2L(a)||[a])},3C:"1.1.3.1",7W:q(){v 9.C},C:0,1M:q(a){v a==I?6.2L(9):9[a]},1Z:q(a){u b=6(a);b.5q=9;v b},4E:q(a){9.C=0;[].R.O(9,a);v 9},F:q(a,b){v 6.F(9,a,b)},2p:q(a){u b=-1;9.F(q(i){7(9==a)b=i});v b},1b:q(f,d,e){u c=f;7(f.15==33)7(d==I)v 9.C&&6[e||"1b"](9[0],f)||I;B{c={};c[f]=d}v 9.F(q(a){E(u b V c)6.1b(e?9.T:9,b,6.4H(9,c[b],e,a,b))})},1f:q(b,a){v 9.1b(b,a,"2z")},2A:q(e){7(1g e=="1s")v 9.2Y().3e(P.66(e));u t="";6.F(e||9,q(){6.F(9.2S,q(){7(9.1q!=8)t+=9.1q!=1?9.5R:6.11.2A([9])})});v t},8b:q(){u a,1S=19;v 9.F(q(){7(!a)a=6.31(1S,9.2O);u b=a[0].3s(K);9.L.2K(b,9);1v(b.1d)b=b.1d;b.4g(9)})},3e:q(){v 9.2F(19,K,1,q(a){9.4g(a)})},5w:q(){v 9.2F(19,K,-1,q(a){9.2K(a,9.1d)})},5t:q(){v 9.2F(19,N,1,q(a){9.L.2K(a,9)})},5s:q(){v 9.2F(19,N,-1,q(a){9.L.2K(a,9.1X)})},2U:q(){v 9.5q||6([])},1L:q(t){u b=6.3k(9,q(a){v 6.1L(t,a)});v 9.1Z(/[^+>] [^+>]/.17(t)||t.J("..")>-1?6.5g(b):b)},7x:q(e){u d=9.1A(9.1L("*"));d.F(q(){9.1I$1a={};E(u a V 9.$1a)9.1I$1a[a]=6.1c({},9.$1a[a])}).3U();u r=9.1Z(6.3k(9,q(a){v a.3s(e!=I?e:K)}));d.F(q(){u b=9.1I$1a;E(u a V b)E(u c V b[a])6.S.1A(9,a,b[a][c],b[a][c].W);9.1I$1a=H});v r},1i:q(t){v 9.1Z(6.16(t)&&6.2s(9,q(b,a){v t.O(b,[a])})||6.2x(t,9))},4Y:q(t){v 9.1Z(t.15==33&&6.2x(t,9,K)||6.2s(9,q(a){v(t.15==2b||t.3C)?6.2w(a,t)<0:a!=t}))},1A:q(t){v 9.1Z(6.1T(9.1M(),t.15==33?6(t).1M():t.C!=I&&(!t.Q||t.Q=="6Z")?t:[t]))},37:q(a){v a?6.2x(a,9).C>0:N},6R:q(a){v a==I?(9.C?9[0].2v:H):9.1b("2v",a)},3F:q(a){v a==I?(9.C?9[0].27:H):9.2Y().3e(a)},2F:q(f,d,g,e){u c=9.C>1,a;v 9.F(q(){7(!a){a=6.31(f,9.2O);7(g<0)a.6E()}u b=9;7(d&&6.Q(9,"1r")&&6.Q(a[0],"2V"))b=9.3R("1z")[0]||9.4g(P.5h("1z"));6.F(a,q(){e.O(b,[c?9.3s(K):9])})})}};6.1c=6.11.1c=q(){u c=19[0],a=1;7(19.C==1){c=9;a=0}u b;1v((b=19[a++])!=H)E(u i V b)c[i]=b[i];v c};6.1c({6n:q(){7(6.1I$)$=6.1I$;v 6},16:q(a){v!!a&&1g a!="1s"&&!a.Q&&a.15!=2b&&/q/i.17(a+"")},40:q(a){v a.4z&&a.2O&&!a.2O.4y},Q:q(b,a){v b.Q&&b.Q.1D()==a.1D()},F:q(a,b,c){7(a.C==I)E(u i V a)b.O(a[i],c||[i,a[i]]);B E(u i=0,4x=a.C;i<4x;i++)7(b.O(a[i],c||[i,a[i]])===N)1F;v a},4H:q(c,b,d,e,a){7(6.16(b))b=b.3D(c,[e]);u f=/z-?2p|5Y-?8p|1e|5U|8i-?1u/i;v b&&b.15==3y&&d=="2z"&&!f.17(a)?b+"4o":b},12:{1A:q(b,c){6.F(c.2R(/\\s+/),q(i,a){7(!6.12.3w(b.12,a))b.12+=(b.12?" ":"")+a})},1E:q(b,c){b.12=c!=I?6.2s(b.12.2R(/\\s+/),q(a){v!6.12.3w(c,a)}).5M(" "):""},3w:q(t,c){v 6.2w(c,(t.12||t).3v().2R(/\\s+/))>-1}},4m:q(e,o,f){E(u i V o){e.T["2N"+i]=e.T[i];e.T[i]=o[i]}f.O(e,[]);E(u i V o)e.T[i]=e.T["2N"+i]},1f:q(e,p){7(p=="1u"||p=="29"){u b={},3r,3p,d=["83","81","80","7Y"];6.F(d,q(){b["7V"+9]=0;b["7T"+9+"7S"]=0});6.4m(e,b,q(){7(6(e).37(\':4f\')){3r=e.7Q;3p=e.7O}B{e=6(e.3s(K)).1L(":4b").5v("2B").2U().1f({48:"1y",3i:"7L",U:"2h",7K:"0",7I:"0"}).5o(e.L)[0];u a=6.1f(e.L,"3i")||"3n";7(a=="3n")e.L.T.3i="7G";3r=e.7E;3p=e.7D;7(a=="3n")e.L.T.3i="3n";e.L.3q(e)}});v p=="1u"?3r:3p}v 6.2z(e,p)},2z:q(e,a,d){u g;7(a=="1e"&&6.M.1h){g=6.1b(e.T,"1e");v g==""?"1":g}7(a.3t(/3x/i))a=6.1U;7(!d&&e.T[a])g=e.T[a];B 7(P.3f&&P.3f.3Y){7(a.3t(/3x/i))a="3x";a=a.1o(/([A-Z])/g,"-$1").2H();u b=P.3f.3Y(e,H);7(b)g=b.57(a);B 7(a=="U")g="1P";B 6.4m(e,{U:"2h"},q(){u c=P.3f.3Y(9,"");g=c&&c.57(a)||""})}B 7(e.3S){u f=a.1o(/\\-(\\w)/g,q(m,c){v c.1D()});g=e.3S[a]||e.3S[f]}v g},31:q(a,c){u r=[];c=c||P;6.F(a,q(i,b){7(!b)v;7(b.15==3y)b=b.3v();7(1g b=="1s"){u s=6.2C(b).2H(),1x=c.5h("1x"),1N=[];u a=!s.J("<1H")&&[1,"<2y>","</2y>"]||!s.J("<7g")&&[1,"<52>","</52>"]||(!s.J("<7c")||!s.J("<1z")||!s.J("<7a")||!s.J("<78"))&&[1,"<1r>","</1r>"]||!s.J("<2V")&&[2,"<1r><1z>","</1z></1r>"]||(!s.J("<75")||!s.J("<74"))&&[3,"<1r><1z><2V>","</2V></1z></1r>"]||!s.J("<73")&&[2,"<1r><4W>","</4W></1r>"]||[0,"",""];1x.27=a[1]+b+a[2];1v(a[0]--)1x=1x.1d;7(6.M.1h){7(!s.J("<1r")&&s.J("<1z")<0)1N=1x.1d&&1x.1d.2S;B 7(a[1]=="<1r>"&&s.J("<1z")<0)1N=1x.2S;E(u n=1N.C-1;n>=0;--n)7(6.Q(1N[n],"1z")&&!1N[n].2S.C)1N[n].L.3q(1N[n])}b=6.2L(1x.2S)}7(0===b.C&&(!6.Q(b,"34")&&!6.Q(b,"2y")))v;7(b[0]==I||6.Q(b,"34")||b.71)r.R(b);B r=6.1T(r,b)});v r},1b:q(c,d,a){u e=6.40(c)?{}:6.3H;7(e[d]){7(a!=I)c[e[d]]=a;v c[e[d]]}B 7(a==I&&6.M.1h&&6.Q(c,"34")&&(d=="70"||d=="6Y"))v c.6W(d).5R;B 7(c.4z){7(a!=I)c.6U(d,a);7(6.M.1h&&/4M|2u/.17(d)&&!6.40(c))v c.35(d,2);v c.35(d)}B{7(d=="1e"&&6.M.1h){7(a!=I){c.5U=1;c.1i=(c.1i||"").1o(/4L\\([^)]*\\)/,"")+(39(a).3v()=="6M"?"":"4L(1e="+a*4X+")")}v c.1i?(39(c.1i.3t(/1e=([^)]*)/)[1])/4X).3v():""}d=d.1o(/-([a-z])/6K,q(z,b){v b.1D()});7(a!=I)c[d]=a;v c[d]}},2C:q(t){v t.1Line truncated
|
||||
//jquery end
|
||||
|
||||
|
||||
//form start
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.c.1h=6(7){3(C 7==\'6\')7={D:7};7=$.2j({1d:4.Q(\'1S\')||1n.2z,M:4.Q(\'2q\')||\'2k\'},7||{});2 a=4.1z(7.K);3(7.1X&&7.1X(a,4,7)===B)8 4;2 1g={};$.O.I(\'5.E.2x\',[a,4,7,1g]);3(1g.1g)8 4;2 q=$.1K(a);3(7.M.3u()==\'2k\'){7.1d+=(7.1d.3q(\'?\')>=0?\'&\':\'?\')+q;7.h=o}p 7.h=q;2 $5=4,L=[];3(7.1A)L.u(6(){$5.1A()});3(7.1x)L.u(6(){$5.1x()});3(!7.13&&7.12){2 1Y=7.D;L.u(6(h){$(7.12).Q("1W",h).2X().H(1Y,2R)})}p 3(7.D)L.u(7.D);7.D=6(h,1m){F(2 i=0,w=L.z;i<w;i++)L[i](h,1m,$5)};2 1o=$(\'A:2C\',4).R();2 1k=B;F(2 j=0;j<1o.z;j++)3(1o[j])1k=Y;3(7.1M||1k)2u();p $.3x(7);$.O.I(\'5.E.3v\',[4,7]);8 4;6 2u(){2 5=$5[0];2 k=$.2j({},$.3t,7);2 N=\'3p\'+$.c.1h.1e++;2 $d=$(\'<1M N="\'+N+\'" m="\'+N+\'" />\');2 d=$d[0];2 2h=$.1E.2d&&1n.2d.3g()<9;3($.1E.29||2h)d.3a=\'39:B;1C.37("");\';$d.36({35:\'34\',24:\'-23\',22:\'-23\'});2 l={V:o,1j:o,1m:0,2Z:\'n/a\',2Y:6(){},2W:6(){},2V:6(){}};2 g=k.2S;3(g&&!$.1U++)$.O.I("2P");3(g)$.O.I("2O",[l,k]);2 1T=0;2 1q=0;1c(6(){$d.2M(\'1F\');d.1R?d.1R(\'2m\',X):d.2E(\'1Q\',X,B);2 1P=5.1O?\'1O\':\'2D\';2 t=$5.Q(\'12\');$5.Q({12:N,2q:\'2B\',1P:\'2A/5-h\',1S:k.1d});3(k.1l)1c(6(){1q=Y;X()},k.1l);5.E();$5.Q(\'12\',t)},10);6 X(){3(1T++)8;d.1N?d.1N(\'2m\',X):d.2y(\'1Q\',X,B);2 18=Y;2w{3(1q)2v\'1l\';2 h,f;f=d.1L?d.1L.1C:d.2t?d.2t:d.1C;l.V=f.1F?f.1F.1W:o;l.1j=f.2s?f.2s:f;3(k.13==\'2r\'||k.13==\'3w\'){2 1I=f.1H(\'1G\')[0];h=1I?1I.r:l.V;3(k.13==\'2r\')3s("h = "+h);p $.3r(h)}p 3(k.13==\'2p\'){h=l.1j;3(!h&&l.V!=o)h=2o(l.V)}p{h=l.V}}3o(e){18=B;$.3n(k,l,\'2l\',e)}3(18){k.D(h,\'D\');3(g)$.O.I("3m",[l,k])}3(g)$.O.I("3l",[l,k]);3(g&&!--$.1U)$.O.I("3k");3(k.2i)k.2i(l,18?\'D\':\'2l\');1c(6(){$d.3j();l.1j=o},3i)};6 2o(s,f){3(1n.2g){f=2e 2g(\'3h.3f\');f.3e=\'B\';f.3d(s)}p f=(2e 3c()).3b(s,\'1w/2p\');8(f&&f.28&&f.28.1D!=\'38\')?f:o}}};$.c.1h.1e=0;$.c.P=6(7){8 4.27().E(1B).H(6(){4.1s=$.c.P.1e++;$.c.P.1r[4.1s]=7;$(":E,A:T",4).26(1y)})};$.c.P.1e=1;$.c.P.1r={};6 1y(e){2 $5=4.5;$5.J=4;3(4.M==\'T\'){3(e.25!=Z){$5.S=e.25;$5.U=e.33}p 3(C $.c.11==\'6\'){2 11=$(4).11();$5.S=e.21-11.22;$5.U=e.20-11.24}p{$5.S=e.21-4.32;$5.U=e.20-4.31}}1c(6(){$5.J=$5.S=$5.U=o},10)};6 1B(){2 N=4.1s;2 7=$.c.P.1r[N];$(4).1h(7);8 B};$.c.27=6(){4.1Z(\'E\',1B);8 4.H(6(){$(":E,A:T",4).1Z(\'26\',1y)})};$.c.1z=6(K){2 a=[];3(4.z==0)8 a;2 5=4[0];2 1b=K?5.1H(\'*\'):5.30;3(!1b)8 a;F(2 i=0,w=1b.z;i<w;i++){2 b=1b[i];2 n=b.m;3(!n)1v;3(K&&5.J&&b.M=="T"){3(!b.1u&&5.J==b)a.u({m:n+\'.x\',r:5.S},{m:n+\'.y\',r:5.U});1v}2 v=$.R(b,Y);3(v&&v.1a==19){F(2 j=0,1V=v.z;j<1V;j++)a.u({m:n,r:v[j]})}p 3(v!==o&&C v!=\'Z\')a.u({m:n,r:v})}3(!K&&5.J){2 1t=5.1H("A");F(2 i=0,w=1t.z;i<w;i++){2 A=1t[i];2 n=A.m;3(n&&!A.1u&&A.M=="T"&&5.J==A)a.u({m:n+\'.x\',r:5.S},{m:n+\'.y\',r:5.U})}}8 a};$.c.2U=6(K){8 $.1K(4.1z(K))};$.c.2T=6(G){2 a=[];4.H(6(){2 n=4.m;3(!n)8;2 v=$.R(4,G);3(v&&v.1a==19){F(2 i=0,w=v.z;i<w;i++)a.u({m:n,r:v[i]})}p 3(v!==o&&C v!=\'Z\')a.u({m:4.m,r:v})});8 $.1K(a)};$.c.R=6(G){F(2 1i=[],i=0,w=4.z;i<w;i++){2 b=4[i];2 v=$.R(b,G);3(v===o||C v==\'Z\'||(v.1a==19&&!v.z))1v;v.1a==19?$.2Q(1i,v):1i.u(v)}8 1i};$.R=6(b,G){2 n=b.m,t=b.M,W=b.1D.2b();3(C G==\'Z\')G=Y;3(G&&(!n||b.1u||t==\'14\'||t==\'2N\'||(t==\'2a\'||t==\'2f\')&&!b.2c||(t==\'E\'||t==\'T\')&&b.5&&b.5.J!=b||W==\'15\'&&b.1p==-1))8 o;3(W==\'15\'){2 1f=b.1p;3(1f<0)8 o;2 a=[],1J=b.7;2 16=(t==\'15-16\');2 w=(16?1f+1:1J.z);F(2 i=(16?1f:0);i<w;i++){2 17=1J[i];3(17.2L){2 v=$.1E.29&&!(17.2K[\'r\'].2J)?17.1w:17.r;3(16)8 v;a.u(v)}}8 a}8 b.r};$.c.1x=6(){8 4.H(6(){$(\'A,15,1G\',4).2n()})};$.c.2n=$.c.2I=6(){8 4.H(6(){2 t=4.M,W=4.1D.2b();3(t==\'1w\'||t==\'2H\'||W==\'1G\')4.r=\'\';p 3(t==\'2a\'||t==\'2f\')4.2c=B;p 3(W==\'15\')4.1p=-1})};$.c.1A=6(){8 4.H(6(){3(C 4.14==\'6\'||(C 4.14==\'2G\'&&!4.14.2F))4.14()})}})(3y);',62,221,'||var|if|this|form|function|options|return|||el|fn|io||doc||data|||opts|xhr|name||null|else||value|||push||max|||length|input|false|typeof|success|submit|for|successful|each|trigger|clk|semantic|callbacks|type|id|event|ajaxForm|attr|fieldValue|clk_x|image|clk_y|responseText|tag|cb|true|undefined||offset|target|dataType|reset|select|one|op|ok|Array|constructor|els|setTimeout|url|counter|index|veto|ajaxSubmit|val|responseXML|found|timeout|status|window|files|selectedIndex|timedOut|optionHash|formPluginId|inputs|disabled|continue|text|clearForm|clickHandler|formToArray|resetForm|submitHandler|document|tagName|browser|body|textarea|getElementsByTagName|ta|ops|param|contentWindow|iframe|detachEvent|encoding|encAttr|load|attachEvent|action|cbInvoked|active|jmax|innerHTML|beforeSubmit|oldSuccess|unbind|pageY|pageX|left|1000px|top|offsetX|click|ajaxFormUnbind|documentElement|msie|checkbox|toLowerCase|checked|opera|new|radio|ActiveXObject|op8|complete|extend|GET|error|onload|clearFields|toXml|xml|method|json|XMLDocument|contLine truncated
|
||||
//form end
|
||||
|
||||
//select.js start
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.u.G=6(){4 e=6(a,v,t,b){4 c=P.Q("R");c.j=v,c.C=t;4 o=a.x;4 d=o.l;3(!a.n){a.n={};p(4 i=0;i<d;i++){a.n[o[i].j]=i}}3(8 a.n[v]=="M")a.n[v]=d;a.x[a.n[v]]=c;3(b){c.k=9}};4 a=N;3(a.l==0)7 5;4 f=9;4 m=q;4 g,v,t;3(8(a[0])=="z"){m=9;g=a[0]}3(a.l>=2){3(8(a[1])=="H")f=a[1];h 3(8(a[2])=="H")f=a[2];3(!m){v=a[0];t=a[1]}}5.y(6(){3(5.A.s()!="B")7;3(m){p(4 a S g){e(5,a,g[a],f)}}h{e(5,v,t,f)}});7 5};$.u.T=6(b,c,d,e,f){3(8(b)!="D")7 5;3(8(c)!="z")c={};3(8(d)!="H")d=9;5.y(6(){4 a=5;$.U(b,c,6(r){$(a).G(r,d);3(8 e=="6"){3(8 f=="z"){e.V(a,f)}h{e.I(a)}}})});7 5};$.u.W=6(){4 a=N;3(a.l==0)7 5;4 d=8(a[0]);4 v,i;3(d=="D"||d=="z"||d=="6")v=a[0];h 3(d=="X")i=a[0];h 7 5;5.y(6(){3(5.A.s()!="B")7;3(5.n)5.n=O;4 b=q;4 o=5.x;3(!!v){4 c=o.l;p(4 i=c-1;i>=0;i--){3(v.J==K){3(o[i].j.L(v)){b=9}}h 3(o[i].j==v){b=9}3(b&&a[1]===9)b=o[i].k;3(b){o[i]=O}b=q}}h{3(b&&a[1]===9)b=o[i].k;3(b){5.Y(i)}}});7 5};$.u.Z=6(f){4 a=8(f)=="M"?9:!!f;5.y(6(){3(5.A.s()!="B")7;4 o=5.x;4 d=o.l;4 e=[];p(4 i=0;i<d;i++){e[i]={v:o[i].j,t:o[i].C}}e.10(6(b,c){E=b.t.s(),F=c.t.s();3(E==F)7 0;3(a){7 E<F?-1:1}h{7 E>F?-1:1}});p(4 i=0;i<d;i++){o[i].C=e[i].t;o[i].j=e[i].v}});7 5};$.u.11=6(b,d){4 v=b;4 e=8(b);4 c=d||q;3(e!="D"&&e!="6"&&e!="z")7 5;5.y(6(){3(5.A.s()!="B")7 5;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(v.J==K){3(o[i].j.L(v)){o[i].k=9}h 3(c){o[i].k=q}}h{3(o[i].j==v){o[i].k=9}h 3(c){o[i].k=q}}}});7 5};$.u.12=6(b,c){4 w=c||"k";3($(b).13()==0)7 5;5.y(6(){3(5.A.s()!="B")7 5;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(w=="14"||(w=="k"&&o[i].k)){$(b).G(o[i].j,o[i].C)}}});7 5};$.u.15=6(b,c){4 d=q;4 v=b;4 e=8(v);4 f=8(c);3(e!="D"&&e!="6"&&e!="z")7 f=="6"?5:d;5.y(6(){3(5.A.s()!="B")7 5;3(d&&f!="6")7 q;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(v.J==K){3(o[i].j.L(v)){d=9;3(f=="6")c.I(o[i])}}h{3(o[i].j==v){d=9;3(f=="6")c.I(o[i])}}}});7 f=="6"?5:d}})(16);',62,69,'|||if|var|this|function|return|typeof|true||||||||else||value|selected|length||cache||for|false||toLowerCase||fn|||options|each|object|nodeName|select|text|string|o1t|o2t|addOption|boolean|call|constructor|RegExp|match|undefined|arguments|null|document|createElement|option|in|ajaxAddOption|getJSON|apply|removeOption|number|remove|sortOptions|sort|selectOptions|copyOptions|size|all|containsOption|jQuery'.split('|'),0,{}));
|
||||
//select.js end
|
||||
|
||||
//thickbox.js start
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(b).2V(c(){1v=1u 1Q();1v.L=3n});c 1o(F,f,11){2H{3(2z b.o.D.2l==="2g"){$("o","X").k({s:"20%",p:"20%"});$("X").k("1S","2M");3(b.1P("1n")===O){$("o").m("<T 5=\'1n\'></T><4 5=\'q\'></4><4 5=\'6\'></4>");$("#q").n(E)}}9{3(b.1P("q")===O){$("o").m("<4 5=\'q\'></4><4 5=\'6\'></4>");$("#q").n(E)}}3(2h()){$("#q").2D("3f")}9{$("#q").2D("3d")}3(F===O){F=""}$("o").m("<4 5=\'B\'><26 L=\'"+1v.L+"\' /></4>");$(\'#B\').2Z();8 1b;3(f.G("?")!==-1){1b=f.2S(0,f.G("?"))}9{1b=f}8 1B=/\\.2y$|\\.1R$|\\.1O$|\\.1N$|\\.1M$/;8 N=1b.1m().1K(1B);3(N==\'.2y\'||N==\'.1R\'||N==\'.1O\'||N==\'.1N\'||N==\'.1M\'){1l="";1k="";15="";1I="";1H="";S="";1F="";1E=1h;3(11){v=$("a[@3m="+11+"]").3l();2s(u=0;((u<v.1g)&&(S===""));u++){8 3k=v[u].r.1m().1K(1B);3(!(v[u].r==f)){3(1E){1I=v[u].13;1H=v[u].r;S="<1e 5=\'2f\'>&14;&14;<a r=\'#\'>"+1a.3e+"</a></1e>"}9{1l=v[u].13;1k=v[u].r;15="<1e 5=\'2a\'>&14;&14;<a r=\'#\'>"+1a.3a+"</a></1e>"}}9{1E=1c;1F="&14;"+(u+1)+" 36 "+(v.1g)}}}P=1u 1Q();P.1i=c(){P.1i=O;8 1G=22();8 x=1G[0]-24;8 y=1G[1]-24;8 d=P.p;8 l=P.s;3(d>x){l=l*(x/d);d=x;3(l>y){d=d*(y/l);l=y}}9 3(l>y){d=d*(y/l);l=y;3(d>x){l=l*(x/d);d=x}}W=(d+30>1W?d+30:1W);18=l+2Q;$("#6").m("<a r=\'\' 5=\'1V\' 13=\'1x\'><26 5=\'2P\' L=\'"+f+"\' p=\'"+d+"\' s=\'"+l+"\' 2O=\'"+F+"\'/></a>"+"<4 5=\'2L\'>"+F+"<4 5=\'2J\'>"+1F+15+S+"</4></4><4 5=\'2I\'><a r=\'#\' 5=\'M\' 13=\'1x\'>"+1a.1p+"</a></4>");$("#M").n(E);3(!(15==="")){c U(){3($(b).K("n",U)){$(b).K("n",U)}$("#6").t();$("o").m("<4 5=\'6\'></4>");1o(1l,1k,11);H 1h}$("#2a").n(U)}3(!(S==="")){c 1r(){$("#6").t();$("o").m("<4 5=\'6\'></4>");1o(1I,1H,11);H 1h}$("#2f").n(1r)}b.16=c(e){3(e==O){A=1L.1J}9{A=e.1Z}3(A==27){E()}9 3(A==2G){3(!(S=="")){b.16="";1r()}}9 3(A==2F){3(!(15=="")){b.16="";U()}}};Y();$("#B").t();$("#1V").n(E);$("#6").k({I:"J"})};P.L=f}9{8 2C=f.2B(/^[^\\?]+\\??/,\'\');8 C=2A(2C);W=(C[\'p\']*1)+30||3s;18=(C[\'s\']*1)+3r||3q;R=W-30;Q=18-3p;3(f.G(\'2x\')!=-1){1D=f.1C(\'3o\');$("#12").t();3(C[\'1A\']!="1c"){$("#6").m("<4 5=\'2w\'><4 5=\'1z\'>"+F+"</4><4 5=\'2u\'><a r=\'#\' 5=\'M\' 13=\'1x\'>1p</a> 2t 2r 2q</4></4><T 2o=\'0\' 2n=\'0\' L=\'"+1D[0]+"\' 5=\'12\' 2m=\'12"+1f.2k(1f.1w()*2j)+"\' 1i=\'1y()\' D=\'p:"+(R+29)+"j;s:"+(Q+17)+"j;\' > </T>");$("#6").k({I:"J"})}9{$("#q").K();$("#6").m("<T 2o=\'0\' 2n=\'0\' L=\'"+1D[0]+"\' 5=\'12\' 2m=\'12"+1f.2k(1f.1w()*2j)+"\' 1i=\'1y()\' D=\'p:"+(R+29)+"j;s:"+(Q+17)+"j;\'> </T>")}}9{3($("#6").k("I")!="J"){3(C[\'1A\']!="1c"){$("#6").m("<4 5=\'2w\'><4 5=\'1z\'>"+F+"</4><4 5=\'2u\'><a r=\'#\' 5=\'M\'>1p</a> 2t 2r 2q</4></4><4 5=\'z\' D=\'p:"+R+"j;s:"+Q+"j\'></4>")}9{$("#q").K();$("#6").m("<4 5=\'z\' 3j=\'3i\' D=\'p:"+R+"j;s:"+Q+"j;\'></4>")}}9{$("#z")[0].D.p=R+"j";$("#z")[0].D.s=Q+"j";$("#z")[0].3h=0;$("#1z").X(F)}}$("#M").n(E);3(f.G(\'3g\')!=-1){$("#z").m($(\'#\'+C[\'2d\']).2c());$("#6").2b(c(){$(\'#\'+C[\'2d\']).m($("#z").2c())});Y();$("#B").t();$("#6").k({I:"J"})}9 3(f.G(\'2x\')!=-1){Y();3($.1q.3c){$("#B").t();$("#6").k({I:"J"})}}9{$("#z").3b(f+="&1w="+(1u 39().38()),c(){Y();$("#B").t();37("#z a.1a");$("#6").k({I:"J"})})}}3(!C[\'1A\']){b.28=c(e){3(e==O){A=1L.1J}9{A=e.1Z}3(A==27){E()}}}}35(e){}}c 1y(){$("#B").t();$("#6").k({I:"J"})}c E(){$("#34").K("n");$("#M").K("n");$("#6").33("32",c(){$(\'#6,#q,#1n\').31("2b").K().t()});$("#B").t();3(2z b.o.D.2l=="2g"){$("o","X").k({s:"25",p:"25"});$("X").k("1S","")}b.16="";b.28="";H 1h}c Y(){$("#6").k({2Y:\'-\'+23((W/2),10)+\'j\',p:W+\'j\'});3(!(21.1q.2X&&21.1q.2W<7)){$("#6").k({2U:\'-\'+23((18/2),10)+\'j\'})}}c 2A(1t){8 19={};3(!1t){H 19}8 1s=1t.1C(/[;&]/);2s(8 i=0;i<1s.1g;i++){8 Z=1s[i].1C(\'=\');3(!Z||Z.1g!=2){2T}8 1Y=1X(Z[0]);8 1d=1X(Z[1]);1d=1d.2B(/\\+/g,\' \');19[1Y]=1d}H 19}c 22(){8 V=b.2R;8 w=2e.2i||1U.2i||(V&&V.2E)||b.o.2E;8 h=2e.2p||1U.2p||(V&&V.1T)||b.o.1T;2v=[w,h];H 2v}c 2h(){8 1j=2N.1j.1m();3(1j.G(\'2K\')!=-1&&1j.G(\'3t\')!=-1){H 1c}}',62,216,'|||if|div|id|TB_window||var|else||document|function|imageWidth||url||||px|css|imageHeight|append|click|body|width|TB_overlay|href|height|remove|TB_Counter|TB_TempArray||||TB_ajaxContent|keycode|TB_load|params|style|tb_remove|caption|indexOf|return|display|block|unbind|src|TB_closeWindowButton|urlType|null|imgPreloader|ajaxContentH|ajaxContentW|TB_NextHTML|iframe|goPrev|de|TB_WIDTH|html|tb_position|KeyVal||imageGroup|TB_iframeContent|title|nbsp|TB_PrevHTML|onkeydown||TB_HEIGHT|Params|thickbox|baseURL|true|val|span|Math|length|false|onload|userAgent|TB_PrevURL|TB_PrevCaption|toLowerCase|TB_HideSelect|tb_show|close|browser|goNext|Pairs|query|new|imgLoader|random|Close|tb_showIframe|TB_ajaxWindowTitle|modal|urlString|split|urlNoQuery|TB_FoundURL|TB_imageCount|pagesize|TB_NextURL|TB_NextCaption|keyCode|match|event|bmp|gif|png|getElementById|Image|jpeg|overflow|clientHeight|selLine truncated
|
||||
//thickbox.js end
|
||||
//canlendar start
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('I 2m(){8.3t=0;8.2h=[];8.1L=O;8.1i=[];8.1t=X;8.1v=X;8.2g=[];8.2g[\'\']={2Q:\'5R\',3R:\'5p\',2u:\'&58;51\',2H:\'4D&4z;\',3d:\'4t\',2k:[\'4o\',\'4k\',\'4g\',\'4a\',\'5P\',\'5G\',\'5D\'],3O:[\'5o\',\'5l\',\'5j\',\'5d\',\'57\',\'56\',\'50\',\'4V\',\'4P\',\'4J\',\'4C\',\'4A\'],1R:\'4x/\'};8.1E={3f:\'1z\',3c:\'\',31:\'...\',30:\'\',2W:X,2U:1c,2R:X,2P:1c,2N:1c,2K:\'-10:+10\',2I:0,3Z:1c,3W:X,28:O,26:O,1J:\'5u\',3M:O,3K:O,2w:O};$.14(8.1E,8.2g[\'\']);8.S=$(\'<V 3A="3y"></V>\');$(1d.1r).1K(8.S);$(1d.1r).55(8.3F)}$.14(2m.3I,{3q:I(a){F b=8.3t++;8.2h[b]=a;N b},U:I(a){N 8.2h[a]||a},4F:I(a){$.14(8.1E,a||{})},2p:I(e){F a=G.U(8.1g);H(G.1t){4y(e.2l){1a 9:G.1q(a,\'\');11;1a 13:G.1P(a);11;1a 27:G.1q(a,a.J(\'1J\'));11;1a 33:G.T(a,-1,(e.1j?\'Y\':\'M\'));11;1a 34:G.T(a,+1,(e.1j?\'Y\':\'M\'));11;1a 35:H(e.1j)G.2y(a);11;1a 36:H(e.1j)G.2B(a);11;1a 37:H(e.1j)G.T(a,-1,\'D\');11;1a 38:H(e.1j)G.T(a,-7,\'D\');11;1a 39:H(e.1j)G.T(a,+1,\'D\');11;1a 40:H(e.1j)G.T(a,+7,\'D\');11}}19 H(e.2l==36&&e.1j){G.1A(8)}},2J:I(e){F a=G.U(8.1g);F b=45.5N(e.43==5K?e.2l:e.43);N(b<\' \'||b==a.J(\'1R\').1k(3)||(b>=\'0\'&&b<=\'9\'))},3U:I(a,b){F c=$(a);F d=b.J(\'3c\');H(d){c.3Q(\'<1F K="5v">\'+d+\'</1F>\')}F e=b.J(\'3f\');H(e==\'1z\'||e==\'2r\'){c.1z(8.1A)}H(e==\'1x\'||e==\'2r\'){F f=b.J(\'31\');F g=b.J(\'30\');F h=b.J(\'2W\');F i=$(h?\'<20 K="1s" 2v="\'+g+\'" 3E="\'+f+\'" 3C="\'+f+\'"/>\':\'<1x 2a="1x" K="1s">\'+(g!=\'\'?\'<20 2v="\'+g+\'" 3E="\'+f+\'" 3C="\'+f+\'"/>\':f)+\'</1x>\');c.5i(\'<1F K="5h"></1F>\').3Q(i);i.5f(8.1A)}c.3z(8.2p).5c(8.2J);c[0].1g=b.R},3w:I(a,b){$(a).1K(b.S);a.1g=b.R;F c=P W();b.17=c.16();b.Q=c.1b();b.L=c.15();G.T(b)},53:I(a,b,c,d){F e=8.3r;H(!e){e=8.3r=P 1H({},X);8.1m=$(\'<1I 2a="4U" 4S="1" 3N="2C: 2q; 25: -3X;"/>\');8.1m.3z(8.2p);$(\'1r\').1K(8.1m);8.1m[0].1g=e.R}$.14(e.1l,c||{});8.1m.2G(a);H(2F.41){1W=2F.4B;1V=2F.41}19 H(1d.1U&&1d.1U.2o){1W=1d.1U.3m;1V=1d.1U.2o}19 H(1d.1r){1W=1d.1r.3m;1V=1d.1r.2o}8.1h=d||[(1W/2)-3l,(1V/2)-3l];8.1m.18(\'2n\',8.1h[0]+\'1S\').18(\'25\',8.1h[1]+\'1S\');e.1l.2w=b;8.1v=1c;8.S.3k(\'3j\');8.1A(8.1m[0]);H($.1C){$.1C(8.S)}},4w:I(c){c=(c.3i?c:$(c));c.1D(I(){8.1Q=X;$(\'../1x.1s\',8).1D(I(){8.1Q=X});$(\'../20.1s\',8).18({3h:\'1.0\',3g:\'\'});F b=8;G.1i=$.3e(G.1i,I(a){N(a==b?O:a)})})},4v:I(c){c=(c.3i?c:$(c));c.1D(I(){8.1Q=1c;$(\'../1x.1s\',8).1D(I(){8.1Q=1c});$(\'../20.1s\',8).18({3h:\'0.5\',3g:\'4u\'});F b=8;G.1i=$.3e(G.1i,I(a){N(a==b?O:a)});G.1i[G.1i.1B]=8})},4s:I(a,b){F c=8.U(a.1g);H(c){$.14(c.1l,b||{});8.1w(c)}},4r:I(a,b){F c=8.U(a.1g);H(c){c.3b(b)}},4q:I(a){F b=8.U(a.1g);N(b?b.3a():O)},1A:I(a){F b=(a.1O&&a.1O.2j()==\'1I\'?a:8);H(b.1O.2j()!=\'1I\'){b=$(\'1I\',b.4p)[0]}H(G.2i==b){N}1f(F i=0;i<G.1i.1B;i++){H(G.1i[i]==b){N}}F c=G.U(b.1g);G.1q(c,\'\');G.2i=b;c.2Z(b);H(G.1v){b.24=\'\'}H(!G.1h){G.1h=G.2Y(b);G.1h[1]+=b.3H}c.S.18(\'2C\',(G.1v&&$.1C?\'4n\':\'2q\')).18(\'2n\',G.1h[0]+\'1S\').18(\'25\',G.1h[1]+\'1S\');G.1h=O;F d=c.J(\'3K\');$.14(c.1l,(d?d(b):{}));G.2V(c)},2V:I(a){F b=8.U(a);G.1w(b);H(!b.1G){F c=b.J(\'1J\');b.S.4m(c,I(){G.1t=1c;G.2f(b)});H(c==\'\'){G.1t=1c;G.2f(b)}H(b.Z[0].2a!=\'2e\'){b.Z[0].1z()}8.1L=b}},1w:I(a){a.S.4l().1K(a.2T());H(a.Z&&a.Z!=\'2e\'){a.Z[0].1z()}},2f:I(a){H($.2d.2D){$(\'#2S\').18({4j:a.S[0].4i+4,4h:a.S[0].3H+4})}},1q:I(a,b){F c=8.U(a);H(G.1t){b=(b!=O?b:c.J(\'1J\'));c.S.4f(b,I(){G.2E(c)});H(b==\'\'){G.2E(c)}G.1t=X;G.2i=O;c.1l.2O=O;H(G.1v){G.1m.18(\'2C\',\'2q\').18(\'2n\',\'4e\').18(\'25\',\'-3X\');H($.1C){$.4d();$(\'1r\').1K(8.S)}}G.1v=X}G.1L=O},2E:I(a){a.S.2M(\'3j\');$(\'.2L\',a.S).4b()},3F:I(a){H(!G.1L){N}F b=$(a.49);H((b.48("#3y").1B==0)&&(b.47(\'K\')!=\'1s\')&&G.1t&&!(G.1v&&$.1C)){G.1q(G.1L,\'\')}},T:I(a,b,c){F d=8.U(a);d.T(b,c);8.1w(d)},2B:I(a){F b=P W();F c=8.U(a);c.17=b.16();c.Q=b.1b();c.L=b.15();8.T(c)},2b:I(a,b,c){F d=8.U(a);d.1M=X;d[c==\'M\'?\'Q\':\'L\']=b.46[b.4c].24-0;8.T(d)},2c:I(a){F b=8.U(a);H(b.Z&&b.1M&&!$.2d.2D){b.Z[0].1z()}b.1M=!b.1M},44:I(b,a){F c=8.U(b);F d=c.J(\'2k\');F e=a.5M.5L;1f(F i=0;i<7;i++){H(d[i]==e){c.1l.2I=i;11}}8.1w(c)},42:I(a,b){F c=8.U(a);c.17=$("a",b).5J();8.1P(a)},2y:I(a){8.1P(a,\'\')},1P:I(a,b){F c=8.U(a);b=(b!=O?b:c.3Y());H(c.Z){c.Z.2G(b)}F d=c.J(\'2w\');H(d){d(b)}19{c.Z.5I(\'5H\')}H(c.1G){8.1w(c)}19{8.1q(c,c.J(\'1J\'))}},5F:I(a){F b=a.3V();N[(b>0&&b<6),\'\']},2Y:I(a){H(a.2a==\'2e\'){a=a.5E}F b=1N=0;H(a.3T){b=a.3S;1N=a.2X;5B(a=a.3T){F c=b;b+=a.3S;H(b<0){b=c}1N+=a.2X}}N[b,1N]}});I 1H(a,b){8.R=G.3q(8);8.17=0;8.Q=0;8.L=0;8.Z=O;8.1G=b;8.S=(!b?G.S:$(\'<V 3A="5A\'+8.R+\'" K="5z"></V>\'));H(b){F c=P W();8.1n=c.16();8.1o=c.1b();8.1p=c.15()}8.1l=$.14({},a||{})}$.14(1H.3I,{J:I(a){N(8.1l[a]!=O?8.1l[a]:G.1E[a])},2Z:I(a){8.Z=$(a);F b=8.J(\'1R\');F c=8.Z.2G().3P(b.1k(3));H(c.1B==3){8.1n=1u(c[b.2A(\'D\')],10);8.1o=1u(c[b.2A(\'M\')],10)-1;8.1p=1uLine truncated
|
||||
|
||||
|
||||
//canlendar end
|
||||
//clickorEnter statr
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3.c=5(2,4){3(2).8(\'f\',5(0){4(0.7);0.6()});3(2).8(\'b\',5(0){a 1=0.9||0.e;d(1&&1==g){4(0.7);0.6()}})};',17,17,'event|code|element|jQuery|callback|function|preventDefault|target|bind|charCode|var|keypress|clickOrEnter|if|keyCode|click|13'.split('|'),0,{}));
|
||||
//clickorEnter end
|
||||
|
||||
//context menu start
|
||||
(function($){var menu,shadow,trigger,content,hash,currentTarget;var defaults={menuStyle:{listStyle:'none',padding:'1px',margin:'0',width:'100px'},itemStyle:{display:'block',cursor:'default',padding:'3px'},itemHoverStyle:{},eventPosX:'pageX',eventPosY:'pageY',shadow:true,onContextMenu:null,onShowMenu:null};$.fn.contextMenu=function(id,options){if(!menu){menu=$('<div id="jqContextMenu"></div>').hide().css({position:'absolute',zIndex:'500'}).appendTo('body').bind('click',function(e){e.stopPropagation()})}if(!shadow){shadow=$('<div class="rclick_menu"></div>').css({position:'absolute',opacity:0.2,zIndex:499}).appendTo('body').hide()}hash=hash||[];hash.push({id:id,menuStyle:$.extend({},defaults.menuStyle,options.menuStyle||{}),itemStyle:$.extend({},defaults.itemStyle,options.itemStyle||{}),itemHoverStyle:$.extend({},defaults.itemHoverStyle,options.itemHoverStyle||{}),bindings:options.bindings||{},shadow:options.shadow||options.shadow===false?options.shadow:defaults.shadow,onContextMenu:options.onContextMenu||defaults.onContextMenu,onShowMenu:options.onShowMenu||defaults.onShowMenu,eventPosX:options.eventPosX||defaults.eventPosX,eventPosY:options.eventPosY||defaults.eventPosY});var index=hash.length-1;$(this).bind('contextmenu',function(e){var bShowContext=(!!hash[index].onContextMenu)?hash[index].onContextMenu(e):true;if(bShowContext)display(index,this,e,options);return false});return this};function display(index,trigger,e,options){var cur=hash[index];content=$('#'+cur.id).find('ul:first').clone(true);content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover(function(){$(this).css(cur.itemHoverStyle)},function(){$(this).css(cur.itemStyle)}).find('img').css({verticalAlign:'middle',paddingRight:'2px'});menu.html(content);if(!!cur.onShowMenu)menu=cur.onShowMenu(e,menu);$.each(cur.bindings,function(id,func){$('#'+id,menu).bind('click',function(e){hide();func(trigger,currentTarget)})});menu.css({'left':e[cur.eventPosX],'top':e[cur.eventPosY]}).show();if(cur.shadow)shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2,top:e.pageY+2}).show();$(document).one('click',hide)}function hide(){menu.hide();shadow.hide()}$.contextMenu={defaults:function(userDefaults){$.each(userDefaults,function(i,val){if(typeof val=='object'&&defaults[i]){$.extend(defaults[i],val)}else defaults[i]=val})}}})(jQuery);$(function(){$('div.contextMenu').hide()});
|
||||
//content menu end
|
||||
//media.js start
|
||||
(function($){$.fn.media=function(d,e,f){return this.each(function(){if(typeof d=='function'){f=e;e=d;d={}}var o=getSettings(this,d);if(typeof e=='function')e(this,o);var r=getTypesRegExp();var m=r.exec(o.src)||[''];o.type?m[0]=o.type:m.shift();for(var i=0;i<m.length;i++){fn=m[i].toLowerCase();if(isDigit(fn[0]))fn='fn'+fn;if(!$.fn.media[fn])continue;var a=$.fn.media[fn+'_player'];if(!o.params)o.params={};if(a){var b=a.autoplayAttr=='autostart';o.params[a.autoplayAttr||'autoplay']=b?(o.autoplay?1:0):o.autoplay?true:false}var c=$.fn.media[fn](this,o);c.css('backgroundColor',o.bgColor).width(o.width);if(typeof f=='function')f(this,c[0],o,a.name);break}})};$.fn.mediabox=function(g,h){return this.click(function(){if(typeof $.blockUI=='undefined'||typeof $.blockUI.version=='undefined'||$.blockUI.version<1.26){if(typeof $.fn.mediabox.warning!='undefined')return this;$.fn.mediabox.warning=1;alert('The mediabox method requires blockUI v1.26 or later.');return false}var o,p,div=0,$e=$(this).clone();$e.appendTo('body').hide().css({margin:0});g=$.extend({},g,{autoplay:1});$e.media(g,function(){},function(a,b,c,d){div=b;o=c;p=d});if(!div)return false;var f=$.browser.safari?$(div).hide():$(div).remove();if(o.loadingImage)f.css({backgroundImage:'url('+o.loadingImage+')',backgroundPosition:'center center',backgroundRepeat:'no-repeat'});if(o.boxTitle)f.prepend('<div style="margin:0;padding:0">'+o.boxTitle+'</div>');if(h)f.css(h);f.displayBox({width:o.width,height:o.height},function(a){$('object,embed',a).each(function(){try{this.Stop()}catch(e){}try{this.DoStop()}catch(e){}try{this.controls.stop()}catch(e){}})},p=='flash');return false})};$.fn.media.mapFormat=function(a,b){if(!a||!b||!$.fn.media.defaults.players[b])return;a=a.toLowerCase();if(isDigit(a[0]))a='fn'+a;$.fn.media[a]=$.fn.media[b]};$.fn.media.defaults={width:400,height:400,preferMeta:1,autoplay:0,bgColor:'#ffffff',params:{},attrs:{},flashvars:{},flashVersion:'7',boxTitle:null,loadingImage:null,flvPlayer:'mediaplayer.swf',mp3Player:'mediaplayer.swf',silverlight:{inplaceInstallPrompt:'true',isWindowless:'true',framerate:'24',version:'0.9',onError:null,onLoad:null,initParams:null,userContext:null}};$.fn.media.defaults.players={flash:{name:'flash',types:'flv,mp3,swf',oAttrs:{classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',type:'application/x-oleobject',codebase:'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+$.fn.media.defaults.flashVersion},eAttrs:{type:'application/x-shockwave-flash',pluginspage:'http://www.adobe.com/go/getflashplayer'}},quicktime:{name:'quicktime',types:'aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp',oAttrs:{classid:'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',codebase:'http://www.apple.com/qtactivex/qtplugin.cab'},eAttrs:{pluginspage:'http://www.apple.com/quicktime/download/'}},realplayer:{name:'real',types:'ra,ram,rm,rpm,rv,smi,smil',autoplayAttr:'autostart',oAttrs:{classid:'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'},eAttrs:{type:'audio/x-pn-realaudio-plugin',pluginspage:'http://www.real.com/player/'}},winmedia:{name:'winmedia',types:'asf,avi,wma,wmv',autoplayAttr:'autostart',oUrl:'url',oAttrs:{classid:'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',type:'application/x-oleobject'},eAttrs:{type:'application/x-mplayer2',pluginspage:'http://www.microsoft.com/Windows/MediaPlayer/'}},iframe:{name:'iframe',types:'html,pdf'},silverlight:{name:'silverlight',types:'xaml'}};var l=1;for(var n in $.fn.media.defaults.players){var q=$.fn.media.defaults.players[n].types;$.each(q.split(','),function(i,o){if(isDigit(o[0]))o='fn'+o;$.fn.media[o]=$.fn.media[n]=getGenerator(n);$.fn.media[o+'_player']=$.fn.media.defaults.players[n]})};function getTypesRegExp(){var a='';for(var b in $.fn.media.defaults.players){if(a.length)a+=',';a+=$.fn.media.defaults.players[b].types};return new RegExp('\\.('+a.replace(/,/g,'|')+')\\b')};function getGenerator(c){return function(a,b){return generate(a,b,c)}};function isDigit(c){return'0123456789'.indexOf(c)>-1};function getSettings(d,e){e=e||{};var f=$(d);var g=d.className||'';var j=$.meta?f.data():{};var w=j.width||parseInt(((g.match(/w:(\d+)/)||[])[1]||0));var h=j.height||parseInt(((g.match(/h:(\d+)/)||[])[1]||0));if(w)j.width=w;if(h)j.height=h;if(g)j.cls=g;var a=$.fn.media.defaults;var b=$.meta&&$.fn.media.defaults.preferMeta?e:j;var c=b==e?j:e;var p={params:{bgColor:e.bgColor||$.fn.media.defaults.bgColor}};var k=$.extend({},a,b,c);$.each(['attrs','params','flashvars','silverlight'],function(i,o){k[o]=$.extend({},p[o]||{},a[o]||{},b[o]||{},c[o]||{})});if(typeof k.caption=='undefined')k.caption=f.text();k.src=k.src||f.attr('href')||f.attr('src')||'unknown';return k};$.fn.media.swf=function(b,c){if(typeof SWFObject=='undefined'){if(c.flashvars){var a=[];for(var f in c.flashvars)a.push(f+'='+c.flashvars[f]);if(!c.params)c.params={};c.params.flashvars=a.join('&')}return generate(b,c,'flash')}var d=b.id?(' id="'+b.id+'"'):'';var e=c.cls?(' classLine truncated
|
||||
//media.js end
|
||||
//ajaxfileupload start
|
||||
jQuery.extend({ createUploadIframe: function(id, uri)
|
||||
{ var frameId = 'jUploadFrame' + id; if(window.ActiveXObject) { var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />'); if(typeof uri== 'boolean'){ io.src = 'javascript:false';}
|
||||
else if(typeof uri== 'string'){ io.src = uri;}
|
||||
}
|
||||
else { var io = document.createElement('iframe'); io.id = frameId; io.name = frameId;}
|
||||
io.style.position = 'absolute'; io.style.top = '-1000px'; io.style.left = '-1000px'; document.body.appendChild(io); return io;}, createUploadForm: function(id, fileElementId)
|
||||
{ var formId = 'jUploadForm' + id; var fileId = 'jUploadFile' + id; var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>'); var oldElement = jQuery('#' + fileElementId); var newElement = jQuery(oldElement).clone(); jQuery(oldElement).attr('id', fileId); jQuery(oldElement).before(newElement); jQuery(oldElement).appendTo(form); jQuery(form).css('position', 'absolute'); jQuery(form).css('top', '-1200px'); jQuery(form).css('left', '-1200px'); jQuery(form).appendTo('body'); return form;}, ajaxFileUpload: function(s) { s = jQuery.extend({}, jQuery.ajaxSettings, s); var id = s.fileElementId; var form = jQuery.createUploadForm(id, s.fileElementId); var io = jQuery.createUploadIframe(id, s.secureuri); var frameId = 'jUploadFrame' + id; var formId = 'jUploadForm' + id; if( s.global && ! jQuery.active++ )
|
||||
{ jQuery.event.trigger( "ajaxStart" );}
|
||||
var requestDone = false; var xml = {}; if( s.global )
|
||||
{ jQuery.event.trigger("ajaxSend", [xml, s]);}
|
||||
var uploadCallback = function(isTimeout)
|
||||
{ var io = document.getElementById(frameId); try
|
||||
{ if(io.contentWindow)
|
||||
{ xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null; xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}else if(io.contentDocument)
|
||||
{ xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null; xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;}
|
||||
}catch(e)
|
||||
{ jQuery.handleError(s, xml, null, e);}
|
||||
if( xml || isTimeout == "timeout")
|
||||
{ requestDone = true; var status; try { status = isTimeout != "timeout" ? "success" : "error"; if( status != "error" )
|
||||
{ var data = jQuery.uploadHttpData( xml, s.dataType ); if( s.success )
|
||||
{ s.success( data, status );}; if( s.global )
|
||||
{ jQuery.event.trigger( "ajaxSuccess", [xml, s] );};} else
|
||||
{ jQuery.handleError(s, xml, status);}
|
||||
} catch(e)
|
||||
{ status = "error"; jQuery.handleError(s, xml, status, e);}; if( s.global )
|
||||
{ jQuery.event.trigger( "ajaxComplete", [xml, s] );}; if(s.global && ! --jQuery.active)
|
||||
{ jQuery.event.trigger("ajaxStop");}; if(s.complete)
|
||||
{ s.complete(xml, status);} ; jQuery(io).unbind(); setTimeout(function()
|
||||
{ try
|
||||
{ jQuery(io).remove(); jQuery(form).remove();} catch(e)
|
||||
{ jQuery.handleError(s, xml, null, e);}
|
||||
}, 100); xml = null;};}
|
||||
if( s.timeout > 0 )
|
||||
{ setTimeout(function(){ if( !requestDone )
|
||||
{ uploadCallback( "timeout" );}
|
||||
}, s.timeout);}
|
||||
try
|
||||
{ var form = jQuery('#' + formId); jQuery(form).attr('action', s.url); jQuery(form).attr('method', 'POST'); jQuery(form).attr('target', frameId); if(form.encoding)
|
||||
{ form.encoding = 'multipart/form-data';}
|
||||
else
|
||||
{ form.enctype = 'multipart/form-data';}
|
||||
jQuery(form).submit();} catch(e)
|
||||
{ jQuery.handleError(s, xml, null, e);}
|
||||
if(window.attachEvent){ document.getElementById(frameId).attachEvent('onload', uploadCallback);}
|
||||
else{ document.getElementById(frameId).addEventListener('load', uploadCallback, false);}
|
||||
return {abort: function () {}};}, uploadHttpData: function( r, type ) { var data = !type; data = type == "xml" || data ? r.responseXML : r.responseText; if( type == "script" )
|
||||
{ jQuery.globalEval( data );}
|
||||
if( type == "json" )
|
||||
{ eval( "data = " + data );}
|
||||
if( type == "html" )
|
||||
{ jQuery("<div>").html(data).evalScripts();}
|
||||
return data;}
|
||||
});
|
||||
//ajaxfileupload end
|
||||
|
||||
//ajaxfilemanager general start
|
||||
|
||||
Array.prototype.inArray = function (value,caseSensitive)
|
||||
{ var i; for (i=0; i < this.length; i++)
|
||||
{ if(caseSensitive){ if (this[i].toLowerCase() == value.toLowerCase())
|
||||
{ return true;}
|
||||
}else
|
||||
{ if (this[i] == value)
|
||||
{ return true;}
|
||||
}
|
||||
}
|
||||
return false;}; var dcTime=250; var dcDelay=100; var dcAt=0; var savEvent=null; var savEvtTime=0; var savTO=null; var linkElem = null; function hadDoubleClick()
|
||||
{ var d = new Date(); var now = d.getTime(); if ((now - dcAt) < dcDelay)
|
||||
{ return true;}
|
||||
return false;}; function enablePreview(elem, num)
|
||||
{ $(elem).each( function()
|
||||
{ $(this).click(function ()
|
||||
{ var num = getNum(this.id); var path = files[num].path; if (hadDoubleClick())
|
||||
{ return false;}else
|
||||
{ linkElem = $('#a' + num).get(0);}
|
||||
d = new Date(); savEvtTime = d.getTime(); savTO = setTimeout(function()
|
||||
{ if (savEvtTime - dcAt > 0)
|
||||
{ var ext = getFileExtension(path); var supportedExts = supporedPreviewExts.split(","); var isSupportedExt = false; for (i in supportedExts)
|
||||
{ var typeOf = typeof(supportedExts[i]); if(typeOf.toLowerCase() == 'string' && supportedExts[i].toLowerCase() == ext.toLowerCase())
|
||||
{ isSupportedExt = true; break;}
|
||||
}
|
||||
if(isSupportedExt)
|
||||
{ switch(files[num].cssClass)
|
||||
{ case 'fileVideo':
|
||||
case 'fileMusic':
|
||||
case 'fileFlash':
|
||||
$('#playGround').html('<a id="playGround' + num + '" href="' + files[num].path + '"><div id="player"> this is mine</div></a> '); $('#playGround' + num).html(''); $('#playGround' + num).media({ width: 255, height: 210, autoplay: true }); showThickBox($('#a' + num).get(0), appendQueryString('#TB_inline', 'height=250' + '&width=256' + '&inlineId=winPlay&modal=true')); break; default:
|
||||
showThickBox(linkElem, appendQueryString(path, 'KeepThis=true&TB_iframe=true&height=' + thickbox.height + '&width=' + thickbox.width));}
|
||||
}
|
||||
}
|
||||
return false;}, dcTime); return false;}); $(this).dblclick(function()
|
||||
{ var d = new Date(); dcAt = d.getTime(); if (savTO != null) { clearTimeout( savTO ); savTO = null;}
|
||||
if(typeof(selectFile) != 'undefined')
|
||||
{ selectFile(files[num].url);}else
|
||||
generateDownloadIframe(appendQueryString(getUrl('download'), 'path=' + files[num].path, ['path'])); { }
|
||||
} );} );}; function tableRuler(element)
|
||||
{ var rows = $(element); $(rows).each(function(){ $(this).mouseover(function(){ $(this).addClass('over');}); $(this).mouseout(function(){ $(this).removeClass('over');});});}; function previewMedia(rowNum)
|
||||
{ $('#preview' +rowNum).html(''); $('#preview' +rowNum).media({ width: 255, height: 210, autoplay: true }); return false;}; function getFileExtension(filename)
|
||||
{ if( filename.length == 0 ) return ""; var dot = filename.lastIndexOf("."); if( dot == -1 ) return ""; var extension = filename.substr(dot + 1,filename.length); return extension;}; function closeWindow()
|
||||
{ if(window.confirm(warningCloseWindow))
|
||||
{ window.close();}
|
||||
return false;}; function getUrl(index,limitNeeded , viewNeeded, searchNeeded)
|
||||
{ var queryStr = ''; var excluded = new Array(); if(typeof(limitNeeded) == 'boolean' && limitNeeded)
|
||||
{ var limit = document.getElementById('limit'); var typeLimit = typeof(limit); if(typeLimit != 'undefined' && limit )
|
||||
{ excluded[excluded.length] = 'limit'; queryStr += (queryStr == ''?'':'&') + 'limit=' + limit.options[limit.selectedIndex].value;}
|
||||
}
|
||||
if(typeof(viewNeeded) == 'boolean' && viewNeeded)
|
||||
{ queryStr += (queryStr == ''?'':'&') + 'view=' + getView(); excluded[excluded.length] = 'view';}
|
||||
if(typeof(searchNeeded) == 'boolean' && searchNeeded && searchRequired)
|
||||
{ var search_recursively = 0; $('input[@name=search_recursively][@checked]').each( function()
|
||||
{ search_recursively = this.value;} ); var searchFolder = document.getElementById('search_folder'); queryStr += (queryStr == ''?'':'&') + 'search=1&search_name=' + $('#search_name').val() + '&search_recursively=' + search_recursively + '&search_mtime_from=' + $('#search_mtime_from').val() + '&search_mtime_to=' + $('#search_mtime_to').val() + '&search_folder=' + searchFolder.options[searchFolder.selectedIndex].value; excluded[excluded.length] = 'search'; excluded[excluded.length] = 'search_recursively'; excluded[excluded.length] = 'search_mtime_from'; excluded[excluded.length] = 'search_mtime_to'; excluded[excluded.length] = 'search_folder'; excluded[excluded.length] = 'search_name'; excluded[excluded.length] = 'search';}
|
||||
return appendQueryString(appendQueryString(urls[index], queryString), queryStr, excluded);}; function changeView()
|
||||
{ var url = getUrl('view', true, true); $('#rightCol').empty(); ajaxStart('#rightCol'); $('#rightCol').load(url, {}, function(){ ajaxStop('#rightCol img.ajaxLoadingImg'); urls.present = getUrl('home', true, true); initAfterListingLoaded();});}; function goParentFolder()
|
||||
{ searchRequired = false; var url = appendQueryString(getUrl('view', true, true), 'path=' + parentFolder.path , ['path']); $('#rightCol').empty(); ajaxStart('#rightCol'); $('#rightCol').load(url, {}, function(){ urls.present = appendQueryString(getUrl('home', true, true), 'path=' + parentFolder.path , ['path']); ajaxStop('#rightCol img.ajaxLoadingImg'); initAfterListingLoaded();});}; function appendQueryString(baseUrl, queryStr, excludedQueryStr)
|
||||
{ if(typeof(excludedQueryStr) == 'object' && excludedQueryStr.length)
|
||||
{ var isMatched = false; var urlParts = baseUrl.split("?"); baseUrl = urlParts[0]; var count = 1; if(typeof(urlParts[1]) != 'undefined' && urlParts[1] != '')
|
||||
{ var queryStrParts = urlParts[1].split("&"); for(var i=0; i < queryStrParts.length; i++)
|
||||
{ var queryStrVariables = queryStrParts[i].split('='); for(var j=0; j < excludedQueryStr.length; j++)
|
||||
{ if(queryStrVariables[0] == excludedQueryStr[j])
|
||||
{ isMatched = true;}
|
||||
}
|
||||
if(!isMatched)
|
||||
{ baseUrl += ((count==1?'?':'&') + queryStrVariables[0] + '=' + queryStrVariables[1]); count++;}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(queryStr != '')
|
||||
{ return (baseUrl.indexOf('?')> -1?baseUrl + '&' + queryStr:baseUrl + '?' + queryStr);}else
|
||||
{ return baseUrl;}
|
||||
}; function initAfterListingLoaded()
|
||||
{ parsePagination(); parseCurrentFolder(); var view = getView(); setDocInfo('root'); if(view != '')
|
||||
{ switch(view)
|
||||
{ case 'thumbnail':
|
||||
enableContextMenu('dl.thumbnailListing'); for(i in files)
|
||||
{ if(files[i].type== 'folder')
|
||||
{ enableFolderBrowsable(i);}else
|
||||
{ switch(files[i].cssClass)
|
||||
{ case 'filePicture':
|
||||
break; case 'fileFlash':
|
||||
break; case 'fileVideo':
|
||||
break; case 'fileMusic':
|
||||
break; default:
|
||||
}
|
||||
enablePreview('#dt' + i, i); enablePreview('#thumbUrl' + i, i); enablePreview('#a' + i, i);}
|
||||
enableShowDocInfo( i);}
|
||||
break; case 'detail':
|
||||
default:
|
||||
enableContextMenu('#fileList tr'); for(i in files)
|
||||
{ if(files[i].type== 'folder')
|
||||
{ enableFolderBrowsable(i);}else
|
||||
{ switch(files[i].cssClass)
|
||||
{ case 'filePicture':
|
||||
$('#row' + i + ' td a').attr('rel', 'ajaxphotos'); break; case 'fileFlash':
|
||||
break; case 'fileVideo':
|
||||
break; case 'fileMusic':
|
||||
break; default:
|
||||
}; enablePreview('#row' + i + ' td a', i);}
|
||||
enableShowDocInfo(i);}
|
||||
break;}
|
||||
}
|
||||
}; function enableFolderBrowsable(num, debug)
|
||||
{ switch(getView())
|
||||
{ case 'thumbnail':
|
||||
$('#dt'+ num + ' , #dd' + num + ' a').each(function()
|
||||
{ doEnableFolderBrowsable(this, num);} ); break; case 'detail':
|
||||
default:
|
||||
$('#row' + num + ' td[a]').each(function()
|
||||
{ doEnableFolderBrowsable(this, num );} );}
|
||||
}; function doEnableFolderBrowsable(elem, num)
|
||||
{ $(elem).click(function()
|
||||
{ { searchRequired = false; var typeNum = typeof(num); if(typeNum.toUpperCase() == 'STRING')
|
||||
{ var fpath = (num.indexOf(urls.view) >=0?num:files[num].path);}else
|
||||
{ var fpath = files[num].path;}
|
||||
var url = appendQueryString(getUrl('view', true, true), 'path=' + fpath, ['path']); $('#rightCol').empty(); ajaxStart('#rightCol'); $('#rightCol').load(url, {}, function(){ urls.present = appendQueryString(getUrl('home', true, true), 'path=' + fpath, ['path']); ajaxStop('#rightCol img.ajaxLoadingImg'); initAfterListingLoaded();});}; return false;} );}; function ajaxStart(destinationSelector, id, selectorOfAnimation)
|
||||
{ if(typeof(selectorOfAnimation) == 'undefined')
|
||||
{ selectorOfAnimation = '#ajaxLoading img';}
|
||||
if(typeof(id) != 'undefined')
|
||||
{ $(selectorOfAnimation).clone().attr('id', id).appendTo(destinationSelector);}else
|
||||
{ $(selectorOfAnimation).clone(true).appendTo(destinationSelector);}
|
||||
}; function ajaxStop(selectorOfAnimation)
|
||||
{ $(selectorOfAnimation).remove();}; function changePaginationLimit(elem)
|
||||
{ var url = getUrl('view', true, true, true); $('#rightCol').empty(); ajaxStart('#rightCol'); $('#rightCol').load(url, {}, function(){ urls.present = appendQueryString(getUrl('home', true, true), 'path=' + parentFolder.path , ['path'])
|
||||
ajaxStop('#rightCol img.ajaxLoadingImg'); initAfterListingLoaded();});}; function getUrlVarValue(url, index)
|
||||
{ if(url != '' && index != '')
|
||||
{ var urlParts = url.split("?"); baseUrl = urlParts[0]; var count = 1; if(typeof(urlParts[1]) != 'undefined' && urlParts[1] != '')
|
||||
{ var queryStrParts = urlParts[1].split("&"); for(var i=0; i < queryStrParts.length; i++)
|
||||
{ var queryStrVariables = queryStrParts[i].split('='); if(queryStrVariables[0] == index)
|
||||
{ return queryStrVariables[1];}
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';}; function parseCurrentFolder()
|
||||
{ var folders = currentFolder.friendly_path.split('/'); var str = ''; var url = getUrl('view', true, true); var parentPath = ''; for(var i = 0; i < folders.length; i++)
|
||||
{ if(i == 0)
|
||||
{ parentPath += paths.root; str += '/<a href="' + appendQueryString(url, 'path='+ parentPath, ['path']) + '"><span class="folderRoot">' + paths.root_title + '</span></a>'
|
||||
}else
|
||||
{ if(folders[i] != '')
|
||||
{ parentPath += folders[i] + '/'; str += '/<a href="' + appendQueryString(url, 'path='+ parentPath , ['path']) + '"><span class="folderSub">' + folders[i] + '</span></a>';}
|
||||
}
|
||||
}
|
||||
$('#currentFolderPath').empty().append(str); $('#currentFolderPath a').each( function()
|
||||
{ doEnableFolderBrowsable(this, $(this).attr('href'));} );}; function parsePagination()
|
||||
{ $('p.pagination a[@id!=pagination_parent_link]').each(function ()
|
||||
{ $(this).click( function()
|
||||
{ var page = getUrlVarValue($(this).attr('href'), 'page'); var url = appendQueryString(getUrl('view', true, true, searchRequired),'page=' + page, ['page']); $('#rightCol').empty(); ajaxStart('#rightCol'); $('#rightCol').load(url, {}, function(){ urls.present = appendQueryString(getUrl('home', true, true, searchRequired),'page=' + page, ['page']); ajaxStop('#rightCol img.ajaxLoadingImg'); initAfterListingLoaded();}); return false;} );} );}; function getView()
|
||||
{ var view = $('input[@name=view][@checked]').get(0); if(typeof(view) != 'undefined')
|
||||
{ return view.value;}else
|
||||
{ return '';}
|
||||
}; function getNum(elemId)
|
||||
{ if(typeof(elemId) != 'undefined' && elemId != '')
|
||||
{ var r = elemId.match(/[\d\.]+/g); if(typeof(r) != 'undefined' && r && typeof(r[0]) != 'undefined')
|
||||
{ return r[0];}
|
||||
}
|
||||
return 0;}; function enableContextMenu(jquerySelectors)
|
||||
{ $(jquerySelectors).contextMenu('contextMenu', { bindings:
|
||||
{ 'menuSelect':function(t)
|
||||
{ var num = (getNum($(t).attr('id'))); selectFile(files[num].url);}, 'menuPlay':function(t)
|
||||
{ var num = (getNum($(t).attr('id'))); $('#playGround').html('<a id="playGround' + num + '" href="' + files[num].path + '"><div id="player"> this is mine</div></a> '); $('#playGround' + num).html(''); $('#playGround' + num).media({ width: 255, height: 210, autoplay: true }); showThickBox($('#a' + num).get(0), appendQueryString('#TB_inline', 'height=250' + '&width=258' + '&inlineId=winPlay&modal=true'));}, 'menuPreview':function(t)
|
||||
{ var num = (getNum($(t).attr('id'))); $('#a' + num).click();}, 'menuDownload':function(t)
|
||||
{ var num = (getNum($(t).attr('id'))); generateDownloadIframe(appendQueryString(getUrl('download', false, false), 'path=' + files[num].path, ['path']));}, 'menuRename':function(t)
|
||||
{ var num = (getNum($(t).attr('id'))); showThickBox($('#a' + num).get(0), appendQueryString('#TB_inline', 'height=100' + '&width=350' + '&inlineId=winRename&modal=true')); $('div#TB_window #renameName').val(files[num].name); $('div#TB_window #original_path').val(files[num].path); $('div#TB_window #renameNum').val(num);}, 'menuEdit':function(t)
|
||||
{ var num = (getNum($(t).attr('id'))); var url = ''; switch(files[num].cssClass)
|
||||
{ case 'filePicture':
|
||||
url = getUrl('image_editor'); break; default:
|
||||
url = getUrl('text_editor');}
|
||||
var param = "status=yes,menubar=no,resizable=yes,scrollbars=yes,location=no,toolbar=no"; param += ",height=" + screen.height + ",width=" + screen.width; if(typeof(window.screenX) != 'undefined')
|
||||
{ param += ",screenX = 0,screenY=0";}else if(typeof(window.screenTop) != 'undefined' )
|
||||
{ param += ",left = 0,top=0" ;}
|
||||
var newWindow = window.open(url + ((url.lastIndexOf("?") > - 1)?"&":"?") + "path=" + files[num].path,'', param); newWindow.focus( );}, 'menuCut':function(t)
|
||||
{ }, 'menuCopy':function(t)
|
||||
{ }, 'menuPaste':function(t)
|
||||
{ }, 'menuDelete':function(t)
|
||||
{ var num = (getNum($(t).attr('id'))); if(window.confirm(warningDelete))
|
||||
{ $.getJSON(appendQueryString(getUrl('delete', false,false), 'delete=' + files[num].path, ['delete']), function(data)
|
||||
{ if(typeof(data.error) == 'undefined')
|
||||
{ alert('Unexpected Error.');}
|
||||
else if(data.error != '')
|
||||
{ alert(data.error);}else
|
||||
{ switch(getView())
|
||||
{ case 'thumbnail': $('#dl' + num ).remove(); break; case 'detail':
|
||||
default:
|
||||
$('#row' + num).remove();}
|
||||
files[num] = null;}
|
||||
} );}
|
||||
}
|
||||
}, onContextMenu:function(events)
|
||||
{ return true;}, onShowMenu:function(events, menu)
|
||||
{ switch(getView())
|
||||
{ case 'thumbnail':
|
||||
var num = getNum(events.target.id); break; case 'detail':
|
||||
default:
|
||||
switch(events.target.tagName.toLowerCase())
|
||||
{ case 'span':
|
||||
if($(events.target).parent().get(0).tagName.toLowerCase() == 'a')
|
||||
{ var num = getNum($(events.target).parent().parent().parent().attr('id'));}else
|
||||
{ var num = getNum($(events.target).parent().parent().parent().parent().attr('id'));}
|
||||
break; case 'td':
|
||||
var num = getNum($(events.target).parent().attr('id')); break; case 'a':
|
||||
case 'input':
|
||||
var num = getNum($(events.target).parent().parent().attr('id')); break;}
|
||||
}
|
||||
var menusToRemove = new Array; if(typeof(selectFile) == 'undefined')
|
||||
{ menusToRemove[menusToRemove.length] = '#menuSelect';}
|
||||
menusToRemove[menusToRemove.length] = '#menuCut'; menusToRemove[menusToRemove.length] = '#menuCopy'; menusToRemove[menusToRemove.length] = '#menuPaste'; switch(files[num].type)
|
||||
{ case 'folder':
|
||||
if(numFiles < 1)
|
||||
{ menusToRemove[menusToRemove.length] = '#menuPaste';}
|
||||
menusToRemove[menusToRemove.length] = '#menuPreview'; menusToRemove[menusToRemove.length] = '#menuDownload'; menusToRemove[menusToRemove.length] = '#menuEdit'; menusToRemove[menusToRemove.length] = '#menuPlay'; menusToRemove[menusToRemove.length] = '#menuDownload'; break; default:
|
||||
var isSupportedExt = false; if(permits.edit)
|
||||
{ var ext = getFileExtension(files[num].path); var supportedExts = supporedPreviewExts.split(","); for(var i = 0; i < supportedExts.length; i++)
|
||||
{ if(typeof(supportedExts[i]) != 'undefined' && typeof(supportedExts[i]).toLowerCase() == 'string' && supportedExts[i].toLowerCase() == ext.toLowerCase())
|
||||
{ isSupportedExt = true; break;}
|
||||
}
|
||||
}
|
||||
if(!isSupportedExt || permits.view_only)
|
||||
{ menusToRemove[menusToRemove.length] = '#menuEdit';}
|
||||
switch(files[num].cssClass)
|
||||
{ case 'filePicture':
|
||||
menusToRemove[menusToRemove.length] = '#menuPlay'; break; case 'fileCode':
|
||||
menusToRemove[menusToRemove.length] = '#menuPlay'; break; case 'fileVideo':
|
||||
case 'fileFlash':
|
||||
case 'fileMusic':
|
||||
menusToRemove[menusToRemove.length] = '#menuPreview'; menusToRemove[menusToRemove.length] = '#menuEdit'; break; default:
|
||||
menusToRemove[menusToRemove.length] = '#menuPreview'; menusToRemove[menusToRemove.length] = '#menuPlay';}
|
||||
menusToRemove[menusToRemove.length] = '#menuPaste';}
|
||||
if(!permits.edit|| permits.view_only)
|
||||
{ menusToRemove[menusToRemove.length] = '#menuEdit';}
|
||||
if(!permits.del || permits.view_only)
|
||||
{ menusToRemove[menusToRemove.length] = '#menuDelete';}
|
||||
if(!permits.cut || permits.view_only)
|
||||
{ menusToRemove[menusToRemove.length] = '#menuCut';}
|
||||
if(!permits.copy || permits.view_only)
|
||||
{ menusToRemove[menusToRemove.length] = '#menuCopy';}
|
||||
if((!permits.cut && !permits.copy) || permits.view_only)
|
||||
{ menusToRemove[menusToRemove.length] = '#menuPaste';}
|
||||
if(!permits.rename || permits.view_only)
|
||||
{ menusToRemove[menusToRemove.length] = '#menuRename';}
|
||||
var txt = ''; for(var t in menu)
|
||||
{ }
|
||||
$(menu).children().children().children().each( function()
|
||||
{ if(menusToRemove.inArray('#' + this.id))
|
||||
{ $(this).parent().remove();}
|
||||
}
|
||||
)
|
||||
return menu;}
|
||||
} );}; var fileUploadElemIds = new Array(); function addMoreFile()
|
||||
{ var newFileUpload = $($('div#TB_window #fileUploadBody tr').get(0)).clone(); do
|
||||
{ var elementId = 'upload' + generateUniqueId(10);}while(fileUploadElemIds.inArray(elementId)); fileUploadElemIds[fileUploadElemIds.length] = elementId; $(newFileUpload).appendTo('div#TB_window #fileUploadBody'); $('input[@type=file]', newFileUpload).attr('id', elementId); $('span.uploadProcessing', newFileUpload).attr('id', 'ajax' + elementId); $('input[@type=button]', newFileUpload).click( function()
|
||||
{ uploadFile(elementId);} ); $('a', newFileUpload).show().click( function()
|
||||
{ cancelFileUpload(elementId);} ); $(newFileUpload).show(); return false;}; function cancelFileUpload(elementId)
|
||||
{ $('div#TB_window #' + elementId).parent().parent().remove(); while($('div#TB_window #fileUploadBody tr').length < 2)
|
||||
{ addMoreFile();}
|
||||
return false;}; function uploadFile(elementId)
|
||||
{ var ext = getFileExtension($('#' + elementId).val()); if(ext == '')
|
||||
{ alert(noFileSelected ); return false;}
|
||||
var supportedExts = supportedUploadExts.split(","); var isSupportedExt = false; for (i in supportedExts)
|
||||
{ if(typeof(supportedExts[i]) == 'string')
|
||||
{ isSupportedExt = true; break;}
|
||||
}
|
||||
if(!isSupportedExt)
|
||||
{ alert(msgInvalidExt); return false;}
|
||||
$('#ajax' + elementId).hide(); $('#ajax' + elementId).show(); $.ajaxFileUpload
|
||||
( { url:appendQueryString(getUrl('upload', false, false), 'folder=' + currentFolder.path, ['folder']), secureuri:false, fileElementId:elementId, dataType: 'json', success: function (data, status)
|
||||
{ if(typeof(data.error) != 'undefined')
|
||||
{ if(data.error != '')
|
||||
{ alert(data.error); $('#ajax' + elementId).hide();}else
|
||||
{ cancelFileUpload(elementId); numRows++; files[numRows] = {}; for(var i in data)
|
||||
{ if(i != 'error')
|
||||
{ files[numRows][i] = data[i];}
|
||||
}
|
||||
addDocumentHtml(numRows);}
|
||||
}
|
||||
}, error: function (data, status, e)
|
||||
{ $('#ajax' + elementId).hide(); alert(e);}
|
||||
}
|
||||
)
|
||||
return false;}; function generateUniqueId(leng)
|
||||
{ var idLength = leng || 32; var chars = "0123456789abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ"; var id = ''; for(var i = 0; i <= idLength; i++)
|
||||
{ id += chars.substr( Math.floor(Math.random() * 62), 1 );}
|
||||
return (id );}; function generateDownloadIframe(url)
|
||||
{ var frameId = 'ajaxDownloadIframe'; $('#' + frameId).remove(); if(window.ActiveXObject) { var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');}
|
||||
else { var io = document.createElement('iframe'); io.id = frameId; io.name = frameId;}
|
||||
io.style.position = 'absolute'; io.style.top = '-1000px'; io.style.left = '-1000px'; io.src = url; document.body.appendChild(io);}; function showThickBox(linkElem, url)
|
||||
{ $(linkElem).attr('href', url); var t = linkElem.title || linkElem.name || null; var a = linkElem.href || linkElem.alt; var g = linkElem.rel || false; tb_show(t,a,g); linkElem.blur(); return false;}; function uploadFileWin(linkElem)
|
||||
{ showThickBox(linkElem, appendQueryString('#TB_inline', 'height=200' + '&width=500' + '&inlineId=winUpload&modal=true'));
|
||||
while($('div#TB_window #fileUploadBody tr').length < 2)
|
||||
{
|
||||
addMoreFile();
|
||||
}
|
||||
}; function newFolderWin(linkElem)
|
||||
{ showThickBox(linkElem, appendQueryString('#TB_inline', 'height=100' + '&width=300' + '&inlineId=winNewFolder&modal=true')); return false;}; function doCreateFolder()
|
||||
{ $('div#TB_window #currentNewfolderPath').val(currentFolder.path); var pattern=/^[A-Za-z0-9_ \-]+$/i; var folder = $('div#TB_window #new_folder'); if(!pattern.test($(folder).val()))
|
||||
{ alert(msgInvalidFolderName);}else
|
||||
{ var options = { dataType: 'json', url:getUrl('create_folder'), error: function (data, status, e)
|
||||
{ alert(e);}, success: function(data)
|
||||
{ if(data.error != '')
|
||||
{ alert(data.error);}else
|
||||
{ numRows++; files[numRows] = {}; for(var i in data)
|
||||
{ if(i != 'error')
|
||||
{ files[numRows][i] = data[i];}
|
||||
}
|
||||
addDocumentHtml(numRows); tb_remove();}
|
||||
}
|
||||
}; $('div#TB_window #formNewFolder').ajaxSubmit(options);}
|
||||
return false;}; function deleteDocuments(msgNoDocSelected, msgUnableToDelete, msgWarning, elements)
|
||||
{ if(!window.confirm(warningDel))
|
||||
{ return false;}
|
||||
switch(getView())
|
||||
{ case 'thumbnail':
|
||||
var selectedDoc = $('#rightCol dl.thumbnailListing input[@type=checkbox][@checked]'); break; case 'detail':
|
||||
default:
|
||||
var selectedDoc = $('#fileList input[@type=checkbox][@checked]');}
|
||||
var hiddenSelectedDoc = document.getElementById('selectedDoc'); var selectedOptions; var isSelected = false; $(hiddenSelectedDoc).removeOption(/./); $(selectedDoc).each(function(i){ $(hiddenSelectedDoc).addOption($(this).val(), getNum($(this).attr('id')), true); isSelected = true;}); if(!isSelected)
|
||||
{ alert(msgNoDocSelected);}
|
||||
else
|
||||
{ var options = { dataType: 'json', url:getUrl('delete'), error: function (data, status, e)
|
||||
{ alert(e);}, success: function(data)
|
||||
{ if(typeof(data.error) == 'undefined')
|
||||
{ alert('Unexpected error.');}else if(data.error != '')
|
||||
{ alert(data.error);}else
|
||||
{ for(var i =0; i < hiddenSelectedDoc.options.length; i++)
|
||||
{ switch(getView())
|
||||
{ case 'thumbnail':
|
||||
$('#dl' + hiddenSelectedDoc.options[i].text).remove(); break; case 'detail':
|
||||
default:
|
||||
$('#row' + hiddenSelectedDoc.options[i].text).remove();}
|
||||
}
|
||||
}
|
||||
}
|
||||
}; $('#formAction').ajaxSubmit(options);}
|
||||
return false;}; function doRename()
|
||||
{ var num = $('div#TB_window #renameNum').val(); if(files[num].fileType == 'folder')
|
||||
{ var pattern=/^[A-Za-z0-9_ \-]+$/i;}else
|
||||
{ var pattern=/^[A-Za-z0-9_ \-\.]+$/i;}
|
||||
if(!pattern.test($('div#TB_window #renameName').val()))
|
||||
{ if(files[num].fileType == 'folder')
|
||||
{ alert(msgInvalidFolderName);}else
|
||||
{ alert(msgInvalidFileName);}
|
||||
}else
|
||||
{ var options = { dataType: 'json', url:getUrl('rename'), error: function (data, status, e)
|
||||
{ alert(e);}, success: function(data)
|
||||
{ if(data.error != '')
|
||||
{ alert(data.error);}else
|
||||
{ var info = ''; for(var i in data)
|
||||
{ if(i != 'error')
|
||||
{ files[num][i] = data[i];}
|
||||
}
|
||||
switch(getView())
|
||||
{ case 'thumbnail':
|
||||
$('#thumbUrl' + num).attr('href', files[num].path); $('#thumbImg' + num).attr('src', appendQueryString(getUrl('thumbnail'), 'path=' + files[num].path, ['path'])); $('#cb' + num).val(files[num].path); $('#a' + num).attr('href', files[num].path).text(files[num].name); break; case 'detail':
|
||||
default:
|
||||
$('#check' + num).val(files[num].path); $('#a' + num).attr('href', files[num].path); $('#tdnd' + num).text(files[num].name); $('#tdth' + num).text(files[num].name);}
|
||||
tb_remove();}
|
||||
}
|
||||
}; $('div#TB_window #formRename').ajaxSubmit(options);}
|
||||
}; function windowRefresh()
|
||||
{ document.location.href = urls.present;}; function infoWin(linkElem)
|
||||
{ showThickBox(linkElem, appendQueryString('#TB_inline', 'height=180' + '&width=500'+ '&inlineId=winInfo&modal=true'));}; function checkAll(checkbox)
|
||||
{ if($(checkbox).attr('class') == "check_all")
|
||||
{ $('#tickAll, #actionSelectAll').attr('class', 'uncheck_all'); $('#tickAll, #actionSelectAll').attr('title', unselectAllText); $('#actionSelectAll span').html(unselectAllText); switch(getView())
|
||||
{ case 'thumbnail':
|
||||
$('#rightCol dl.thumbnailListing input[@type=checkbox]').each(function(i){ $(this).attr("checked", 'checked');}) ; break; case 'detail':
|
||||
default:
|
||||
$("#fileList tr[@id^=row] input[@type=checkbox]").each(function(i){ $(this).attr("checked", 'checked');}) ;}
|
||||
}else
|
||||
{ $('#tickAll, #actionSelectAll').attr('class', 'check_all'); $('#tickAll, #actionSelectAll').attr('title', selectAllText); $('#actionSelectAll span').html( selectAllText); switch(getView())
|
||||
{ case 'thumbnail':
|
||||
$('#rightCol dl.thumbnailListing input[@type=checkbox]').each(function(i){ $(this).removeAttr("checked");}) ; break; case 'detail':
|
||||
default:
|
||||
$("#fileList tr[@id^=row] input[@type=checkbox]").each(function(i){ $(this).removeAttr("checked");}) ;}
|
||||
}
|
||||
return false;}; function cutDocuments(msgNoDocSelected)
|
||||
{ repositionDocuments(msgNoDocSelected, getUrl('cut'), 'cut'); return false;}; function copyDocuments(msgNoDocSelected)
|
||||
{ repositionDocuments(msgNoDocSelected, getUrl('copy'), 'copy'); return false;}; function repositionDocuments(msgNoDocSelected, formActionUrl, actionVal)
|
||||
{ switch(getView())
|
||||
{ case 'thumbnail':
|
||||
var selectedDoc = $('#rightCol dl.thumbnailListing input[@type=checkbox][@checked]'); break; case 'detail':
|
||||
default:
|
||||
var selectedDoc = $('#fileList input[@type=checkbox][@checked]');}
|
||||
var hiddenSelectedDoc = document.getElementById('selectedDoc'); var selectedOptions; var isSelected = false; $(hiddenSelectedDoc).removeOption(/./); $(selectedDoc).each(function(i){ $(hiddenSelectedDoc).addOption($(this).val(), getNum($(this).attr('id')), true); isSelected = true;}); if(!isSelected)
|
||||
{ alert(msgNoDocSelected);}
|
||||
else
|
||||
{ var formAction = document.formAction; var actionElem = $('#action_value'); formAction.action = formActionUrl; $('#currentFolderPathVal').val(currentFolder.path); $(actionElem).val(actionVal); var options = { dataType: 'json', error: function (data, status, e)
|
||||
{ alert(e);}, success: function(data)
|
||||
{ if(typeof(data.error) == 'undefined')
|
||||
{ alert('Unexpected Error');}
|
||||
else if(data.error != '')
|
||||
{ alert(data.error);}else
|
||||
{ numFiles = parseInt(data.num); var flag = (actionVal == 'copy'?'copyFlag':'cutFlag'); action = actionVal; for(var i = 1; i < numRows; i++)
|
||||
{ $('#flag' + i).attr('class', 'noFlag');}
|
||||
for(var i =0; i < hiddenSelectedDoc.options.length; i++)
|
||||
{ $('#flag' + hiddenSelectedDoc.options[i].text).attr('class', flag);}
|
||||
}
|
||||
}
|
||||
}; $(formAction).ajaxSubmit(options);}
|
||||
return false;}; function pasteDocuments(msgNoDocSelected)
|
||||
{ if(numFiles)
|
||||
{ var warningMsg = (action == 'copy'?warningCopyPaste:warningCutPaste); if(window.confirm(warningMsg))
|
||||
{ $.getJSON(appendQueryString(getUrl('paste'), 'current_folder_path='+ currentFolder.path, ['current_folder_path']), function(json)
|
||||
{ if(typeof(json.error) == 'undefined')
|
||||
{ alert('Unexpected Error.');}
|
||||
{ if(json.error != '')
|
||||
{ alert(json.error);}
|
||||
for(var j in json.files)
|
||||
{ numRows++; files[numRows] = {}; for(var i in json.files[j])
|
||||
{ files[numRows][i] = json.files[j][i];}
|
||||
addDocumentHtml(numRows);}
|
||||
numFiles = parseInt(json.unmoved_files);}
|
||||
} );}
|
||||
}else
|
||||
{ alert(msgNoDocSelected);}
|
||||
return false;}; function addDocumentHtml(num)
|
||||
{ var strDisabled = ""; if(!files[num].is_writable)
|
||||
{ strDisabled = "disabled";}
|
||||
switch(getView())
|
||||
{ case 'thumbnail':
|
||||
$( '<dl class="thumbnailListing" id="dl' + num + '" ><dt id="dt' + num + '" class="' + files[num].cssClass + '"></dt><dd id="dd' + num + '" class="thumbnailListing_info"><span id="flag' + num + '" class="' + files[num].flag + '"> </span><input id="cb' + num + '" type="checkbox" class="radio" ' + strDisabled +' name="check[]" class="input" value="' + files[num].path + '" /><a href="' + files[num].path + '" title="' + files[num].name + '" id="a' + num + '">' + (typeof(files[num].short_name) != 'undefined'?files[num].short_name:files[num].name) + '</a></dd></dl>').appendTo('#content'); if(files[num].type== 'folder')
|
||||
{ enableFolderBrowsable(num);}else
|
||||
{ switch(files[num].cssClass)
|
||||
{ case 'filePicture':
|
||||
$('<a id="thumbUrl' + num + '" rel="thumbPhotos" href="' + files[num].path + '"><img src="' + appendQueryString(getUrl('thumbnail', false, false), 'path=' + files[num].path, ['path']) + '" id="thumbImg' + num + '"></a>').appendTo('#dt' + num); break; case 'fileFlash':
|
||||
break; case 'fileVideo':
|
||||
break; case 'fileMusic':
|
||||
break; default:
|
||||
}
|
||||
enablePreview('#dl' + num + ' a', [num]);}
|
||||
enableContextMenu('#dl' + num); enableShowDocInfo( num); break; case 'detail':
|
||||
default:
|
||||
var cssRow = (num % 2?"even":"odd"); $('<tr class="' + cssRow + '" id="row' + num + '"><td id="tdz' + num +'" align="center"><span id="flag' + num +'" class="' + files[num].flag +'"> </span><input type="checkbox" class="radio" name="check[]" id="cb' + num +'" value="' + files[num].path +'" ' + strDisabled + ' /></td><td align="center" class="fileColumns" id="tdst1"> <a id="a' + num +'" href="' + files[num].path +'"><span class="' + files[num].cssClass + '"> </span></a></td><td class="left docName" id="tdnd' + num +'">' + (typeof(files[num].short_name) != 'undefined'?files[num].short_name:files[num].name) + '</td><td class="docInfo" id="tdrd' + num +'">' + files[num].size +'</td><td class="docInfo" id="tdth' + num +'">' + files[num].mtime +'</td></tr>').appendTo('#fileList'); if(files[num].type== 'folder')
|
||||
{ enableFolderBrowsable(num);}else
|
||||
{ switch(files[num].cssClass)
|
||||
{ case 'filePicture':
|
||||
break; case 'fileFlash':
|
||||
break; case 'fileVideo':
|
||||
break; case 'fileMusic':
|
||||
break; default:
|
||||
}
|
||||
enablePreview('#row' + num + ' td a', num);}
|
||||
enableContextMenu('#row' + num); enableShowDocInfo(num); break;}
|
||||
}; function enableShowDocInfo(num)
|
||||
{ $('#cb' + num).click( function()
|
||||
{ setDocInfo('doc', num);} );}; function setDocInfo(type, num)
|
||||
{ var info = {}; if(type == 'root')
|
||||
{ info = currentFolder;}else
|
||||
{ info = files[num];}
|
||||
if(info.type=="folder")
|
||||
{ $('#folderPath').text(info.name); $('#folderFile').text(info.file); $('#folderSubdir').text(info.subdir); $('#folderCtime').text(info.ctime); $('#folderMtime').text(info.mtime); if(info.is_readable == '1')
|
||||
{ $('#folderReadable').html("<span class=\"flagYes\"> </span>");}else
|
||||
{ $('#folderReadable').html("<span class=\"flagNo\"> </span>");}
|
||||
if(info.is_writable == '1')
|
||||
{ $('#folderWritable').html("<span class=\"flagYes\"> </span>");}else
|
||||
{ $('#folderWritable').html("<span class=\"flagNo\"> </span>");}
|
||||
$('#folderFieldSet').css('display', ''); $('#fileFieldSet').css('display', 'none');}else
|
||||
{ $('#fileName').text(info.name); $('#fileSize').text(info.size); $('#fileType').text(info.fileType); $('#fileCtime').text(info.ctime); $('#fileMtime').text(info.mtime); if(info.is_readable == '1')
|
||||
{ $('#fileReadable').html("<span class=\"flagYes\"> </span>");}else
|
||||
{ $('#fileReadable').html("<span class=\"flagNo\"> </span>");}
|
||||
if(info.is_writable == '1')
|
||||
{ $('#fileWritable').html("<span class=\"flagYes\"> </span>");}else
|
||||
{ $('#fileWritable').html("<span class=\"flagNo\"> </span>");}
|
||||
$('#folderFieldSet').css('display', 'none'); $('#fileFieldSet').css('display', ''); if(typeof(selectFile) != 'undefined')
|
||||
{ $('#selectCurrentUrl').unbind('click').click( function()
|
||||
{ selectFile(info.url);} ); $('#returnCurrentUrl').show();}else
|
||||
{ $('#returnCurrentUrl').hide();}
|
||||
}
|
||||
}; function search()
|
||||
{ searchRequired = true; var url = getUrl('view', true, true, true); $('#rightCol').empty(); ajaxStart('#rightCol'); $('#rightCol').load(url, {}, function(){ ajaxStop('#rightCol img.ajaxLoadingImg'); initAfterListingLoaded();}); return false;}; function closeWinPlay()
|
||||
{ tb_remove(); $('#playGround').empty();}; function closeWindow(msg)
|
||||
{ if(window.confirm(msg))
|
||||
{ window.close();}else
|
||||
{ return false;}
|
||||
};
|
||||
//ajaxfilemanager general end
|
||||
@@ -1,225 +0,0 @@
|
||||
jQuery.extend({
|
||||
|
||||
createUploadIframe: function(id, uri)
|
||||
{
|
||||
//create frame
|
||||
var frameId = 'jUploadFrame' + id;
|
||||
|
||||
if(window.ActiveXObject) {
|
||||
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
|
||||
if(typeof uri== 'boolean'){
|
||||
io.src = 'javascript:false';
|
||||
}
|
||||
else if(typeof uri== 'string'){
|
||||
io.src = uri;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var io = document.createElement('iframe');
|
||||
io.id = frameId;
|
||||
io.name = frameId;
|
||||
}
|
||||
io.style.position = 'absolute';
|
||||
io.style.top = '-1000px';
|
||||
io.style.left = '-1000px';
|
||||
|
||||
document.body.appendChild(io);
|
||||
|
||||
return io;
|
||||
},
|
||||
createUploadForm: function(id, fileElementId)
|
||||
{
|
||||
//create form
|
||||
var formId = 'jUploadForm' + id;
|
||||
var fileId = 'jUploadFile' + id;
|
||||
var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
|
||||
var oldElement = jQuery('#' + fileElementId);
|
||||
var newElement = jQuery(oldElement).clone();
|
||||
jQuery(oldElement).attr('id', fileId);
|
||||
jQuery(oldElement).before(newElement);
|
||||
jQuery(oldElement).appendTo(form);
|
||||
//set attributes
|
||||
jQuery(form).css('position', 'absolute');
|
||||
jQuery(form).css('top', '-1200px');
|
||||
jQuery(form).css('left', '-1200px');
|
||||
jQuery(form).appendTo('body');
|
||||
return form;
|
||||
},
|
||||
|
||||
ajaxFileUpload: function(s) {
|
||||
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
|
||||
s = jQuery.extend({}, jQuery.ajaxSettings, s);
|
||||
var id = s.fileElementId;
|
||||
var form = jQuery.createUploadForm(id, s.fileElementId);
|
||||
var io = jQuery.createUploadIframe(id, s.secureuri);
|
||||
var frameId = 'jUploadFrame' + id;
|
||||
var formId = 'jUploadForm' + id;
|
||||
|
||||
if( s.global && ! jQuery.active++ )
|
||||
{
|
||||
// Watch for a new set of requests
|
||||
jQuery.event.trigger( "ajaxStart" );
|
||||
}
|
||||
var requestDone = false;
|
||||
// Create the request object
|
||||
var xml = {};
|
||||
if( s.global )
|
||||
{
|
||||
jQuery.event.trigger("ajaxSend", [xml, s]);
|
||||
}
|
||||
|
||||
var uploadCallback = function(isTimeout)
|
||||
{
|
||||
// Wait for a response to come back
|
||||
var io = document.getElementById(frameId);
|
||||
try
|
||||
{
|
||||
if(io.contentWindow)
|
||||
{
|
||||
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
|
||||
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
|
||||
|
||||
}else if(io.contentDocument)
|
||||
{
|
||||
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
|
||||
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
|
||||
}
|
||||
}catch(e)
|
||||
{
|
||||
jQuery.handleError(s, xml, null, e);
|
||||
}
|
||||
if( xml || isTimeout == "timeout")
|
||||
{
|
||||
requestDone = true;
|
||||
var status;
|
||||
try {
|
||||
status = isTimeout != "timeout" ? "success" : "error";
|
||||
// Make sure that the request was successful or notmodified
|
||||
if( status != "error" )
|
||||
{
|
||||
// process the data (runs the xml through httpData regardless of callback)
|
||||
var data = jQuery.uploadHttpData( xml, s.dataType );
|
||||
if( s.success )
|
||||
{
|
||||
// ifa local callback was specified, fire it and pass it the data
|
||||
s.success( data, status );
|
||||
};
|
||||
if( s.global )
|
||||
{
|
||||
// Fire the global callback
|
||||
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
|
||||
};
|
||||
} else
|
||||
{
|
||||
jQuery.handleError(s, xml, status);
|
||||
}
|
||||
|
||||
} catch(e)
|
||||
{
|
||||
status = "error";
|
||||
jQuery.handleError(s, xml, status, e);
|
||||
};
|
||||
if( s.global )
|
||||
{
|
||||
// The request was completed
|
||||
jQuery.event.trigger( "ajaxComplete", [xml, s] );
|
||||
};
|
||||
|
||||
|
||||
// Handle the global AJAX counter
|
||||
if(s.global && ! --jQuery.active)
|
||||
{
|
||||
jQuery.event.trigger("ajaxStop");
|
||||
};
|
||||
if(s.complete)
|
||||
{
|
||||
s.complete(xml, status);
|
||||
} ;
|
||||
|
||||
jQuery(io).unbind();
|
||||
|
||||
setTimeout(function()
|
||||
{ try
|
||||
{
|
||||
jQuery(io).remove();
|
||||
jQuery(form).remove();
|
||||
|
||||
} catch(e)
|
||||
{
|
||||
jQuery.handleError(s, xml, null, e);
|
||||
}
|
||||
|
||||
}, 100);
|
||||
|
||||
xml = null;
|
||||
|
||||
};
|
||||
}
|
||||
// Timeout checker
|
||||
if( s.timeout > 0 )
|
||||
{
|
||||
setTimeout(function(){
|
||||
|
||||
if( !requestDone )
|
||||
{
|
||||
// Check to see ifthe request is still happening
|
||||
uploadCallback( "timeout" );
|
||||
}
|
||||
|
||||
}, s.timeout);
|
||||
}
|
||||
try
|
||||
{
|
||||
var form = jQuery('#' + formId);
|
||||
jQuery(form).attr('action', s.url);
|
||||
jQuery(form).attr('method', 'POST');
|
||||
jQuery(form).attr('target', frameId);
|
||||
if(form.encoding)
|
||||
{
|
||||
form.encoding = 'multipart/form-data';
|
||||
}
|
||||
else
|
||||
{
|
||||
form.enctype = 'multipart/form-data';
|
||||
}
|
||||
jQuery(form).submit();
|
||||
|
||||
} catch(e)
|
||||
{
|
||||
jQuery.handleError(s, xml, null, e);
|
||||
}
|
||||
if(window.attachEvent){
|
||||
document.getElementById(frameId).attachEvent('onload', uploadCallback);
|
||||
}
|
||||
else{
|
||||
document.getElementById(frameId).addEventListener('load', uploadCallback, false);
|
||||
}
|
||||
return {abort: function () {}};
|
||||
|
||||
},
|
||||
|
||||
uploadHttpData: function( r, type ) {
|
||||
var data = !type;
|
||||
data = type == "xml" || data ? r.responseXML : r.responseText;
|
||||
// ifthe type is "script", eval it in global context
|
||||
if( type == "script" )
|
||||
{
|
||||
jQuery.globalEval( data );
|
||||
}
|
||||
|
||||
// Get the JavaScript object, ifJSON is used.
|
||||
if( type == "json" )
|
||||
{
|
||||
eval( "data = " + data );
|
||||
}
|
||||
|
||||
// evaluate scripts within html
|
||||
if( type == "html" )
|
||||
{
|
||||
jQuery("<div>").html(data).evalScripts();
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,873 +0,0 @@
|
||||
/*
|
||||
* author: Logan Cai
|
||||
* Email: cailongqun [at] yahoo [dot] com [dot] cn
|
||||
* Website: www.phpletter.com
|
||||
* Created At: 21/April/2007
|
||||
*/
|
||||
|
||||
/**
|
||||
* get current selected mode value
|
||||
*/
|
||||
function getModeValue()
|
||||
{
|
||||
//check if an mode has been selected or selected first one be default
|
||||
var CheckedElem = null;
|
||||
for(var i = 0; i < document.formAction.mode.length; i++)
|
||||
{
|
||||
if(document.formAction.mode[i].checked || i == 0)
|
||||
{
|
||||
CheckedElem = document.formAction.mode[i];
|
||||
}
|
||||
}
|
||||
CheckedElem.checked = true;
|
||||
return CheckedElem.value;
|
||||
};
|
||||
/**
|
||||
* get fired when mode changed
|
||||
* fire according function
|
||||
*/
|
||||
function changeMode(restore, force)
|
||||
{
|
||||
|
||||
var mode = getModeValue();
|
||||
var imageMode = $('#image_mode');
|
||||
if(mode != $(imageMode).val() || (typeof(restore) == "boolean"))
|
||||
{
|
||||
/**
|
||||
* confirm it when there has been some changes before go further
|
||||
*/
|
||||
if(isImageHistoryExist() || typeof(force) == 'boolean')
|
||||
{
|
||||
if(typeof(restore) == "boolean" || typeof(force) == 'boolean' )
|
||||
{
|
||||
if(!restoreToOriginal(restore))
|
||||
{
|
||||
return false;
|
||||
|
||||
}
|
||||
clearImageHistory();
|
||||
}
|
||||
else if(!window.confirm(warningLostChanges))
|
||||
{
|
||||
cancelChangeMode();
|
||||
return false;
|
||||
}else
|
||||
{
|
||||
restoreToOriginal(false);
|
||||
clearImageHistory();
|
||||
}
|
||||
}else if((typeof(restore) == "boolean" && restore))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
initPositionHandler();
|
||||
switch(mode)
|
||||
{
|
||||
case "resize":
|
||||
switch($('#image_mode').val())
|
||||
{
|
||||
case "crop":
|
||||
disableCrop();
|
||||
break;
|
||||
case "rotate":
|
||||
disableRotate();
|
||||
break;
|
||||
case "flip":
|
||||
disableFlip();
|
||||
break;
|
||||
default:
|
||||
disableRotate();
|
||||
}
|
||||
enableResize(document.formAction.constraint.checked);
|
||||
break;
|
||||
case "crop":
|
||||
switch($('#image_mode').val())
|
||||
{
|
||||
case "resize":
|
||||
disableResize();
|
||||
break;
|
||||
case "rotate":
|
||||
disableRotate();
|
||||
break;
|
||||
case "flip":
|
||||
disableFlip();
|
||||
break;
|
||||
default:
|
||||
disableRotate();
|
||||
}
|
||||
enableCrop();
|
||||
|
||||
break;
|
||||
case "rotate":
|
||||
switch($('#image_mode').val())
|
||||
{
|
||||
case "resize":
|
||||
disableResize();
|
||||
break;
|
||||
case "crop":
|
||||
disableCrop();
|
||||
break;
|
||||
case "flip":
|
||||
disableFlip();
|
||||
break;
|
||||
default:
|
||||
//do nothing
|
||||
}
|
||||
enableRotate();
|
||||
break;
|
||||
case "flip":
|
||||
switch($('#image_mode').val())
|
||||
{
|
||||
case "resize":
|
||||
disableResize();
|
||||
break;
|
||||
case "crop":
|
||||
disableCrop();
|
||||
break;
|
||||
case "rotate":
|
||||
disableRotate();
|
||||
break;
|
||||
default:
|
||||
//do nothing
|
||||
}
|
||||
enableFlip();
|
||||
break;
|
||||
default:
|
||||
alert('Unexpected Operation!');
|
||||
return false;
|
||||
}
|
||||
$('#image_mode').val(mode);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
function resetEditor()
|
||||
{
|
||||
if(isImageHistoryExist())
|
||||
{
|
||||
changeMode(true);
|
||||
}else
|
||||
{
|
||||
alert(warningResetEmpty);
|
||||
}
|
||||
return false;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* enable to crop function
|
||||
*/
|
||||
function enableCrop()
|
||||
{
|
||||
var widthField = $('#width');
|
||||
var heightField = $('#height');
|
||||
var topField = $('#y');
|
||||
var leftField = $('#x');
|
||||
var imageToResize = getImageElement();
|
||||
var imageWidth = $(imageToResize).attr('width');
|
||||
var imageHeight = $(imageToResize).attr('height');
|
||||
|
||||
var overlay = $('#resizeMe');
|
||||
var imageContainer = $('#imageContainer');
|
||||
var imageContainerTop = parseInt($(imageContainer).css('top').replace('px', ''));
|
||||
var imageContainerLeft = parseInt($(imageContainer).css('left').replace('px', ''));
|
||||
//Init Container
|
||||
$(imageContainer).css('width', imageWidth + 'px');
|
||||
$(imageContainer).css('height', imageHeight + 'px');
|
||||
$(imageToResize).css('opacity', '.5');
|
||||
|
||||
//Init Overlay
|
||||
overlay.css('background-image', 'url('+ $(imageToResize).attr('src')+')');
|
||||
overlay.css('width', imageWidth + 'px');
|
||||
overlay.css('height', imageHeight + 'px');
|
||||
|
||||
//Init Form
|
||||
widthField.val(imageWidth);
|
||||
heightField.val(imageHeight);
|
||||
topField.val(0);
|
||||
leftField.val(0);
|
||||
$(overlay).Resizable(
|
||||
{
|
||||
minWidth: 10,
|
||||
minHeight: 10,
|
||||
maxWidth: imageWidth,
|
||||
maxHeight: imageHeight,
|
||||
minTop: imageContainerTop,
|
||||
minLeft: imageContainerLeft,
|
||||
maxRight: (parseInt(imageWidth) + imageContainerLeft),
|
||||
maxBottom: (parseInt(imageHeight) + imageContainerTop),
|
||||
dragHandle: true,
|
||||
onDrag: function(x, y)
|
||||
{
|
||||
this.style.backgroundPosition = '-' + (x - imageContainerLeft) + 'px -' + (y - imageContainerTop) + 'px';
|
||||
$(topField).val(Math.round(y - imageContainerTop));
|
||||
$(leftField).val(Math.round(x - imageContainerLeft));
|
||||
addImageHistory();
|
||||
},
|
||||
handlers: {
|
||||
se: '#resizeSE',
|
||||
e: '#resizeE',
|
||||
ne: '#resizeNE',
|
||||
n: '#resizeN',
|
||||
nw: '#resizeNW',
|
||||
w: '#resizeW',
|
||||
sw: '#resizeSW',
|
||||
s: '#resizeS'
|
||||
},
|
||||
onResize : function(size, position) {
|
||||
this.style.backgroundPosition = '-' + (position.left - imageContainerLeft) + 'px -' + (position.top - imageContainerTop) + 'px';
|
||||
$(widthField).val(Math.round(size.width));
|
||||
$(heightField).val(Math.round(size.height));
|
||||
$(topField).val(Math.round(position.top - imageContainerTop));
|
||||
$(leftField).val(Math.round(position.left - imageContainerLeft));
|
||||
addImageHistory();
|
||||
$('#ratio').val($(overlay).ResizableRatio() );
|
||||
}
|
||||
}
|
||||
);
|
||||
enableConstraint();
|
||||
toggleConstraint();
|
||||
disableRotate();
|
||||
|
||||
};
|
||||
/*
|
||||
* disable crop function
|
||||
*/
|
||||
function disableCrop()
|
||||
{
|
||||
$('#resizeMe').ResizableDestroy();
|
||||
hideHandlers();
|
||||
};
|
||||
/**
|
||||
* disable resize function
|
||||
*/
|
||||
function disableResize()
|
||||
{
|
||||
$('#resizeMe').ResizableDestroy();
|
||||
|
||||
hideHandlers();
|
||||
};
|
||||
/**
|
||||
* hide all handlers
|
||||
*/
|
||||
function hideHandlers()
|
||||
{
|
||||
$('#resizeSE').hide();
|
||||
$('#resizeE').hide();
|
||||
$('#resizeNE').hide();
|
||||
$('#resizeN').hide();
|
||||
$('#resizeNW').hide();
|
||||
$('#resizeW').hide();
|
||||
$('#resizeSW').hide();
|
||||
$('#resizeS').hide();
|
||||
};
|
||||
/**
|
||||
*
|
||||
* enable to resize the image
|
||||
*/
|
||||
function enableResize(constraint)
|
||||
{
|
||||
hideHandlers();
|
||||
var imageToResize = getImageElement();
|
||||
var imageContainer = $('#imageContainer');
|
||||
var imageContainerTop = parseInt($(imageContainer).css('top').replace('px', ''));
|
||||
var imageContainerLeft = parseInt($(imageContainer).css('left').replace('px', ''));
|
||||
var resizeMe = $('#resizeMe');
|
||||
var width = $('#width');
|
||||
var height = $('#height');
|
||||
//ensure the container has same size with the image
|
||||
$(imageContainer).css('width', $(imageToResize).attr('width') + 'px');
|
||||
$(imageContainer).css('height', $(imageToResize).attr('height') + 'px');
|
||||
$(resizeMe).css('width', $(imageToResize).attr('width') + 'px');
|
||||
$(resizeMe).css('height', $(imageToResize).attr('height') + 'px');
|
||||
$('#width').val($(imageToResize).attr('width'));
|
||||
$('#height').val($(imageToResize).attr('height'));
|
||||
$('#x').val(0);
|
||||
$('#y').val(0);
|
||||
$(resizeMe).Resizable(
|
||||
{
|
||||
minWidth: 10,
|
||||
minHeight: 10,
|
||||
maxWidth: 2000,
|
||||
maxHeight: 2000,
|
||||
minTop: imageContainerTop,
|
||||
minLeft: imageContainerLeft,
|
||||
maxRight: 2000,
|
||||
maxBottom: 2000,
|
||||
handlers: {
|
||||
s: '#resizeS',
|
||||
se: '#resizeSE',
|
||||
e: '#resizeE'
|
||||
},
|
||||
onResize: function(size)
|
||||
{
|
||||
$(imageToResize).attr('height', Math.round(size.height).toString());
|
||||
$(imageToResize).attr('width', Math.round(size.width).toString());
|
||||
$(width).val(Math.round(size.width));
|
||||
$(height).val(Math.round(size.height));
|
||||
$(imageContainer).css('width', $(imageToResize).attr('width') + 'px');
|
||||
$(imageContainer).css('height', $(imageToResize).attr('height') + 'px');
|
||||
$('#ratio').val($(resizeMe).ResizableRatio() );
|
||||
addImageHistory();
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
$(resizeMe).ResizeConstraint(constraint);
|
||||
if(typeof(constraint) == 'boolean' && constraint)
|
||||
{
|
||||
$('#resizeS').hide();
|
||||
$('#resizeE').hide();
|
||||
}else
|
||||
{
|
||||
$('#resizeS').show();
|
||||
$('#resizeE').show();
|
||||
}
|
||||
$('#resizeSE').show();
|
||||
$('#ratio').val($(resizeMe).ResizableRatio() );
|
||||
|
||||
|
||||
};
|
||||
/**
|
||||
* initiate the position of handler
|
||||
*/
|
||||
function initPositionHandler()
|
||||
{
|
||||
var widthField = $('#width');
|
||||
var heightField = $('#height');
|
||||
var topField = $('#x');
|
||||
var leftField = $('#y');
|
||||
|
||||
var imageToResize = getImageElement();
|
||||
var imageWidth = $(imageToResize).attr('width');
|
||||
var imageHeight = $(imageToResize).attr('height');
|
||||
|
||||
var overlay = $('#resizeMe');
|
||||
var imageContainer = $('#imageContainer');
|
||||
var imageContainerTop = parseInt($(imageContainer).css('top').replace('px', ''));
|
||||
var imageContainerLeft = parseInt($(imageContainer).css('left').replace('px', ''));
|
||||
//Init Container
|
||||
$(imageContainer).css('width', imageWidth + 'px');
|
||||
$(imageContainer).css('height', imageHeight + 'px');
|
||||
|
||||
//Init Overlay
|
||||
$(imageToResize).css('opacity', '100');
|
||||
$(overlay).css('width', imageWidth + 'px');
|
||||
$(overlay).css('height', imageHeight + 'px');
|
||||
$(overlay).css('background-image', '');
|
||||
$(overlay).css('backgroundPosition', '0 0');
|
||||
$(overlay).css('left', imageContainerLeft);
|
||||
$(overlay).css('top', imageContainerTop);
|
||||
|
||||
//Init Form
|
||||
$(widthField).val(imageWidth);
|
||||
$(heightField).val(imageHeight);
|
||||
$(topField).val(0);
|
||||
$(leftField).val(0);
|
||||
$('#angle').val(0);
|
||||
$('#flip_angle').val('');
|
||||
};
|
||||
/**
|
||||
* enable rotate function
|
||||
*/
|
||||
function enableRotate()
|
||||
{
|
||||
hideHandlers();
|
||||
toggleDisabledButton('actionRotateLeft', false);
|
||||
toggleDisabledButton('actionRotateRight', false);
|
||||
|
||||
};
|
||||
/**
|
||||
* disable rotation function
|
||||
*/
|
||||
function disableRotate()
|
||||
{
|
||||
toggleDisabledButton('actionRotateLeft', true);
|
||||
toggleDisabledButton('actionRotateRight', true);
|
||||
};
|
||||
|
||||
function enableConstraint()
|
||||
{
|
||||
$('#constraint').removeAttr('disabled');
|
||||
};
|
||||
|
||||
function disableConstraint()
|
||||
{
|
||||
$('#constraint').attr('disabled', 'disabled');
|
||||
};
|
||||
function ShowHandlers()
|
||||
{
|
||||
$('#resizeSE').show();
|
||||
$('#resizeE').show();
|
||||
$('#resizeNE').show();
|
||||
$('#resizeN').show();
|
||||
$('#resizeNW').show();
|
||||
$('#resizeW').show();
|
||||
$('#resizeSW').show();
|
||||
$('#resizeS').show();
|
||||
} ;
|
||||
|
||||
/**
|
||||
* turn constraint on or off
|
||||
*/
|
||||
function toggleConstraint()
|
||||
{
|
||||
hideHandlers();
|
||||
if(document.formAction.constraint.checked)
|
||||
{
|
||||
$('#resizeMe').ResizeConstraint(true);
|
||||
switch(getModeValue())
|
||||
{
|
||||
case "resize":
|
||||
$('#resizeSE').show();
|
||||
break;
|
||||
case "crop":
|
||||
$('#resizeSE').show();
|
||||
$('#resizeNE').show();
|
||||
$('#resizeNW').show();
|
||||
$('#resizeSW').show();
|
||||
|
||||
break;
|
||||
case "rotate":
|
||||
break;
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
$('#resizeMe').ResizeConstraint(false);
|
||||
switch(getModeValue())
|
||||
{
|
||||
case "resize":
|
||||
$('#resizeSE').show();
|
||||
$('#resizeE').show();
|
||||
$('#resizeS').show();
|
||||
break;
|
||||
case "crop":
|
||||
ShowHandlers();
|
||||
break;
|
||||
case "rotate":
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* restore to the state the image was
|
||||
*/
|
||||
function restoreToOriginal(warning)
|
||||
{
|
||||
if(typeof(warning) == "boolean" && warning)
|
||||
{
|
||||
if(!window.confirm(warningReset))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$("#imageContainer").empty();
|
||||
$("#hiddenImage img").clone().appendTo("#imageContainer");
|
||||
return true;
|
||||
|
||||
|
||||
};
|
||||
/*
|
||||
* left rotate
|
||||
*/
|
||||
function leftRotate()
|
||||
{
|
||||
|
||||
var imageToResize = getImageElement();
|
||||
$(imageToResize).rotate(-90);
|
||||
swapWidthWithHeight();
|
||||
addImageHistory();
|
||||
var angle = $('#angle');
|
||||
|
||||
var angleDegree = (parseInt($(angle).val()) + 90);
|
||||
angleDegree = ((angleDegree == 360)?angleDegree:angleDegree%360);
|
||||
$(angle).val((angleDegree ));
|
||||
return false;
|
||||
|
||||
};
|
||||
/**
|
||||
* cancel mode change
|
||||
*/
|
||||
function cancelChangeMode()
|
||||
{
|
||||
$('#formAction input[@value=' + $('#image_mode').val() + ']').attr('checked', 'checked');
|
||||
};
|
||||
/**
|
||||
* get the image element which is going to be modified
|
||||
*/
|
||||
function getImageElement()
|
||||
{
|
||||
var imageElement = null;
|
||||
var imageContainer = document.getElementById('imageContainer');
|
||||
for(var i = 0; i < imageContainer.childNodes.length; i++)
|
||||
{
|
||||
if((typeof(imageContainer.childNodes[i].name) != "undefined" && imageContainer.childNodes[i].name.toLowerCase() == 'image') || (typeof(imageContainer.childNodes[i].tagName) != "undefined" && (imageContainer.childNodes[i].tagName.toLowerCase() == 'canvas' || imageContainer.childNodes[i].tagName.toLowerCase() == 'img')) )
|
||||
{
|
||||
imageElement = imageContainer.childNodes[i];
|
||||
}
|
||||
}
|
||||
return imageElement;
|
||||
};
|
||||
/*
|
||||
right rotate
|
||||
*/
|
||||
function rightRotate()
|
||||
{
|
||||
|
||||
var imageToResize = getImageElement();
|
||||
$(imageToResize).rotate(90);
|
||||
swapWidthWithHeight();
|
||||
addImageHistory();
|
||||
var angle = $('#angle');
|
||||
|
||||
|
||||
var angleDegree = (parseInt($(angle).val()) - 90 );
|
||||
if(angleDegree < 0)
|
||||
{
|
||||
angleDegree += 360;
|
||||
}
|
||||
angleDegree = ((angleDegree == 360)?angleDegree:angleDegree%360);
|
||||
$(angle).val((angleDegree ));
|
||||
return false;
|
||||
} ;
|
||||
/**
|
||||
* swap image width with height when rotation fired
|
||||
*/
|
||||
function swapWidthWithHeight()
|
||||
{
|
||||
var imageContainer = $('#imageContainer');
|
||||
var resizeMe = $('#resizeMe');
|
||||
var width = $('#width');
|
||||
var height = $('#height');
|
||||
var imageToResize = getImageElement();
|
||||
var newWidth = 0;
|
||||
var newHeight = 0;
|
||||
newWidth = $(imageToResize).attr('width');
|
||||
newHeight = $(imageToResize).attr('height');
|
||||
$(imageContainer).css('width', newWidth + 'px');
|
||||
$(imageContainer).css('height', newHeight + 'px');
|
||||
$(width).val(newWidth);
|
||||
$(height).val(newHeight);
|
||||
$(resizeMe).css('width', newWidth + 'px');
|
||||
$(resizeMe).css('height', newHeight + 'px');
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* records all change mede to the image
|
||||
* this features will be implemented next release
|
||||
*/
|
||||
function addImageHistory()
|
||||
{
|
||||
imageHistory = true;
|
||||
initDisabledButtons(false);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* cleare all records
|
||||
* this features will be implemented next release
|
||||
*/
|
||||
function clearImageHistory()
|
||||
{
|
||||
imageHistory = false;
|
||||
initDisabledButtons(true);
|
||||
|
||||
|
||||
};
|
||||
|
||||
function initDisabledButtons(forceDisable)
|
||||
{
|
||||
if(numSessionHistory)
|
||||
{
|
||||
toggleDisabledButton('actionUndo', false);
|
||||
}else
|
||||
{
|
||||
toggleDisabledButton('actionUndo', true);
|
||||
}
|
||||
if(imageHistory)
|
||||
{
|
||||
toggleDisabledButton('actionSave', false);
|
||||
toggleDisabledButton('actionReset', false);
|
||||
}else
|
||||
{
|
||||
toggleDisabledButton('actionSave', true);
|
||||
toggleDisabledButton('actionReset', true);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* return record
|
||||
* this features will be implemented next release
|
||||
*/
|
||||
function getImageHistory()
|
||||
{
|
||||
return imageHistory;
|
||||
};
|
||||
/**
|
||||
* check if there exists any changes
|
||||
* this features will be implemented next release
|
||||
*/
|
||||
function isImageHistoryExist()
|
||||
{
|
||||
return imageHistory;
|
||||
};
|
||||
|
||||
function flipHorizontal()
|
||||
{
|
||||
if(window.confirm(warningFlipHorizotal))
|
||||
{
|
||||
addImageHistory();
|
||||
$('#flip_angle').val('horizontal');
|
||||
$('#mode').val('flip');
|
||||
saveImage();
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
function flipVertical()
|
||||
{
|
||||
if(window.confirm(warningFlipVertical))
|
||||
{
|
||||
addImageHistory();
|
||||
$('#flip_angle').val('vertical');
|
||||
$('#mode').val('flip');
|
||||
saveImage();
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
function enableFlip()
|
||||
{
|
||||
toggleDisabledButton('actionFlipH', false);
|
||||
toggleDisabledButton('actionFlipV', false);
|
||||
};
|
||||
|
||||
function toggleDisabledButton(buttonId, forceDisable)
|
||||
{
|
||||
var disabledButton = $('#' + buttonId);
|
||||
var newClass = '';
|
||||
var changeRequired = true;
|
||||
var toBeDisabled = false;
|
||||
var currentClass = $(disabledButton).attr('class') ;
|
||||
if(typeof(forceDisable) == 'boolean')
|
||||
{
|
||||
|
||||
if(forceDisable && currentClass == 'button')
|
||||
{
|
||||
newClass = 'disabledButton';
|
||||
$(disabledButton).attr('disabled', 'disabled');
|
||||
}else if(!forceDisable && currentClass == 'disabledButton')
|
||||
{
|
||||
newClass = 'button';
|
||||
$(disabledButton).removeAttr('disabled');
|
||||
}else
|
||||
{
|
||||
changeRequired = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if(currentClass == 'button')
|
||||
{
|
||||
newClass = 'disabledButton';
|
||||
$(disabledButton).attr('disabled', 'disabled');
|
||||
}else
|
||||
{
|
||||
newClass = 'button';
|
||||
$(disabledButton).removeAttr('disabled');
|
||||
}
|
||||
if(changeRequired)
|
||||
{
|
||||
$(disabledButton).removeClass('button disabledButton');
|
||||
$(disabledButton).addClass(newClass);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
function disableFlip()
|
||||
{
|
||||
toggleDisabledButton('actionFlipH', true);
|
||||
toggleDisabledButton('actionFlipV', true);
|
||||
};
|
||||
|
||||
function undoImage()
|
||||
{
|
||||
if(numSessionHistory < 1)
|
||||
{
|
||||
alert(warningResetEmpty);
|
||||
|
||||
}else
|
||||
{
|
||||
if(window.confirm(warningUndoImage))
|
||||
{
|
||||
processImage('formAction');
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
};
|
||||
|
||||
function processImage(formId)
|
||||
{
|
||||
$("#loading")
|
||||
.ajaxStart(function(){
|
||||
$(this).show();
|
||||
})
|
||||
.ajaxComplete(function(){
|
||||
$(this).hide();
|
||||
});
|
||||
var options =
|
||||
{
|
||||
dataType: 'json',
|
||||
error: function (data, status, e)
|
||||
{
|
||||
alert(e);
|
||||
},
|
||||
success: function(data)
|
||||
{
|
||||
if(typeof(data.error) == 'undefined')
|
||||
{
|
||||
alert('Unexpected information ');
|
||||
}
|
||||
else if(data.error != '')
|
||||
{
|
||||
|
||||
alert(data.error);
|
||||
}else
|
||||
{
|
||||
$("#loading").show();
|
||||
|
||||
currentFolder = data.folder_path;
|
||||
if(data.save_as == '1')
|
||||
{
|
||||
numSessionHistory = 0;
|
||||
}else
|
||||
{
|
||||
numSessionHistory = parseInt(data.history);
|
||||
}
|
||||
$('#file_path').val(data.path);
|
||||
$('#path').val(data.path);
|
||||
var preImage = new Image();
|
||||
preImage.width = data.width;
|
||||
preImage.height = data.height;
|
||||
preImage.onload = function()
|
||||
{
|
||||
|
||||
$('#hiddenImage').empty();
|
||||
$(preImage).appendTo('#hiddenImage');
|
||||
|
||||
changeMode(false, true);
|
||||
$('#loading').hide();
|
||||
$('#windowSaveAs').jqm({modal: true}).jqmHide();
|
||||
|
||||
};
|
||||
var now = new Date();
|
||||
preImage.src = data.path + "?" + now.getTime();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
$('#' + formId).ajaxSubmit(options);
|
||||
return false;
|
||||
};
|
||||
|
||||
function saveAsImagePre()
|
||||
{
|
||||
$('#windowSaveAs').jqm({modal: true}).jqmShow();
|
||||
var saveTo = $('#save_to');
|
||||
$(saveTo).removeOption(/./);
|
||||
$(saveTo).ajaxAddOption(urlGetFolderList, {}, false,
|
||||
function()
|
||||
{
|
||||
$(saveTo).selectOptions(currentFolder);
|
||||
});
|
||||
return false;
|
||||
};
|
||||
|
||||
function saveAsImage()
|
||||
{
|
||||
|
||||
var pattern=/^[A-Za-z0-9_ \-]+$/i;
|
||||
|
||||
var newName = $('#new_name');
|
||||
|
||||
var saveAs = $('#save_to').get(0);
|
||||
//alert($(saveAs).val());
|
||||
if(!pattern.test($(newName).val()))
|
||||
{
|
||||
alert(warningInvalidNewName);
|
||||
}else if(saveAs.selectedIndex < 0)
|
||||
{
|
||||
alert(warningNoFolderSelected);
|
||||
}else
|
||||
{
|
||||
|
||||
$('#hidden_new_name').val($(newName).val());
|
||||
$('#hidden_save_to').val(saveAs.options[saveAs.selectedIndex].value);
|
||||
if(saveImage(true))
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
function saveImage(saveAs)
|
||||
{
|
||||
if(typeof(saveAs) == 'boolean' && saveAs)
|
||||
{
|
||||
|
||||
}else
|
||||
{//remove new name if just normal save
|
||||
$('#hidden_new_name').val('');
|
||||
$('#hidden_save_to').val('');
|
||||
}
|
||||
if (!isImageHistoryExist() && (typeof(saveAs) == 'undefined' || !saveAs))
|
||||
{
|
||||
alert(noChangeMadeBeforeSave);
|
||||
}else
|
||||
{
|
||||
|
||||
if(processImage('formImageInfo'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
function editorClose()
|
||||
{
|
||||
if(window.confirm(warningEditorClose))
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
//jquery.js. start
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7(1g 18.6=="I"){18.I=18.I;u 6=q(a,c){7(18==9||!9.3X)v 14 6(a,c);v 9.3X(a,c)};7(1g $!="I")6.1I$=$;u $=6;6.11=6.8r={3X:q(a,c){a=a||P;7(6.16(a))v 14 6(P)[6.11.1G?"1G":"1W"](a);7(1g a=="1s"){u m=/^[^<]*(<(.|\\s)+>)[^>]*$/.1V(a);7(m)a=6.31([m[1]]);B v 14 6(c).1L(a)}v 9.4E(a.15==2b&&a||(a.3C||a.C&&a!=18&&!a.1q&&a[0]!=I&&a[0].1q)&&6.2L(a)||[a])},3C:"1.1.3.1",7W:q(){v 9.C},C:0,1M:q(a){v a==I?6.2L(9):9[a]},1Z:q(a){u b=6(a);b.5q=9;v b},4E:q(a){9.C=0;[].R.O(9,a);v 9},F:q(a,b){v 6.F(9,a,b)},2p:q(a){u b=-1;9.F(q(i){7(9==a)b=i});v b},1b:q(f,d,e){u c=f;7(f.15==33)7(d==I)v 9.C&&6[e||"1b"](9[0],f)||I;B{c={};c[f]=d}v 9.F(q(a){E(u b V c)6.1b(e?9.T:9,b,6.4H(9,c[b],e,a,b))})},1f:q(b,a){v 9.1b(b,a,"2z")},2A:q(e){7(1g e=="1s")v 9.2Y().3e(P.66(e));u t="";6.F(e||9,q(){6.F(9.2S,q(){7(9.1q!=8)t+=9.1q!=1?9.5R:6.11.2A([9])})});v t},8b:q(){u a,1S=19;v 9.F(q(){7(!a)a=6.31(1S,9.2O);u b=a[0].3s(K);9.L.2K(b,9);1v(b.1d)b=b.1d;b.4g(9)})},3e:q(){v 9.2F(19,K,1,q(a){9.4g(a)})},5w:q(){v 9.2F(19,K,-1,q(a){9.2K(a,9.1d)})},5t:q(){v 9.2F(19,N,1,q(a){9.L.2K(a,9)})},5s:q(){v 9.2F(19,N,-1,q(a){9.L.2K(a,9.1X)})},2U:q(){v 9.5q||6([])},1L:q(t){u b=6.3k(9,q(a){v 6.1L(t,a)});v 9.1Z(/[^+>] [^+>]/.17(t)||t.J("..")>-1?6.5g(b):b)},7x:q(e){u d=9.1A(9.1L("*"));d.F(q(){9.1I$1a={};E(u a V 9.$1a)9.1I$1a[a]=6.1c({},9.$1a[a])}).3U();u r=9.1Z(6.3k(9,q(a){v a.3s(e!=I?e:K)}));d.F(q(){u b=9.1I$1a;E(u a V b)E(u c V b[a])6.S.1A(9,a,b[a][c],b[a][c].W);9.1I$1a=H});v r},1i:q(t){v 9.1Z(6.16(t)&&6.2s(9,q(b,a){v t.O(b,[a])})||6.2x(t,9))},4Y:q(t){v 9.1Z(t.15==33&&6.2x(t,9,K)||6.2s(9,q(a){v(t.15==2b||t.3C)?6.2w(a,t)<0:a!=t}))},1A:q(t){v 9.1Z(6.1T(9.1M(),t.15==33?6(t).1M():t.C!=I&&(!t.Q||t.Q=="6Z")?t:[t]))},37:q(a){v a?6.2x(a,9).C>0:N},6R:q(a){v a==I?(9.C?9[0].2v:H):9.1b("2v",a)},3F:q(a){v a==I?(9.C?9[0].27:H):9.2Y().3e(a)},2F:q(f,d,g,e){u c=9.C>1,a;v 9.F(q(){7(!a){a=6.31(f,9.2O);7(g<0)a.6E()}u b=9;7(d&&6.Q(9,"1r")&&6.Q(a[0],"2V"))b=9.3R("1z")[0]||9.4g(P.5h("1z"));6.F(a,q(){e.O(b,[c?9.3s(K):9])})})}};6.1c=6.11.1c=q(){u c=19[0],a=1;7(19.C==1){c=9;a=0}u b;1v((b=19[a++])!=H)E(u i V b)c[i]=b[i];v c};6.1c({6n:q(){7(6.1I$)$=6.1I$;v 6},16:q(a){v!!a&&1g a!="1s"&&!a.Q&&a.15!=2b&&/q/i.17(a+"")},40:q(a){v a.4z&&a.2O&&!a.2O.4y},Q:q(b,a){v b.Q&&b.Q.1D()==a.1D()},F:q(a,b,c){7(a.C==I)E(u i V a)b.O(a[i],c||[i,a[i]]);B E(u i=0,4x=a.C;i<4x;i++)7(b.O(a[i],c||[i,a[i]])===N)1F;v a},4H:q(c,b,d,e,a){7(6.16(b))b=b.3D(c,[e]);u f=/z-?2p|5Y-?8p|1e|5U|8i-?1u/i;v b&&b.15==3y&&d=="2z"&&!f.17(a)?b+"4o":b},12:{1A:q(b,c){6.F(c.2R(/\\s+/),q(i,a){7(!6.12.3w(b.12,a))b.12+=(b.12?" ":"")+a})},1E:q(b,c){b.12=c!=I?6.2s(b.12.2R(/\\s+/),q(a){v!6.12.3w(c,a)}).5M(" "):""},3w:q(t,c){v 6.2w(c,(t.12||t).3v().2R(/\\s+/))>-1}},4m:q(e,o,f){E(u i V o){e.T["2N"+i]=e.T[i];e.T[i]=o[i]}f.O(e,[]);E(u i V o)e.T[i]=e.T["2N"+i]},1f:q(e,p){7(p=="1u"||p=="29"){u b={},3r,3p,d=["83","81","80","7Y"];6.F(d,q(){b["7V"+9]=0;b["7T"+9+"7S"]=0});6.4m(e,b,q(){7(6(e).37(\':4f\')){3r=e.7Q;3p=e.7O}B{e=6(e.3s(K)).1L(":4b").5v("2B").2U().1f({48:"1y",3i:"7L",U:"2h",7K:"0",7I:"0"}).5o(e.L)[0];u a=6.1f(e.L,"3i")||"3n";7(a=="3n")e.L.T.3i="7G";3r=e.7E;3p=e.7D;7(a=="3n")e.L.T.3i="3n";e.L.3q(e)}});v p=="1u"?3r:3p}v 6.2z(e,p)},2z:q(e,a,d){u g;7(a=="1e"&&6.M.1h){g=6.1b(e.T,"1e");v g==""?"1":g}7(a.3t(/3x/i))a=6.1U;7(!d&&e.T[a])g=e.T[a];B 7(P.3f&&P.3f.3Y){7(a.3t(/3x/i))a="3x";a=a.1o(/([A-Z])/g,"-$1").2H();u b=P.3f.3Y(e,H);7(b)g=b.57(a);B 7(a=="U")g="1P";B 6.4m(e,{U:"2h"},q(){u c=P.3f.3Y(9,"");g=c&&c.57(a)||""})}B 7(e.3S){u f=a.1o(/\\-(\\w)/g,q(m,c){v c.1D()});g=e.3S[a]||e.3S[f]}v g},31:q(a,c){u r=[];c=c||P;6.F(a,q(i,b){7(!b)v;7(b.15==3y)b=b.3v();7(1g b=="1s"){u s=6.2C(b).2H(),1x=c.5h("1x"),1N=[];u a=!s.J("<1H")&&[1,"<2y>","</2y>"]||!s.J("<7g")&&[1,"<52>","</52>"]||(!s.J("<7c")||!s.J("<1z")||!s.J("<7a")||!s.J("<78"))&&[1,"<1r>","</1r>"]||!s.J("<2V")&&[2,"<1r><1z>","</1z></1r>"]||(!s.J("<75")||!s.J("<74"))&&[3,"<1r><1z><2V>","</2V></1z></1r>"]||!s.J("<73")&&[2,"<1r><4W>","</4W></1r>"]||[0,"",""];1x.27=a[1]+b+a[2];1v(a[0]--)1x=1x.1d;7(6.M.1h){7(!s.J("<1r")&&s.J("<1z")<0)1N=1x.1d&&1x.1d.2S;B 7(a[1]=="<1r>"&&s.J("<1z")<0)1N=1x.2S;E(u n=1N.C-1;n>=0;--n)7(6.Q(1N[n],"1z")&&!1N[n].2S.C)1N[n].L.3q(1N[n])}b=6.2L(1x.2S)}7(0===b.C&&(!6.Q(b,"34")&&!6.Q(b,"2y")))v;7(b[0]==I||6.Q(b,"34")||b.71)r.R(b);B r=6.1T(r,b)});v r},1b:q(c,d,a){u e=6.40(c)?{}:6.3H;7(e[d]){7(a!=I)c[e[d]]=a;v c[e[d]]}B 7(a==I&&6.M.1h&&6.Q(c,"34")&&(d=="70"||d=="6Y"))v c.6W(d).5R;B 7(c.4z){7(a!=I)c.6U(d,a);7(6.M.1h&&/4M|2u/.17(d)&&!6.40(c))v c.35(d,2);v c.35(d)}B{7(d=="1e"&&6.M.1h){7(a!=I){c.5U=1;c.1i=(c.1i||"").1o(/4L\\([^)]*\\)/,"")+(39(a).3v()=="6M"?"":"4L(1e="+a*4X+")")}v c.1i?(39(c.1i.3t(/1e=([^)]*)/)[1])/4X).3v():""}d=d.1o(/-([a-z])/6K,q(z,b){v b.1D()});7(a!=I)c[d]=a;v c[d]}},2C:q(t){v t.1Line truncated
|
||||
//form.js start
|
||||
(function($){$.fn.ajaxSubmit=function(o){if(typeof o=='function')o={success:o};o=$.extend({url:this.attr('action')||window.location,type:this.attr('method')||'GET'},o||{});var a=this.formToArray(o.semantic);if(o.beforeSubmit&&o.beforeSubmit(a,this,o)===false)return this;var p={};$.event.trigger('form.submit.validate',[a,this,o,p]);if(p.veto)return this;var q=$.param(a);if(o.type.toUpperCase()=='GET'){o.url+=(o.url.indexOf('?')>=0?'&':'?')+q;o.data=null}else o.data=q;var r=this,callbacks=[];if(o.resetForm)callbacks.push(function(){r.resetForm()});if(o.clearForm)callbacks.push(function(){r.clearForm()});if(!o.dataType&&o.target){var u=o.success;callbacks.push(function(a){$(o.target).attr("innerHTML",a).evalScripts().each(u,arguments)})}else if(o.success)callbacks.push(o.success);o.success=function(a,b){for(var i=0,max=callbacks.length;i<max;i++)callbacks[i](a,b,r)};var v=$('input:file',this).fieldValue();var w=false;for(var j=0;j<v.length;j++)if(v[j])w=true;if(o.iframe||w)fileUpload();else $.ajax(o);$.event.trigger('form.submit.notify',[this,o]);return this;function fileUpload(){var d=r[0];var f=$.extend({},$.ajaxSettings,o);var h='jqFormIO'+$.fn.ajaxSubmit.counter++;var i=$('<iframe id="'+h+'" name="'+h+'" />');var j=i[0];var k=$.browser.opera&&window.opera.version()<9;if($.browser.msie||k)j.src='javascript:false;document.write("");';i.css({position:'absolute',top:'-1000px',left:'-1000px'});var l={responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=f.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[l,f]);var m=0;var n=0;setTimeout(function(){i.appendTo('body');j.attachEvent?j.attachEvent('onload',cb):j.addEventListener('load',cb,false);var a=d.encoding?'encoding':'enctype';var t=r.attr('target');r.attr({target:h,method:'POST',encAttr:'multipart/form-data',action:f.url});if(f.timeout)setTimeout(function(){n=true;cb()},f.timeout);d.submit();r.attr('target',t)},10);function cb(){if(m++)return;j.detachEvent?j.detachEvent('onload',cb):j.removeEventListener('load',cb,false);var a=true;try{if(n)throw'timeout';var b,doc;doc=j.contentWindow?j.contentWindow.document:j.contentDocument?j.contentDocument:j.document;l.responseText=doc.body?doc.body.innerHTML:null;l.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(f.dataType=='json'||f.dataType=='script'){var c=doc.getElementsByTagName('textarea')[0];b=c?c.value:l.responseText;if(f.dataType=='json')eval("data = "+b);else $.globalEval(b)}else if(f.dataType=='xml'){b=l.responseXML;if(!b&&l.responseText!=null)b=toXml(l.responseText)}else{b=l.responseText}}catch(e){a=false;$.handleError(f,l,'error',e)}if(a){f.success(b,'success');if(g)$.event.trigger("ajaxSuccess",[l,f])}if(g)$.event.trigger("ajaxComplete",[l,f]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(f.complete)f.complete(l,a?'success':'error');setTimeout(function(){i.remove();l.responseXML=null},100)};function toXml(s,a){if(window.ActiveXObject){a=new ActiveXObject('Microsoft.XMLDOM');a.async='false';a.loadXML(s)}else a=(new DOMParser()).parseFromString(s,'text/xml');return(a&&a.documentElement&&a.documentElement.tagName!='parsererror')?a:null}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(a){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=a;$(":submit,input:image",this).click(clickHandler)})};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var a=this.form;a.clk=this;if(this.type=='image'){if(e.offsetX!=undefined){a.clk_x=e.offsetX;a.clk_y=e.offsetY}else if(typeof $.fn.offset=='function'){var b=$(this).offset();a.clk_x=e.pageX-b.left;a.clk_y=e.pageY-b.top}else{a.clk_x=e.pageX-this.offsetLeft;a.clk_y=e.pageY-this.offsetTop}}setTimeout(function(){a.clk=a.clk_x=a.clk_y=null},10)};function submitHandler(){var a=this.formPluginId;var b=$.fn.ajaxForm.optionHash[a];$(this).ajaxSubmit(b);return false};$.fn.ajaxFormUnbind=function(){this.unbind('submit',submitHandler);return this.each(function(){$(":submit,input:image",this).unbind('click',clickHandler)})};$.fn.formToArray=function(b){var a=[];if(this.length==0)return a;var c=this[0];var d=b?c.getElementsByTagName('*'):c.elements;if(!d)return a;for(var i=0,max=d.length;i<max;i++){var e=d[i];var n=e.name;if(!n)continue;if(b&&c.clk&&e.type=="image"){if(!e.disabled&&c.clk==e)a.push({name:n+'.x',value:c.clk_x},{name:n+'.y',value:c.clk_y});continue}var v=$.fieldValue(e,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)a.push({name:n,value:v[j]})}else if(v!==null&&typeof v!='undefined')a.push({name:n,value:v})}if(!b&&c.clk){var f=c.getElementsByTagName("input");for(var i=0,max=f.length;i<max;i++){var g=f[i];var n=g.name;if(n&&!g.disabled&&g.type=="image"&&c.clk==g)a.push({name:n+'.x',value:c.clk_x},{name:n+'.y',value:c.clk_y})}}return a};$.fn.formSerialize=function(a){retuLine truncated
|
||||
//form.js end
|
||||
//select.js start
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.u.G=6(){4 e=6(a,v,t,b){4 c=P.Q("R");c.j=v,c.C=t;4 o=a.x;4 d=o.l;3(!a.n){a.n={};p(4 i=0;i<d;i++){a.n[o[i].j]=i}}3(8 a.n[v]=="M")a.n[v]=d;a.x[a.n[v]]=c;3(b){c.k=9}};4 a=N;3(a.l==0)7 5;4 f=9;4 m=q;4 g,v,t;3(8(a[0])=="z"){m=9;g=a[0]}3(a.l>=2){3(8(a[1])=="H")f=a[1];h 3(8(a[2])=="H")f=a[2];3(!m){v=a[0];t=a[1]}}5.y(6(){3(5.A.s()!="B")7;3(m){p(4 a S g){e(5,a,g[a],f)}}h{e(5,v,t,f)}});7 5};$.u.T=6(b,c,d,e,f){3(8(b)!="D")7 5;3(8(c)!="z")c={};3(8(d)!="H")d=9;5.y(6(){4 a=5;$.U(b,c,6(r){$(a).G(r,d);3(8 e=="6"){3(8 f=="z"){e.V(a,f)}h{e.I(a)}}})});7 5};$.u.W=6(){4 a=N;3(a.l==0)7 5;4 d=8(a[0]);4 v,i;3(d=="D"||d=="z"||d=="6")v=a[0];h 3(d=="X")i=a[0];h 7 5;5.y(6(){3(5.A.s()!="B")7;3(5.n)5.n=O;4 b=q;4 o=5.x;3(!!v){4 c=o.l;p(4 i=c-1;i>=0;i--){3(v.J==K){3(o[i].j.L(v)){b=9}}h 3(o[i].j==v){b=9}3(b&&a[1]===9)b=o[i].k;3(b){o[i]=O}b=q}}h{3(b&&a[1]===9)b=o[i].k;3(b){5.Y(i)}}});7 5};$.u.Z=6(f){4 a=8(f)=="M"?9:!!f;5.y(6(){3(5.A.s()!="B")7;4 o=5.x;4 d=o.l;4 e=[];p(4 i=0;i<d;i++){e[i]={v:o[i].j,t:o[i].C}}e.10(6(b,c){E=b.t.s(),F=c.t.s();3(E==F)7 0;3(a){7 E<F?-1:1}h{7 E>F?-1:1}});p(4 i=0;i<d;i++){o[i].C=e[i].t;o[i].j=e[i].v}});7 5};$.u.11=6(b,d){4 v=b;4 e=8(b);4 c=d||q;3(e!="D"&&e!="6"&&e!="z")7 5;5.y(6(){3(5.A.s()!="B")7 5;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(v.J==K){3(o[i].j.L(v)){o[i].k=9}h 3(c){o[i].k=q}}h{3(o[i].j==v){o[i].k=9}h 3(c){o[i].k=q}}}});7 5};$.u.12=6(b,c){4 w=c||"k";3($(b).13()==0)7 5;5.y(6(){3(5.A.s()!="B")7 5;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(w=="14"||(w=="k"&&o[i].k)){$(b).G(o[i].j,o[i].C)}}});7 5};$.u.15=6(b,c){4 d=q;4 v=b;4 e=8(v);4 f=8(c);3(e!="D"&&e!="6"&&e!="z")7 f=="6"?5:d;5.y(6(){3(5.A.s()!="B")7 5;3(d&&f!="6")7 q;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(v.J==K){3(o[i].j.L(v)){d=9;3(f=="6")c.I(o[i])}}h{3(o[i].j==v){d=9;3(f=="6")c.I(o[i])}}}});7 f=="6"?5:d}})(16);',62,69,'|||if|var|this|function|return|typeof|true||||||||else||value|selected|length||cache||for|false||toLowerCase||fn|||options|each|object|nodeName|select|text|string|o1t|o2t|addOption|boolean|call|constructor|RegExp|match|undefined|arguments|null|document|createElement|option|in|ajaxAddOption|getJSON|apply|removeOption|number|remove|sortOptions|sort|selectOptions|copyOptions|size|all|containsOption|jQuery'.split('|'),0,{}));
|
||||
//select.js end
|
||||
//jqmodal.js start
|
||||
/*(function($){$.fn.jqm=function(o){var a={zIndex:3000,overlay:50,overlayClass:'jqmOverlay',closeClass:'jqmClose',trigger:'.jqModal',ajax:false,target:false,modal:false,onShow:false,onHide:false,onLoad:false};return this.each(function(){if(this._jqm)return;s++;this._jqm=s;H[s]={c:$.extend(a,o),a:false,w:$(this).addClass('jqmID'+s),s:s};if(a.trigger)$(this).jqmAddTrigger(a.trigger)})};$.fn.jqmAddClose=function(e){hs(this,e,'jqmHide');return this};$.fn.jqmAddTrigger=function(e){hs(this,e,'jqmShow');return this};$.fn.jqmShow=function(t){return this.each(function(){if(!H[this._jqm].a)$.jqm.open(this._jqm,t)})};$.fn.jqmHide=function(t){return this.each(function(){if(H[this._jqm].a)$.jqm.close(this._jqm,t)})};$.jqm={hash:{},open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(/^\d+$/.test(h.w.css('z-index')))?h.w.css('z-index'):c.zIndex,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});h.t=t;h.a=true;h.w.css('z-index',z);if(c.modal){if(!A[0])F('bind');A.push(s);o.css('cursor','wait')}else if(c.overlay>0)h.w.jqmAddClose(o);else o=false;h.o=(o)?o.addClass(c.overlayClass).appendTo('body'):false;if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in{Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'")}}if(c.ajax){var r=c.target,u=c.ajax;r=(r)?(typeof r=='string')?$(r,h.w):$(r):h.w;u=(u.substr(0,1)=='@')?$(t).attr(u.substring(1)):u;r.load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h)})}else if(cc)h.w.jqmAddClose($(cc,h.w));(c.onShow)?c.onShow(h):h.w.show();e(h);return false},close:function(s){var h=H[s];h.a=false;if(A[0]){A.pop();if(!A[0])F('unbind')}if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove()}return false}};var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&typeof XMLHttpRequest=='function',i=$('<iframe class="jqm"></iframe>').css({opacity:0}),e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i);f(h)},f=function(h){h.f=$(':input:visible:first',h.w)[0];if(h.f)h.f.focus()},F=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m)},m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return!r},hs=function(w,e,y){var s=[];w.each(function(){s.push(this._jqm)});$(e).each(function(){if(this[y])$.extend(this[y],s);else{this[y]=s;$(this).click(function(){for(var i in{jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return false})}})}})(jQuery);*/
|
||||
|
||||
|
||||
|
||||
(function($){$.fn.jqm=function(o){var p={overlay:50,overlayClass:'jqmOverlay',closeClass:'jqmClose',trigger:'.jqModal',ajax:F,ajaxText:'',target:F,modal:F,toTop:F,onShow:F,onHide:F,onLoad:F};return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};if(p.trigger)$(this).jqmAddTrigger(p.trigger)})};$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide')};$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow')};$.fn.jqmShow=function(t){return this.each(function(){$.jqm.open(this._jqm,t)})};$.fn.jqmHide=function(t){return this.each(function(){$.jqm.close(this._jqm,t)})};$.jqm={hash:{},open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);if(c.modal){if(!A[0])L('bind');A.push(s)}else if(c.overlay>0)h.w.jqmAddClose(o);else o=F;h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in{Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'")}}if(c.ajax){var r=c.target||h.w,u=c.ajax,r=(typeof r=='string')?$(r,h.w):$(r),u=(u.substr(0,1)=='@')?$(t).attr(u.substring(1)):u;r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h)})}else if(cc)h.w.jqmAddClose($(cc,h.w));if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);(c.onShow)?c.onShow(h):h.w.show();e(h);return F},close:function(s){var h=H[s];if(!h.a)return F;h.a=F;if(A[0]){A.pop();if(!A[0])L('unbind')}if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove()}return F},params:{}};var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version=="6.0"),F=false,i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i);f(h)},f=function(h){try{$(':input:visible',h.w)[0].focus()}catch(_){}},L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m)},m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return!r},hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function(){if(!this[c]){this[c]=[];$(this).click(function(){for(var i in{jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F})}this[c].push(s)})})}})(jQuery);
|
||||
//jqModal.js end
|
||||
|
||||
//rotate.js start
|
||||
jQuery.fn.rotate=function(a,b){var p=this.get(0);if(!b){p.angle=((p.angle==undefined?0:p.angle)+a)%360}else{p.angle=a}if(p.angle>=0){var c=Math.PI*p.angle/180}else{var c=Math.PI*(360+p.angle)/180}var d=Math.cos(c);var e=Math.sin(c);if(document.all&&!window.opera){var f=document.createElement('img');f.src=p.src;f.height=p.height;f.width=p.width;f.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+d+",M12="+(-e)+",M21="+e+",M22="+d+",SizingMethod='auto expand')"}else{var f=document.createElement('canvas');if(!p.oImage){f.oImage=new Image();f.oImage.src=p.src;f.oImage.width=p.width;f.oImage.height=p.height}else{f.oImage=p.oImage}f.style.width=f.width=Math.abs(d*f.oImage.width)+Math.abs(e*f.oImage.height);f.style.height=f.height=Math.abs(d*f.oImage.height)+Math.abs(e*f.oImage.width);var g=f.getContext('2d');g.save();if(c<=Math.PI/2){g.translate(e*f.oImage.height,0)}else if(c<=Math.PI){g.translate(f.width,-d*f.oImage.height)}else if(c<=1.5*Math.PI){g.translate(-d*f.oImage.width,f.height)}else{g.translate(0,-e*f.oImage.width)}g.rotate(c);g.drawImage(f.oImage,0,0,f.oImage.width,f.oImage.height);g.restore()}f.id=p.id;f.angle=p.angle;p.parentNode.replaceChild(f,p)};jQuery.fn.rotateRight=function(a){this.rotate(a==undefined?90:a)};jQuery.fn.rotateLeft=function(a){this.rotate(a==undefined?-90:-a)};
|
||||
//rotate.js end
|
||||
//interface.js start
|
||||
jQuery.iUtil={getPosition:function(e){var x=0;var y=0;var a=e.style;var b=false;if(jQuery(e).css('display')=='none'){var c=a.visibility;var d=a.position;b=true;a.visibility='hidden';a.display='block';a.position='absolute'}var f=e;while(f){x+=f.offsetLeft+(f.currentStyle&&!jQuery.browser.opera?parseInt(f.currentStyle.borderLeftWidth)||0:0);y+=f.offsetTop+(f.currentStyle&&!jQuery.browser.opera?parseInt(f.currentStyle.borderTopWidth)||0:0);f=f.offsetParent}f=e;while(f&&f.tagName&&f.tagName.toLowerCase()!='body'){x-=f.scrollLeft||0;y-=f.scrollTop||0;f=f.parentNode}if(b==true){a.display='none';a.position=d;a.visibility=c}return{x:x,y:y}},getPositionLite:function(a){var x=0,y=0;while(a){x+=a.offsetLeft||0;y+=a.offsetTop||0;a=a.offsetParent}return{x:x,y:y}},getSize:function(e){var w=jQuery.css(e,'width');var h=jQuery.css(e,'height');var a=0;var b=0;var c=e.style;if(jQuery(e).css('display')!='none'){a=e.offsetWidth;b=e.offsetHeight}else{var d=c.visibility;var f=c.position;c.visibility='hidden';c.display='block';c.position='absolute';a=e.offsetWidth;b=e.offsetHeight;c.display='none';c.position=f;c.visibility=d}return{w:w,h:h,wb:a,hb:b}},getSizeLite:function(a){return{wb:a.offsetWidth||0,hb:a.offsetHeight||0}},getClient:function(e){var h,w,de;if(e){w=e.clientWidth;h=e.clientHeight}else{de=document.documentElement;w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight}return{w:w,h:h}},getScroll:function(e){var t=0,l=0,w=0,h=0,iw=0,ih=0;if(e&&e.nodeName.toLowerCase()!='body'){t=e.scrollTop;l=e.scrollLeft;w=e.scrollWidth;h=e.scrollHeight;iw=0;ih=0}else{if(document.documentElement){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;w=document.documentElement.scrollWidth;h=document.documentElement.scrollHeight}else if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;w=document.body.scrollWidth;h=document.body.scrollHeight}iw=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;ih=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}return{t:t,l:l,w:w,h:h,iw:iw,ih:ih}},getMargins:function(e,a){var c=jQuery(e);var t=c.css('marginTop')||'';var r=c.css('marginRight')||'';var b=c.css('marginBottom')||'';var l=c.css('marginLeft')||'';if(a)return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)};else return{t:t,r:r,b:b,l:l}},getPadding:function(e,a){var c=jQuery(e);var t=c.css('paddingTop')||'';var r=c.css('paddingRight')||'';var b=c.css('paddingBottom')||'';var l=c.css('paddingLeft')||'';if(a)return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)};else return{t:t,r:r,b:b,l:l}},getBorder:function(e,a){var c=jQuery(e);var t=c.css('borderTopWidth')||'';var r=c.css('borderRightWidth')||'';var b=c.css('borderBottomWidth')||'';var l=c.css('borderLeftWidth')||'';if(a)return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)||0};else return{t:t,r:r,b:b,l:l}},getPointer:function(a){var x=a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))||0;var y=a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))||0;return{x:x,y:y}},traverseDOM:function(a,b){b(a);a=a.firstChild;while(a){jQuery.iUtil.traverseDOM(a,b);a=a.nextSibling}},purgeEvents:function(c){jQuery.iUtil.traverseDOM(c,function(a){for(var b in a){if(typeof a[b]==='function'){a[b]=null}}})},centerEl:function(a,b){var c=jQuery.iUtil.getScroll();var d=jQuery.iUtil.getSize(a);if(!b||b=='vertically')jQuery(a).css({top:c.t+((Math.max(c.h,c.ih)-c.t-d.hb)/2)+'px'});if(!b||b=='horizontally')jQuery(a).css({left:c.l+((Math.max(c.w,c.iw)-c.l-d.wb)/2)+'px'})},fixPNG:function(a,b){var c=jQuery('img[@src*="png"]',a||document),png;c.each(function(){png=this.src;this.src=b;this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+png+"')"})}};[].indexOf||(Array.prototype.indexOf=function(v,n){n=(n==null)?0:n;var m=this.length;for(var i=n;i<m;i++)if(this[i]==v)return i;return-1});jQuery.iResize={resizeElement:null,resizeDirection:null,dragged:null,pointer:null,sizes:null,position:null,startDrag:function(e){jQuery.iResize.dragged=(this.dragEl)?this.dragEl:this;jQuery.iResize.pointer=jQuery.iUtil.getPointer(e);jQuery.iResize.sizes={width:parseInt(jQuery(jQuery.iResize.dragged).css('width'))||0,height:parseInt(jQuery(jQuery.iResize.dragged).css('height'))||0};jQuery.iResize.position={top:parseInt(jQuery(jQuery.iResize.dragged).css('top'))||0,left:parseInt(jQuery(jQuery.iResize.dragged).css('left'))||0};jQuery(document).bind('mousemove',jQuery.iResize.moveDrag).bind('mouseup',jQuery.iResize.stopDrag);if(typeof jQuery.iResize.dragged.resizeOptions.onDragStart==='function'){jQuery.iResize.dragged.resizeOptions.onDragStart.apply(jQuery.iResize.dragged)}return false},stopDrag:function(e){jQuery(document).unbind('mousemove',jQuery.iResize.moveDrag).unbind('mouLine truncated
|
||||
//interface.js end
|
||||
//image_editor_general.js start
|
||||
/*function getModeValue(){var CheckedElem=null;for(var i=0;i<document.formAction.mode.length;i++){if(document.formAction.mode[i].checked||i==0){CheckedElem=document.formAction.mode[i]}}CheckedElem.checked=true;return CheckedElem.value};function changeMode(restore,force){var mode=getModeValue();var imageMode=$('#image_mode');if(mode!=$(imageMode).val()||(typeof(restore)=="boolean")){if(isImageHistoryExist()||typeof(force)=='boolean'){if(typeof(restore)=="boolean"||typeof(force)=='boolean'){if(!restoreToOriginal(restore)){return false}clearImageHistory()}else if(!window.confirm(warningLostChanges)){cancelChangeMode();return false}else{restoreToOriginal(false);clearImageHistory()}}else if((typeof(restore)=="boolean"&&restore)){return false}initPositionHandler();switch(mode){case"resize":switch($('#image_mode').val()){case"crop":disableCrop();break;case"rotate":disableRotate();break;case"flip":disableFlip();break;default:disableRotate()}enableResize(document.formAction.constraint.checked);break;case"crop":switch($('#image_mode').val()){case"resize":disableResize();break;case"rotate":disableRotate();break;case"flip":disableFlip();break;default:disableRotate()}enableCrop();break;case"rotate":switch($('#image_mode').val()){case"resize":disableResize();break;case"crop":disableCrop();break;case"flip":disableFlip();break;default:}enableRotate();break;case"flip":switch($('#image_mode').val()){case"resize":disableResize();break;case"crop":disableCrop();break;case"rotate":disableRotate();break;default:}enableFlip();break;default:alert('Unexpected Operation!');return false}$('#image_mode').val(mode)}};function resetEditor(){if(isImageHistoryExist()){changeMode(true)}else{alert(warningResetEmpty)}return false};function enableCrop(){var widthField=$('#width');var heightField=$('#height');var topField=$('#y');var leftField=$('#x');var imageToResize=getImageElement();var imageWidth=$(imageToResize).attr('width');var imageHeight=$(imageToResize).attr('height');var overlay=$('#resizeMe');var imageContainer=$('#imageContainer');var imageContainerTop=parseInt($(imageContainer).css('top').replace('px',''));var imageContainerLeft=parseInt($(imageContainer).css('left').replace('px',''));$(imageContainer).css('width',imageWidth+'px');$(imageContainer).css('height',imageHeight+'px');$(imageToResize).css('opacity','.5');overlay.css('background-image','url('+$(imageToResize).attr('src')+')');overlay.css('width',imageWidth+'px');overlay.css('height',imageHeight+'px');widthField.val(imageWidth);heightField.val(imageHeight);topField.val(0);leftField.val(0);$(overlay).Resizable({minWidth:10,minHeight:10,maxWidth:imageWidth,maxHeight:imageHeight,minTop:imageContainerTop,minLeft:imageContainerLeft,maxRight:(parseInt(imageWidth)+imageContainerLeft),maxBottom:(parseInt(imageHeight)+imageContainerTop),dragHandle:true,onDrag:function(x,y){this.style.backgroundPosition='-'+(x-imageContainerLeft)+'px -'+(y-imageContainerTop)+'px';$(topField).val(Math.round(y-imageContainerTop));$(leftField).val(Math.round(x-imageContainerLeft));addImageHistory()},handlers:{se:'#resizeSE',e:'#resizeE',ne:'#resizeNE',n:'#resizeN',nw:'#resizeNW',w:'#resizeW',sw:'#resizeSW',s:'#resizeS'},onResize:function(size,position){this.style.backgroundPosition='-'+(position.left-imageContainerLeft)+'px -'+(position.top-imageContainerTop)+'px';$(widthField).val(Math.round(size.width));$(heightField).val(Math.round(size.height));$(topField).val(Math.round(position.top-imageContainerTop));$(leftField).val(Math.round(position.left-imageContainerLeft));addImageHistory();$('#ratio').val($(overlay).ResizableRatio())}});enableConstraint();toggleConstraint();disableRotate()};function disableCrop(){$('#resizeMe').ResizableDestroy();hideHandlers()};function disableResize(){$('#resizeMe').ResizableDestroy();hideHandlers()};function hideHandlers(){$('#resizeSE').hide();$('#resizeE').hide();$('#resizeNE').hide();$('#resizeN').hide();$('#resizeNW').hide();$('#resizeW').hide();$('#resizeSW').hide();$('#resizeS').hide()};function enableResize(constraint){hideHandlers();var imageToResize=getImageElement();var imageContainer=$('#imageContainer');var imageContainerTop=parseInt($(imageContainer).css('top').replace('px',''));var imageContainerLeft=parseInt($(imageContainer).css('left').replace('px',''));var resizeMe=$('#resizeMe');var width=$('#width');var height=$('#height');$(imageContainer).css('width',$(imageToResize).attr('width')+'px');$(imageContainer).css('height',$(imageToResize).attr('height')+'px');$(resizeMe).css('width',$(imageToResize).attr('width')+'px');$(resizeMe).css('height',$(imageToResize).attr('height')+'px');$('#width').val($(imageToResize).attr('width'));$('#height').val($(imageToResize).attr('height'));$('#x').val(0);$('#y').val(0);$(resizeMe).Resizable({minWidth:10,minHeight:10,maxWidth:2000,maxHeight:2000,minTop:imageContainerTop,minLeft:imageContainerLeft,maxRight:2000,maxBottom:2000,handlers:{s:'#resizeS',se:'#resizeSE',e:'#resizeE'},onResize:function(size){$(imageToResiLine truncated
|
||||
//image_editor_general.js end
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
function save(id, text)
|
||||
{
|
||||
jQuery('#text').val(text);
|
||||
jQuery('#save_as_request').val('0');
|
||||
jQuery('#name').val(currentName);
|
||||
jQuery('#folder').val(currentFolder);
|
||||
do_save(false);
|
||||
};
|
||||
function do_save(saveAsRequest)
|
||||
{
|
||||
jQuery('#windowProcessing').jqmShow();
|
||||
|
||||
var options =
|
||||
{
|
||||
dataType: 'json',
|
||||
error: function (data, status, e)
|
||||
{
|
||||
alert(e);
|
||||
},
|
||||
success: function(data)
|
||||
{
|
||||
if(typeof(data.error) == 'undefined')
|
||||
{
|
||||
alert('Unexpected information ');
|
||||
|
||||
if(typeof(saveAsRequest) == 'boolean' && saveAsRequest)
|
||||
{
|
||||
jQuery('#windowSaveAs').jqmShow();
|
||||
}
|
||||
}
|
||||
else if(data.error != '')
|
||||
{
|
||||
alert(data.error);
|
||||
jQuery('#windowProcessing').jqmHide();
|
||||
if(typeof(saveAsRequest) == 'boolean' && saveAsRequest)
|
||||
{
|
||||
jQuery('#windowSaveAs').jqmShow();
|
||||
}
|
||||
}else
|
||||
{
|
||||
jQuery('#windowProcessing').jqmHide();
|
||||
jQuery('#windowSaveAs').jqmHide();
|
||||
currentFolder = data.folder;
|
||||
currentName = data.name;
|
||||
}
|
||||
}
|
||||
};
|
||||
jQuery('#frmProcessing').ajaxSubmit(options);
|
||||
};
|
||||
function save_as(id, text)
|
||||
{
|
||||
|
||||
jQuery('#text').val(text);
|
||||
jQuery('#windowSaveAs').jqmShow();
|
||||
var saveTo = jQuery('#save_to');
|
||||
jQuery(saveTo).removeOption(/./);
|
||||
jQuery(saveTo).ajaxAddOption(urlGetFolderList, {}, false,
|
||||
function()
|
||||
{
|
||||
jQuery(saveTo).selectOptions(currentFolder);
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
function do_save_as()
|
||||
{
|
||||
var pattern=/^[A-Za-z0-9_ \-]+$/i;
|
||||
var newName = jQuery('#new_name');
|
||||
var saveAs = jQuery('#save_to').get(0);
|
||||
var ext = jQuery('#ext').get(0);
|
||||
if(!pattern.test(jQuery(newName).val()))
|
||||
{
|
||||
alert(warningInvalidName);
|
||||
}else if(saveAs.selectedIndex < 0)
|
||||
{
|
||||
alert(waringFolderNotSelected);
|
||||
}else if(ext.selectedIndex < 0)
|
||||
{
|
||||
alert(warningExtNotSelected);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
jQuery('#name').val(jQuery(newName).val() + "." + ext.options[ext.selectedIndex].value);
|
||||
jQuery('#folder').val(saveAs.options[saveAs.selectedIndex].value);
|
||||
jQuery('#save_as_request').val('1');
|
||||
jQuery('#windowSaveAs').jqmHide();
|
||||
do_save(true);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
//jquery.js. start
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7(1g 18.6=="I"){18.I=18.I;u 6=q(a,c){7(18==9||!9.3X)v 14 6(a,c);v 9.3X(a,c)};7(1g $!="I")6.1I$=$;u $=6;6.11=6.8r={3X:q(a,c){a=a||P;7(6.16(a))v 14 6(P)[6.11.1G?"1G":"1W"](a);7(1g a=="1s"){u m=/^[^<]*(<(.|\\s)+>)[^>]*$/.1V(a);7(m)a=6.31([m[1]]);B v 14 6(c).1L(a)}v 9.4E(a.15==2b&&a||(a.3C||a.C&&a!=18&&!a.1q&&a[0]!=I&&a[0].1q)&&6.2L(a)||[a])},3C:"1.1.3.1",7W:q(){v 9.C},C:0,1M:q(a){v a==I?6.2L(9):9[a]},1Z:q(a){u b=6(a);b.5q=9;v b},4E:q(a){9.C=0;[].R.O(9,a);v 9},F:q(a,b){v 6.F(9,a,b)},2p:q(a){u b=-1;9.F(q(i){7(9==a)b=i});v b},1b:q(f,d,e){u c=f;7(f.15==33)7(d==I)v 9.C&&6[e||"1b"](9[0],f)||I;B{c={};c[f]=d}v 9.F(q(a){E(u b V c)6.1b(e?9.T:9,b,6.4H(9,c[b],e,a,b))})},1f:q(b,a){v 9.1b(b,a,"2z")},2A:q(e){7(1g e=="1s")v 9.2Y().3e(P.66(e));u t="";6.F(e||9,q(){6.F(9.2S,q(){7(9.1q!=8)t+=9.1q!=1?9.5R:6.11.2A([9])})});v t},8b:q(){u a,1S=19;v 9.F(q(){7(!a)a=6.31(1S,9.2O);u b=a[0].3s(K);9.L.2K(b,9);1v(b.1d)b=b.1d;b.4g(9)})},3e:q(){v 9.2F(19,K,1,q(a){9.4g(a)})},5w:q(){v 9.2F(19,K,-1,q(a){9.2K(a,9.1d)})},5t:q(){v 9.2F(19,N,1,q(a){9.L.2K(a,9)})},5s:q(){v 9.2F(19,N,-1,q(a){9.L.2K(a,9.1X)})},2U:q(){v 9.5q||6([])},1L:q(t){u b=6.3k(9,q(a){v 6.1L(t,a)});v 9.1Z(/[^+>] [^+>]/.17(t)||t.J("..")>-1?6.5g(b):b)},7x:q(e){u d=9.1A(9.1L("*"));d.F(q(){9.1I$1a={};E(u a V 9.$1a)9.1I$1a[a]=6.1c({},9.$1a[a])}).3U();u r=9.1Z(6.3k(9,q(a){v a.3s(e!=I?e:K)}));d.F(q(){u b=9.1I$1a;E(u a V b)E(u c V b[a])6.S.1A(9,a,b[a][c],b[a][c].W);9.1I$1a=H});v r},1i:q(t){v 9.1Z(6.16(t)&&6.2s(9,q(b,a){v t.O(b,[a])})||6.2x(t,9))},4Y:q(t){v 9.1Z(t.15==33&&6.2x(t,9,K)||6.2s(9,q(a){v(t.15==2b||t.3C)?6.2w(a,t)<0:a!=t}))},1A:q(t){v 9.1Z(6.1T(9.1M(),t.15==33?6(t).1M():t.C!=I&&(!t.Q||t.Q=="6Z")?t:[t]))},37:q(a){v a?6.2x(a,9).C>0:N},6R:q(a){v a==I?(9.C?9[0].2v:H):9.1b("2v",a)},3F:q(a){v a==I?(9.C?9[0].27:H):9.2Y().3e(a)},2F:q(f,d,g,e){u c=9.C>1,a;v 9.F(q(){7(!a){a=6.31(f,9.2O);7(g<0)a.6E()}u b=9;7(d&&6.Q(9,"1r")&&6.Q(a[0],"2V"))b=9.3R("1z")[0]||9.4g(P.5h("1z"));6.F(a,q(){e.O(b,[c?9.3s(K):9])})})}};6.1c=6.11.1c=q(){u c=19[0],a=1;7(19.C==1){c=9;a=0}u b;1v((b=19[a++])!=H)E(u i V b)c[i]=b[i];v c};6.1c({6n:q(){7(6.1I$)$=6.1I$;v 6},16:q(a){v!!a&&1g a!="1s"&&!a.Q&&a.15!=2b&&/q/i.17(a+"")},40:q(a){v a.4z&&a.2O&&!a.2O.4y},Q:q(b,a){v b.Q&&b.Q.1D()==a.1D()},F:q(a,b,c){7(a.C==I)E(u i V a)b.O(a[i],c||[i,a[i]]);B E(u i=0,4x=a.C;i<4x;i++)7(b.O(a[i],c||[i,a[i]])===N)1F;v a},4H:q(c,b,d,e,a){7(6.16(b))b=b.3D(c,[e]);u f=/z-?2p|5Y-?8p|1e|5U|8i-?1u/i;v b&&b.15==3y&&d=="2z"&&!f.17(a)?b+"4o":b},12:{1A:q(b,c){6.F(c.2R(/\\s+/),q(i,a){7(!6.12.3w(b.12,a))b.12+=(b.12?" ":"")+a})},1E:q(b,c){b.12=c!=I?6.2s(b.12.2R(/\\s+/),q(a){v!6.12.3w(c,a)}).5M(" "):""},3w:q(t,c){v 6.2w(c,(t.12||t).3v().2R(/\\s+/))>-1}},4m:q(e,o,f){E(u i V o){e.T["2N"+i]=e.T[i];e.T[i]=o[i]}f.O(e,[]);E(u i V o)e.T[i]=e.T["2N"+i]},1f:q(e,p){7(p=="1u"||p=="29"){u b={},3r,3p,d=["83","81","80","7Y"];6.F(d,q(){b["7V"+9]=0;b["7T"+9+"7S"]=0});6.4m(e,b,q(){7(6(e).37(\':4f\')){3r=e.7Q;3p=e.7O}B{e=6(e.3s(K)).1L(":4b").5v("2B").2U().1f({48:"1y",3i:"7L",U:"2h",7K:"0",7I:"0"}).5o(e.L)[0];u a=6.1f(e.L,"3i")||"3n";7(a=="3n")e.L.T.3i="7G";3r=e.7E;3p=e.7D;7(a=="3n")e.L.T.3i="3n";e.L.3q(e)}});v p=="1u"?3r:3p}v 6.2z(e,p)},2z:q(e,a,d){u g;7(a=="1e"&&6.M.1h){g=6.1b(e.T,"1e");v g==""?"1":g}7(a.3t(/3x/i))a=6.1U;7(!d&&e.T[a])g=e.T[a];B 7(P.3f&&P.3f.3Y){7(a.3t(/3x/i))a="3x";a=a.1o(/([A-Z])/g,"-$1").2H();u b=P.3f.3Y(e,H);7(b)g=b.57(a);B 7(a=="U")g="1P";B 6.4m(e,{U:"2h"},q(){u c=P.3f.3Y(9,"");g=c&&c.57(a)||""})}B 7(e.3S){u f=a.1o(/\\-(\\w)/g,q(m,c){v c.1D()});g=e.3S[a]||e.3S[f]}v g},31:q(a,c){u r=[];c=c||P;6.F(a,q(i,b){7(!b)v;7(b.15==3y)b=b.3v();7(1g b=="1s"){u s=6.2C(b).2H(),1x=c.5h("1x"),1N=[];u a=!s.J("<1H")&&[1,"<2y>","</2y>"]||!s.J("<7g")&&[1,"<52>","</52>"]||(!s.J("<7c")||!s.J("<1z")||!s.J("<7a")||!s.J("<78"))&&[1,"<1r>","</1r>"]||!s.J("<2V")&&[2,"<1r><1z>","</1z></1r>"]||(!s.J("<75")||!s.J("<74"))&&[3,"<1r><1z><2V>","</2V></1z></1r>"]||!s.J("<73")&&[2,"<1r><4W>","</4W></1r>"]||[0,"",""];1x.27=a[1]+b+a[2];1v(a[0]--)1x=1x.1d;7(6.M.1h){7(!s.J("<1r")&&s.J("<1z")<0)1N=1x.1d&&1x.1d.2S;B 7(a[1]=="<1r>"&&s.J("<1z")<0)1N=1x.2S;E(u n=1N.C-1;n>=0;--n)7(6.Q(1N[n],"1z")&&!1N[n].2S.C)1N[n].L.3q(1N[n])}b=6.2L(1x.2S)}7(0===b.C&&(!6.Q(b,"34")&&!6.Q(b,"2y")))v;7(b[0]==I||6.Q(b,"34")||b.71)r.R(b);B r=6.1T(r,b)});v r},1b:q(c,d,a){u e=6.40(c)?{}:6.3H;7(e[d]){7(a!=I)c[e[d]]=a;v c[e[d]]}B 7(a==I&&6.M.1h&&6.Q(c,"34")&&(d=="70"||d=="6Y"))v c.6W(d).5R;B 7(c.4z){7(a!=I)c.6U(d,a);7(6.M.1h&&/4M|2u/.17(d)&&!6.40(c))v c.35(d,2);v c.35(d)}B{7(d=="1e"&&6.M.1h){7(a!=I){c.5U=1;c.1i=(c.1i||"").1o(/4L\\([^)]*\\)/,"")+(39(a).3v()=="6M"?"":"4L(1e="+a*4X+")")}v c.1i?(39(c.1i.3t(/1e=([^)]*)/)[1])/4X).3v():""}d=d.1o(/-([a-z])/6K,q(z,b){v b.1D()});7(a!=I)c[d]=a;v c[d]}},2C:q(t){v t.1Line truncated
|
||||
//form.js start
|
||||
(function($){$.fn.ajaxSubmit=function(o){if(typeof o=='function')o={success:o};o=$.extend({url:this.attr('action')||window.location,type:this.attr('method')||'GET'},o||{});var a=this.formToArray(o.semantic);if(o.beforeSubmit&&o.beforeSubmit(a,this,o)===false)return this;var p={};$.event.trigger('form.submit.validate',[a,this,o,p]);if(p.veto)return this;var q=$.param(a);if(o.type.toUpperCase()=='GET'){o.url+=(o.url.indexOf('?')>=0?'&':'?')+q;o.data=null}else o.data=q;var r=this,callbacks=[];if(o.resetForm)callbacks.push(function(){r.resetForm()});if(o.clearForm)callbacks.push(function(){r.clearForm()});if(!o.dataType&&o.target){var u=o.success;callbacks.push(function(a){$(o.target).attr("innerHTML",a).evalScripts().each(u,arguments)})}else if(o.success)callbacks.push(o.success);o.success=function(a,b){for(var i=0,max=callbacks.length;i<max;i++)callbacks[i](a,b,r)};var v=$('input:file',this).fieldValue();var w=false;for(var j=0;j<v.length;j++)if(v[j])w=true;if(o.iframe||w)fileUpload();else $.ajax(o);$.event.trigger('form.submit.notify',[this,o]);return this;function fileUpload(){var d=r[0];var f=$.extend({},$.ajaxSettings,o);var h='jqFormIO'+$.fn.ajaxSubmit.counter++;var i=$('<iframe id="'+h+'" name="'+h+'" />');var j=i[0];var k=$.browser.opera&&window.opera.version()<9;if($.browser.msie||k)j.src='javascript:false;document.write("");';i.css({position:'absolute',top:'-1000px',left:'-1000px'});var l={responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=f.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[l,f]);var m=0;var n=0;setTimeout(function(){i.appendTo('body');j.attachEvent?j.attachEvent('onload',cb):j.addEventListener('load',cb,false);var a=d.encoding?'encoding':'enctype';var t=r.attr('target');r.attr({target:h,method:'POST',encAttr:'multipart/form-data',action:f.url});if(f.timeout)setTimeout(function(){n=true;cb()},f.timeout);d.submit();r.attr('target',t)},10);function cb(){if(m++)return;j.detachEvent?j.detachEvent('onload',cb):j.removeEventListener('load',cb,false);var a=true;try{if(n)throw'timeout';var b,doc;doc=j.contentWindow?j.contentWindow.document:j.contentDocument?j.contentDocument:j.document;l.responseText=doc.body?doc.body.innerHTML:null;l.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(f.dataType=='json'||f.dataType=='script'){var c=doc.getElementsByTagName('textarea')[0];b=c?c.value:l.responseText;if(f.dataType=='json')eval("data = "+b);else $.globalEval(b)}else if(f.dataType=='xml'){b=l.responseXML;if(!b&&l.responseText!=null)b=toXml(l.responseText)}else{b=l.responseText}}catch(e){a=false;$.handleError(f,l,'error',e)}if(a){f.success(b,'success');if(g)$.event.trigger("ajaxSuccess",[l,f])}if(g)$.event.trigger("ajaxComplete",[l,f]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(f.complete)f.complete(l,a?'success':'error');setTimeout(function(){i.remove();l.responseXML=null},100)};function toXml(s,a){if(window.ActiveXObject){a=new ActiveXObject('Microsoft.XMLDOM');a.async='false';a.loadXML(s)}else a=(new DOMParser()).parseFromString(s,'text/xml');return(a&&a.documentElement&&a.documentElement.tagName!='parsererror')?a:null}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(a){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=a;$(":submit,input:image",this).click(clickHandler)})};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var a=this.form;a.clk=this;if(this.type=='image'){if(e.offsetX!=undefined){a.clk_x=e.offsetX;a.clk_y=e.offsetY}else if(typeof $.fn.offset=='function'){var b=$(this).offset();a.clk_x=e.pageX-b.left;a.clk_y=e.pageY-b.top}else{a.clk_x=e.pageX-this.offsetLeft;a.clk_y=e.pageY-this.offsetTop}}setTimeout(function(){a.clk=a.clk_x=a.clk_y=null},10)};function submitHandler(){var a=this.formPluginId;var b=$.fn.ajaxForm.optionHash[a];$(this).ajaxSubmit(b);return false};$.fn.ajaxFormUnbind=function(){this.unbind('submit',submitHandler);return this.each(function(){$(":submit,input:image",this).unbind('click',clickHandler)})};$.fn.formToArray=function(b){var a=[];if(this.length==0)return a;var c=this[0];var d=b?c.getElementsByTagName('*'):c.elements;if(!d)return a;for(var i=0,max=d.length;i<max;i++){var e=d[i];var n=e.name;if(!n)continue;if(b&&c.clk&&e.type=="image"){if(!e.disabled&&c.clk==e)a.push({name:n+'.x',value:c.clk_x},{name:n+'.y',value:c.clk_y});continue}var v=$.fieldValue(e,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)a.push({name:n,value:v[j]})}else if(v!==null&&typeof v!='undefined')a.push({name:n,value:v})}if(!b&&c.clk){var f=c.getElementsByTagName("input");for(var i=0,max=f.length;i<max;i++){var g=f[i];var n=g.name;if(n&&!g.disabled&&g.type=="image"&&c.clk==g)a.push({name:n+'.x',value:c.clk_x},{name:n+'.y',value:c.clk_y})}}return a};$.fn.formSerialize=function(a){retuLine truncated
|
||||
//form.js end
|
||||
//select.js start
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.u.G=6(){4 e=6(a,v,t,b){4 c=P.Q("R");c.j=v,c.C=t;4 o=a.x;4 d=o.l;3(!a.n){a.n={};p(4 i=0;i<d;i++){a.n[o[i].j]=i}}3(8 a.n[v]=="M")a.n[v]=d;a.x[a.n[v]]=c;3(b){c.k=9}};4 a=N;3(a.l==0)7 5;4 f=9;4 m=q;4 g,v,t;3(8(a[0])=="z"){m=9;g=a[0]}3(a.l>=2){3(8(a[1])=="H")f=a[1];h 3(8(a[2])=="H")f=a[2];3(!m){v=a[0];t=a[1]}}5.y(6(){3(5.A.s()!="B")7;3(m){p(4 a S g){e(5,a,g[a],f)}}h{e(5,v,t,f)}});7 5};$.u.T=6(b,c,d,e,f){3(8(b)!="D")7 5;3(8(c)!="z")c={};3(8(d)!="H")d=9;5.y(6(){4 a=5;$.U(b,c,6(r){$(a).G(r,d);3(8 e=="6"){3(8 f=="z"){e.V(a,f)}h{e.I(a)}}})});7 5};$.u.W=6(){4 a=N;3(a.l==0)7 5;4 d=8(a[0]);4 v,i;3(d=="D"||d=="z"||d=="6")v=a[0];h 3(d=="X")i=a[0];h 7 5;5.y(6(){3(5.A.s()!="B")7;3(5.n)5.n=O;4 b=q;4 o=5.x;3(!!v){4 c=o.l;p(4 i=c-1;i>=0;i--){3(v.J==K){3(o[i].j.L(v)){b=9}}h 3(o[i].j==v){b=9}3(b&&a[1]===9)b=o[i].k;3(b){o[i]=O}b=q}}h{3(b&&a[1]===9)b=o[i].k;3(b){5.Y(i)}}});7 5};$.u.Z=6(f){4 a=8(f)=="M"?9:!!f;5.y(6(){3(5.A.s()!="B")7;4 o=5.x;4 d=o.l;4 e=[];p(4 i=0;i<d;i++){e[i]={v:o[i].j,t:o[i].C}}e.10(6(b,c){E=b.t.s(),F=c.t.s();3(E==F)7 0;3(a){7 E<F?-1:1}h{7 E>F?-1:1}});p(4 i=0;i<d;i++){o[i].C=e[i].t;o[i].j=e[i].v}});7 5};$.u.11=6(b,d){4 v=b;4 e=8(b);4 c=d||q;3(e!="D"&&e!="6"&&e!="z")7 5;5.y(6(){3(5.A.s()!="B")7 5;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(v.J==K){3(o[i].j.L(v)){o[i].k=9}h 3(c){o[i].k=q}}h{3(o[i].j==v){o[i].k=9}h 3(c){o[i].k=q}}}});7 5};$.u.12=6(b,c){4 w=c||"k";3($(b).13()==0)7 5;5.y(6(){3(5.A.s()!="B")7 5;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(w=="14"||(w=="k"&&o[i].k)){$(b).G(o[i].j,o[i].C)}}});7 5};$.u.15=6(b,c){4 d=q;4 v=b;4 e=8(v);4 f=8(c);3(e!="D"&&e!="6"&&e!="z")7 f=="6"?5:d;5.y(6(){3(5.A.s()!="B")7 5;3(d&&f!="6")7 q;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(v.J==K){3(o[i].j.L(v)){d=9;3(f=="6")c.I(o[i])}}h{3(o[i].j==v){d=9;3(f=="6")c.I(o[i])}}}});7 f=="6"?5:d}})(16);',62,69,'|||if|var|this|function|return|typeof|true||||||||else||value|selected|length||cache||for|false||toLowerCase||fn|||options|each|object|nodeName|select|text|string|o1t|o2t|addOption|boolean|call|constructor|RegExp|match|undefined|arguments|null|document|createElement|option|in|ajaxAddOption|getJSON|apply|removeOption|number|remove|sortOptions|sort|selectOptions|copyOptions|size|all|containsOption|jQuery'.split('|'),0,{}));
|
||||
//select.js end
|
||||
//jqmodal.js start
|
||||
(function($){$.fn.jqm=function(o){var a={zIndex:3000,overlay:50,overlayClass:'jqmOverlay',closeClass:'jqmClose',trigger:'.jqModal',ajax:false,target:false,modal:false,onShow:false,onHide:false,onLoad:false};return this.each(function(){if(this._jqm)return;s++;this._jqm=s;H[s]={c:$.extend(a,o),a:false,w:$(this).addClass('jqmID'+s),s:s};if(a.trigger)$(this).jqmAddTrigger(a.trigger)})};$.fn.jqmAddClose=function(e){hs(this,e,'jqmHide');return this};$.fn.jqmAddTrigger=function(e){hs(this,e,'jqmShow');return this};$.fn.jqmShow=function(t){return this.each(function(){if(!H[this._jqm].a)$.jqm.open(this._jqm,t)})};$.fn.jqmHide=function(t){return this.each(function(){if(H[this._jqm].a)$.jqm.close(this._jqm,t)})};$.jqm={hash:{},open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(/^\d+$/.test(h.w.css('z-index')))?h.w.css('z-index'):c.zIndex,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});h.t=t;h.a=true;h.w.css('z-index',z);if(c.modal){if(!A[0])F('bind');A.push(s);o.css('cursor','wait')}else if(c.overlay>0)h.w.jqmAddClose(o);else o=false;h.o=(o)?o.addClass(c.overlayClass).appendTo('body'):false;if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in{Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'")}}if(c.ajax){var r=c.target,u=c.ajax;r=(r)?(typeof r=='string')?$(r,h.w):$(r):h.w;u=(u.substr(0,1)=='@')?$(t).attr(u.substring(1)):u;r.load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h)})}else if(cc)h.w.jqmAddClose($(cc,h.w));(c.onShow)?c.onShow(h):h.w.show();e(h);return false},close:function(s){var h=H[s];h.a=false;if(A[0]){A.pop();if(!A[0])F('unbind')}if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove()}return false}};var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&typeof XMLHttpRequest=='function',i=$('<iframe class="jqm"></iframe>').css({opacity:0}),e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i);f(h)},f=function(h){h.f=$(':input:visible:first',h.w)[0];if(h.f)h.f.focus()},F=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m)},m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return!r},hs=function(w,e,y){var s=[];w.each(function(){s.push(this._jqm)});$(e).each(function(){if(this[y])$.extend(this[y],s);else{this[y]=s;$(this).click(function(){for(var i in{jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return false})}})}})(jQuery);
|
||||
//jqModal.js end
|
||||
//ajax_text_editor_general.js start
|
||||
function save(id,text){jQuery('#text').val(text);jQuery('#save_as_request').val('0');jQuery('#name').val(currentName);jQuery('#folder').val(currentFolder);do_save(false)};function do_save(saveAsRequest){jQuery('#windowProcessing').jqmShow();var options={dataType:'json',error:function(data,status,e){alert(e)},success:function(data){if(typeof(data.error)=='undefined'){alert('Unexpected information ');if(typeof(saveAsRequest)=='boolean'&&saveAsRequest){jQuery('#windowSaveAs').jqmShow()}}else if(data.error!=''){alert(data.error);jQuery('#windowProcessing').jqmHide();if(typeof(saveAsRequest)=='boolean'&&saveAsRequest){jQuery('#windowSaveAs').jqmShow()}}else{jQuery('#windowProcessing').jqmHide();jQuery('#windowSaveAs').jqmHide();currentFolder=data.folder;currentName=data.name}}};jQuery('#frmProcessing').ajaxSubmit(options)};function save_as(id,text){jQuery('#text').val(text);jQuery('#windowSaveAs').jqmShow();var saveTo=jQuery('#save_to');jQuery(saveTo).removeOption(/./);jQuery(saveTo).ajaxAddOption(urlGetFolderList,{},false,function(){jQuery(saveTo).selectOptions(currentFolder)})};function do_save_as(){var pattern=/^[A-Za-z0-9_ \-]+$/i;var newName=jQuery('#new_name');var saveAs=jQuery('#save_to').get(0);var ext=jQuery('#ext').get(0);if(!pattern.test(jQuery(newName).val())){alert(warningInvalidName)}else if(saveAs.selectedIndex<0){alert(waringFolderNotSelected)}else if(ext.selectedIndex<0){alert(warningExtNotSelected)}else{jQuery('#name').val(jQuery(newName).val()+"."+ext.options[ext.selectedIndex].value);jQuery('#folder').val(saveAs.options[saveAs.selectedIndex].value);jQuery('#save_as_request').val('1');jQuery('#windowSaveAs').jqmHide();do_save(true)}return false};
|
||||
//ajax_text_editor_general.js end
|
||||
@@ -1,6 +0,0 @@
|
||||
/* MarcGrabanski.com v2.7 */
|
||||
/* Pop-Up Calendar Built from Scratch by Marc Grabanski */
|
||||
/* Enhanced by Keith Wood (kbwood@iprimus.com.au). */
|
||||
/* Under the Creative Commons Licence http://creativecommons.org/licenses/by/3.0/
|
||||
Share or Remix it but please Attribute the authors. */
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('I 2m(){8.3t=0;8.2h=[];8.1L=O;8.1i=[];8.1t=X;8.1v=X;8.2g=[];8.2g[\'\']={2Q:\'5R\',3R:\'5p\',2u:\'&58;51\',2H:\'4D&4z;\',3d:\'4t\',2k:[\'4o\',\'4k\',\'4g\',\'4a\',\'5P\',\'5G\',\'5D\'],3O:[\'5o\',\'5l\',\'5j\',\'5d\',\'57\',\'56\',\'50\',\'4V\',\'4P\',\'4J\',\'4C\',\'4A\'],1R:\'4x/\'};8.1E={3f:\'1z\',3c:\'\',31:\'...\',30:\'\',2W:X,2U:1c,2R:X,2P:1c,2N:1c,2K:\'-10:+10\',2I:0,3Z:1c,3W:X,28:O,26:O,1J:\'5u\',3M:O,3K:O,2w:O};$.14(8.1E,8.2g[\'\']);8.S=$(\'<V 3A="3y"></V>\');$(1d.1r).1K(8.S);$(1d.1r).55(8.3F)}$.14(2m.3I,{3q:I(a){F b=8.3t++;8.2h[b]=a;N b},U:I(a){N 8.2h[a]||a},4F:I(a){$.14(8.1E,a||{})},2p:I(e){F a=G.U(8.1g);H(G.1t){4y(e.2l){1a 9:G.1q(a,\'\');11;1a 13:G.1P(a);11;1a 27:G.1q(a,a.J(\'1J\'));11;1a 33:G.T(a,-1,(e.1j?\'Y\':\'M\'));11;1a 34:G.T(a,+1,(e.1j?\'Y\':\'M\'));11;1a 35:H(e.1j)G.2y(a);11;1a 36:H(e.1j)G.2B(a);11;1a 37:H(e.1j)G.T(a,-1,\'D\');11;1a 38:H(e.1j)G.T(a,-7,\'D\');11;1a 39:H(e.1j)G.T(a,+1,\'D\');11;1a 40:H(e.1j)G.T(a,+7,\'D\');11}}19 H(e.2l==36&&e.1j){G.1A(8)}},2J:I(e){F a=G.U(8.1g);F b=45.5N(e.43==5K?e.2l:e.43);N(b<\' \'||b==a.J(\'1R\').1k(3)||(b>=\'0\'&&b<=\'9\'))},3U:I(a,b){F c=$(a);F d=b.J(\'3c\');H(d){c.3Q(\'<1F K="5v">\'+d+\'</1F>\')}F e=b.J(\'3f\');H(e==\'1z\'||e==\'2r\'){c.1z(8.1A)}H(e==\'1x\'||e==\'2r\'){F f=b.J(\'31\');F g=b.J(\'30\');F h=b.J(\'2W\');F i=$(h?\'<20 K="1s" 2v="\'+g+\'" 3E="\'+f+\'" 3C="\'+f+\'"/>\':\'<1x 2a="1x" K="1s">\'+(g!=\'\'?\'<20 2v="\'+g+\'" 3E="\'+f+\'" 3C="\'+f+\'"/>\':f)+\'</1x>\');c.5i(\'<1F K="5h"></1F>\').3Q(i);i.5f(8.1A)}c.3z(8.2p).5c(8.2J);c[0].1g=b.R},3w:I(a,b){$(a).1K(b.S);a.1g=b.R;F c=P W();b.17=c.16();b.Q=c.1b();b.L=c.15();G.T(b)},53:I(a,b,c,d){F e=8.3r;H(!e){e=8.3r=P 1H({},X);8.1m=$(\'<1I 2a="4U" 4S="1" 3N="2C: 2q; 25: -3X;"/>\');8.1m.3z(8.2p);$(\'1r\').1K(8.1m);8.1m[0].1g=e.R}$.14(e.1l,c||{});8.1m.2G(a);H(2F.41){1W=2F.4B;1V=2F.41}19 H(1d.1U&&1d.1U.2o){1W=1d.1U.3m;1V=1d.1U.2o}19 H(1d.1r){1W=1d.1r.3m;1V=1d.1r.2o}8.1h=d||[(1W/2)-3l,(1V/2)-3l];8.1m.18(\'2n\',8.1h[0]+\'1S\').18(\'25\',8.1h[1]+\'1S\');e.1l.2w=b;8.1v=1c;8.S.3k(\'3j\');8.1A(8.1m[0]);H($.1C){$.1C(8.S)}},4w:I(c){c=(c.3i?c:$(c));c.1D(I(){8.1Q=X;$(\'../1x.1s\',8).1D(I(){8.1Q=X});$(\'../20.1s\',8).18({3h:\'1.0\',3g:\'\'});F b=8;G.1i=$.3e(G.1i,I(a){N(a==b?O:a)})})},4v:I(c){c=(c.3i?c:$(c));c.1D(I(){8.1Q=1c;$(\'../1x.1s\',8).1D(I(){8.1Q=1c});$(\'../20.1s\',8).18({3h:\'0.5\',3g:\'4u\'});F b=8;G.1i=$.3e(G.1i,I(a){N(a==b?O:a)});G.1i[G.1i.1B]=8})},4s:I(a,b){F c=8.U(a.1g);H(c){$.14(c.1l,b||{});8.1w(c)}},4r:I(a,b){F c=8.U(a.1g);H(c){c.3b(b)}},4q:I(a){F b=8.U(a.1g);N(b?b.3a():O)},1A:I(a){F b=(a.1O&&a.1O.2j()==\'1I\'?a:8);H(b.1O.2j()!=\'1I\'){b=$(\'1I\',b.4p)[0]}H(G.2i==b){N}1f(F i=0;i<G.1i.1B;i++){H(G.1i[i]==b){N}}F c=G.U(b.1g);G.1q(c,\'\');G.2i=b;c.2Z(b);H(G.1v){b.24=\'\'}H(!G.1h){G.1h=G.2Y(b);G.1h[1]+=b.3H}c.S.18(\'2C\',(G.1v&&$.1C?\'4n\':\'2q\')).18(\'2n\',G.1h[0]+\'1S\').18(\'25\',G.1h[1]+\'1S\');G.1h=O;F d=c.J(\'3K\');$.14(c.1l,(d?d(b):{}));G.2V(c)},2V:I(a){F b=8.U(a);G.1w(b);H(!b.1G){F c=b.J(\'1J\');b.S.4m(c,I(){G.1t=1c;G.2f(b)});H(c==\'\'){G.1t=1c;G.2f(b)}H(b.Z[0].2a!=\'2e\'){b.Z[0].1z()}8.1L=b}},1w:I(a){a.S.4l().1K(a.2T());H(a.Z&&a.Z!=\'2e\'){a.Z[0].1z()}},2f:I(a){H($.2d.2D){$(\'#2S\').18({4j:a.S[0].4i+4,4h:a.S[0].3H+4})}},1q:I(a,b){F c=8.U(a);H(G.1t){b=(b!=O?b:c.J(\'1J\'));c.S.4f(b,I(){G.2E(c)});H(b==\'\'){G.2E(c)}G.1t=X;G.2i=O;c.1l.2O=O;H(G.1v){G.1m.18(\'2C\',\'2q\').18(\'2n\',\'4e\').18(\'25\',\'-3X\');H($.1C){$.4d();$(\'1r\').1K(8.S)}}G.1v=X}G.1L=O},2E:I(a){a.S.2M(\'3j\');$(\'.2L\',a.S).4b()},3F:I(a){H(!G.1L){N}F b=$(a.49);H((b.48("#3y").1B==0)&&(b.47(\'K\')!=\'1s\')&&G.1t&&!(G.1v&&$.1C)){G.1q(G.1L,\'\')}},T:I(a,b,c){F d=8.U(a);d.T(b,c);8.1w(d)},2B:I(a){F b=P W();F c=8.U(a);c.17=b.16();c.Q=b.1b();c.L=b.15();8.T(c)},2b:I(a,b,c){F d=8.U(a);d.1M=X;d[c==\'M\'?\'Q\':\'L\']=b.46[b.4c].24-0;8.T(d)},2c:I(a){F b=8.U(a);H(b.Z&&b.1M&&!$.2d.2D){b.Z[0].1z()}b.1M=!b.1M},44:I(b,a){F c=8.U(b);F d=c.J(\'2k\');F e=a.5M.5L;1f(F i=0;i<7;i++){H(d[i]==e){c.1l.2I=i;11}}8.1w(c)},42:I(a,b){F c=8.U(a);c.17=$("a",b).5J();8.1P(a)},2y:I(a){8.1P(a,\'\')},1P:I(a,b){F c=8.U(a);b=(b!=O?b:c.3Y());H(c.Z){c.Z.2G(b)}F d=c.J(\'2w\');H(d){d(b)}19{c.Z.5I(\'5H\')}H(c.1G){8.1w(c)}19{8.1q(c,c.J(\'1J\'))}},5F:I(a){F b=a.3V();N[(b>0&&b<6),\'\']},2Y:I(a){H(a.2a==\'2e\'){a=a.5E}F b=1N=0;H(a.3T){b=a.3S;1N=a.2X;5B(a=a.3T){F c=b;b+=a.3S;H(b<0){b=c}1N+=a.2X}}N[b,1N]}});I 1H(a,b){8.R=G.3q(8);8.17=0;8.Q=0;8.L=0;8.Z=O;8.1G=b;8.S=(!b?G.S:$(\'<V 3A="5A\'+8.R+\'" K="5z"></V>\'));H(b){F c=P W();8.1n=c.16();8.1o=c.1b();8.1p=c.15()}8.1l=$.14({},a||{})}$.14(1H.3I,{J:I(a){N(8.1l[a]!=O?8.1l[a]:G.1E[a])},2Z:I(a){8.Z=$(a);F b=8.J(\'1R\');F c=8.Z.2G().3P(b.1k(3));H(c.1B==3){8.1n=1u(c[b.2A(\'D\')],10);8.1o=1u(c[b.2A(\'M\')],10)-1;8.1p=1uLine truncated
|
||||
@@ -1 +0,0 @@
|
||||
(function($){var menu,shadow,trigger,content,hash,currentTarget;var defaults={menuStyle:{width:'100px'},itemStyle:{},itemHoverStyle:{},eventPosX:'pageX',eventPosY:'pageY',shadow:true,onContextMenu:null,onShowMenu:null};$.fn.contextMenu=function(id,options){if(!menu){menu=$('<div id="jqContextMenu"></div>').hide().css({position:'absolute',zIndex:'500'}).appendTo('body').bind('click',function(e){e.stopPropagation()})}if(!shadow){shadow=$('<div></div>').css({zIndex:499}).appendTo('body').hide()}hash=hash||[];hash.push({id:id,menuStyle:$.extend({},defaults.menuStyle,options.menuStyle||{}),itemStyle:$.extend({},defaults.itemStyle,options.itemStyle||{}),itemHoverStyle:$.extend({},defaults.itemHoverStyle,options.itemHoverStyle||{}),bindings:options.bindings||{},shadow:options.shadow||options.shadow===false?options.shadow:defaults.shadow,onContextMenu:options.onContextMenu||defaults.onContextMenu,onShowMenu:options.onShowMenu||defaults.onShowMenu,eventPosX:options.eventPosX||defaults.eventPosX,eventPosY:options.eventPosY||defaults.eventPosY});var index=hash.length-1;$(this).bind('contextmenu',function(e){var bShowContext=(!!hash[index].onContextMenu)?hash[index].onContextMenu(e):true;if(bShowContext)display(index,this,e,options);return false});return this};function display(index,trigger,e,options){var cur=hash[index];content=$('#'+cur.id).find('ul:first').clone(true);content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover(function(){$(this).css(cur.itemHoverStyle)},function(){$(this).css(cur.itemStyle)}).find('img').css({verticalAlign:'middle',paddingRight:'2px'});menu.html(content);if(!!cur.onShowMenu)menu=cur.onShowMenu(e,menu);$.each(cur.bindings,function(id,func){$('#'+id,menu).bind('click',function(e){hide();func(trigger,currentTarget)})});menu.css({'left':e[cur.eventPosX],'top':e[cur.eventPosY]}).show();if(cur.shadow)shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2,top:e.pageY+2}).show();$(document).one('click',hide)}function hide(){menu.hide();shadow.hide()}$.contextMenu={defaults:function(userDefaults){$.each(userDefaults,function(i,val){if(typeof val=='object'&&defaults[i]){$.extend(defaults[i],val)}else defaults[i]=val})}}})(jQuery);$(function(){$('div.contextMenu').hide()});
|
||||
@@ -1,352 +0,0 @@
|
||||
body, html{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
body, html, table, form, textarea{
|
||||
font: 12px monospace, sans-serif;
|
||||
}
|
||||
|
||||
#editor{
|
||||
border: solid #888888 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#result{
|
||||
z-index: 4;
|
||||
overflow: scroll;
|
||||
border-top: solid #888888 1px;
|
||||
border-bottom: solid #888888 1px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#container{
|
||||
overflow: hidden;
|
||||
/*height: 100px;*/
|
||||
border: solid blue 0px;
|
||||
position: relative;
|
||||
padding: 0 5px 0px 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
#textarea{
|
||||
position: relative;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
padding: 0px 0px 0px 45px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
/*position: absolute;*/
|
||||
overflow: hidden;
|
||||
z-index: 7;
|
||||
border: solid green 0px;
|
||||
/* background: none;
|
||||
background-color: transparent;*/
|
||||
}
|
||||
|
||||
#content_highlight{
|
||||
white-space: pre;
|
||||
/*background-color: #FFFFFF;*/
|
||||
padding: 1px 0 0 45px;
|
||||
position : absolute;
|
||||
z-index: 4;
|
||||
overflow: visible;
|
||||
border: solid yellow 0px;
|
||||
}
|
||||
|
||||
|
||||
#selection_field{
|
||||
padding: 0px 0px 0 45px;
|
||||
background-color: #FFFF99;
|
||||
height: 1px;
|
||||
position: absolute;
|
||||
z-index: 5;
|
||||
top: -100px;
|
||||
margin: 1px 0 0 0px;
|
||||
white-space: pre;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#line_number{
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
border-right: solid black 1px;
|
||||
z-index:8;
|
||||
width: 38px;
|
||||
padding-right: 5px;
|
||||
text-align: right;
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
#test_font_size{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
pre{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.hidden{
|
||||
opacity: 0.2;
|
||||
-moz-opacity: 0.2;
|
||||
filter:alpha(opacity=20);
|
||||
}
|
||||
|
||||
#result .edit_area_cursor{
|
||||
position: absolute;
|
||||
z-index:6;
|
||||
background-color: #FF6633;
|
||||
top: -100px;
|
||||
margin: 1px 0 0 0px;
|
||||
}
|
||||
|
||||
#result .edit_area_selection_field .overline{
|
||||
background-color: #996600;
|
||||
}
|
||||
|
||||
|
||||
/* area popup */
|
||||
.editarea_popup{
|
||||
border: solid 1px #888888;
|
||||
background-color: #ECE9D8;
|
||||
width: 250px;
|
||||
padding: 4px;
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
/*display: none;*/
|
||||
z-index: 15;
|
||||
top: -500px;
|
||||
|
||||
/*font-family: Aria, Verdana, sans-serif;
|
||||
font-size: 10pt;*/
|
||||
}
|
||||
|
||||
.editarea_popup, .editarea_popup table{
|
||||
font-family: sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
.editarea_popup img{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.editarea_popup .close_popup{
|
||||
float: right;
|
||||
line-height: 16px;
|
||||
border: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.editarea_popup .copyright{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Area_search */
|
||||
div#area_search_replace{
|
||||
/*width: 250px;*/
|
||||
}
|
||||
|
||||
div#area_search_replace img{
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
div#area_search_replace div.button{
|
||||
text-align: center;
|
||||
line-height: 1.7em;
|
||||
}
|
||||
|
||||
div#area_search_replace .button a{
|
||||
cursor: pointer;
|
||||
border: solid 1px #888888;
|
||||
background-color: #DEDEDE;
|
||||
text-decoration: none;
|
||||
padding: 0 2px;
|
||||
color: #000000;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div#area_search_replace a:hover{
|
||||
/*border: solid 1px #888888;*/
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
|
||||
div#area_search_replace #move_area_search_replace{
|
||||
cursor: move;
|
||||
border: solid 1px #888888;
|
||||
}
|
||||
|
||||
div#area_search_replace #close_area_search_replace{
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div#area_search_replace #area_search_msg{
|
||||
height: 18px;
|
||||
overflow: hidden;
|
||||
border-top: solid 1px #888888;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/* area help */
|
||||
#edit_area_help{
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
#edit_area_help div.close_popup{
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* area_toolbar */
|
||||
.area_toolbar{
|
||||
/*font: 11px sans-serif;*/
|
||||
width: 100%;
|
||||
/*height: 21px; */
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
background-color: #ECE9D8;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.area_toolbar, .area_toolbar table{
|
||||
font: 11px sans-serif;
|
||||
}
|
||||
|
||||
.area_toolbar img{
|
||||
border: 0px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.area_toolbar input{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.area_toolbar select{
|
||||
font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
|
||||
font-size: 7pt;
|
||||
font-weight: normal;
|
||||
margin: 2px 0 0 0 ;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
background-color: #F0F0EE;
|
||||
}
|
||||
|
||||
table.statusbar{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.area_toolbar td.infos{
|
||||
text-align: center;
|
||||
width: 130px;
|
||||
border-right: solid 1px #888888;
|
||||
border-width: 0 1px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.area_toolbar td.total{
|
||||
text-align: right;
|
||||
width: 50px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.area_toolbar td.resize{
|
||||
text-align: right;
|
||||
}
|
||||
/*
|
||||
.area_toolbar span{
|
||||
line-height: 1px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}*/
|
||||
|
||||
.area_toolbar span#resize_area{
|
||||
cursor: nw-resize;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* toolbar buttons */
|
||||
.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {
|
||||
border: 0px; margin: 0px; padding: 0px; background: transparent;
|
||||
margin-top: 0px;
|
||||
margin-left: 1px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.editAreaButtonNormal {
|
||||
border: 1px solid #ECE9D8 !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editAreaButtonOver {
|
||||
border: 1px solid #0A246A !important;
|
||||
cursor: pointer;
|
||||
background-color: #B6BDD2;
|
||||
}
|
||||
|
||||
.editAreaButtonDown {
|
||||
cursor: pointer;
|
||||
border: 1px solid #0A246A !important;
|
||||
background-color: #8592B5;
|
||||
}
|
||||
|
||||
.editAreaButtonSelected {
|
||||
border: 1px solid #C0C0BB !important;
|
||||
cursor: pointer;
|
||||
background-color: #F4F2E8;
|
||||
}
|
||||
|
||||
.editAreaButtonDisabled {
|
||||
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
|
||||
-moz-opacity:0.3;
|
||||
opacity: 0.3;
|
||||
border: 1px solid #F0F0EE !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editAreaSeparatorLine {
|
||||
margin: 1px 2px;
|
||||
background-color: #C0C0BB;
|
||||
width: 2px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
/* waiting screen */
|
||||
#processing{
|
||||
display: none;
|
||||
background-color:#ECE9D8;
|
||||
border: solid #888888 1px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 100;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#processing_text{
|
||||
position:absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 200px;
|
||||
height: 20px;
|
||||
margin-left: -100px;
|
||||
margin-top: -10px;
|
||||
text-align: center;
|
||||
}
|
||||
/* end */
|
||||
@@ -1,35 +0,0 @@
|
||||
function EAL(){this.version="0.6.7";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug: false ,smooth_selection: true ,font_size: "10" ,font_family: "monospace" ,start_highlight: false ,toolbar: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, |, help" ,begin_toolbar: "" ,end_toolbar: "" ,allow_resize: "both" ,min_width: 400 ,min_height: 100 ,replace_tab_by_spaces: false ,allow_toggle: true ,language: "en" ,syntax: "" ,display: "onload" ,max_undo: 20 ,browsers: "known" ,plugins: "" ,gecko_spellcheck: false ,fullscreen: false ,load_callback: "" ,save_callback: "" , save_as_callback: "", change_callback: "" ,submit_callback: "" ,EA_init_callback: "" ,EA_delete_callback: "" ,EA_load_callback: "" ,EA_unload_callback: "" ,EA_toggle_on_callback: "" ,EA_toggle_off_callback: "" };this.advanced_buttons=[ ['new_document', 'newdocument.gif', 'new_document'], ['search', 'search.gif', 'show_search'], ['go_to_line', 'go_to_line.gif', 'go_to_line'], ['undo', 'undo.gif', 'undo'], ['redo', 'redo.gif', 'redo'], ['change_smooth_selection', 'smooth_selection.gif', 'change_smooth_selection_mode'], ['reset_highlight', 'reset_highlight.gif', 'resync_highlight'], ['highlight', 'highlight.gif','change_highlight'], ['help', 'help.gif', 'show_help'], ['save', 'save.gif', 'save'], ['save_as', 'save_as.gif', 'save_as'], ['load', 'load.gif', 'load'], ['fullscreen', 'fullscreen.gif', 'toggle_full_screen'] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/, "$1");if(this.nav['isIE']<6) this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/') !=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8 || !this.nav['isIE']) this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera') !=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i, "$1");if(this.nav['isOpera']<9) this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko') !=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox') !=-1)) this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i, "$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel') !=-1)) this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i, "$1");if(this.nav['isCamino'] =(ua.indexOf('Camino') !=-1)) this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i, "$1");this.nav['isSafari']=(ua.indexOf('Safari') !=-1);if(this.nav['isIE']>=6 || this.nav['isOpera']>=9 || this.nav['isFirefox'] || this.nav['isCamino']) this.nav['isValidBrowser']=true;
|
||||
else this.nav['isValidBrowser']=false;this.set_base_url();for(var i=0;i<this.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+this.baseURL + this.scripts_to_load[i]+ ".js');", 1);this.waiting_loading[this.scripts_to_load[i]+ ".js"]=false;}this.add_event(window, "load", EAL.prototype.window_loaded);};EAL.prototype.has_error=function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}};EAL.prototype.window_loaded=function(){eAL.win="loaded";if (document.forms){for (var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch (e){}eAL.add_event(form, "submit", EAL.prototype.submit);eAL.add_event(form, "reset", EAL.prototype.reset);}}eAL.add_event(window, "unload", function(){for(var i in eAs){eAL.delete_instance(i);}});};EAL.prototype.init_ie_textarea=function(id){textarea=document.getElementById(id);if(textarea && typeof(textarea.focused)=="undefined"){textarea.focus();textarea.focused=true;textarea.selectionStart=textarea.selectionEnd=0;get_IE_selection(textarea);eAL.add_event(textarea, "focus", IE_textarea_focus);eAL.add_event(textarea, "blur", IE_textarea_blur);}};EAL.prototype.init=function(settings){if(!settings["id"]) this.has_error();if(this.error) return;if(eAs[settings["id"]]) eAL.delete_instance(settings["id"]);for(var i in this.default_settings){if(typeof(settings[i])=="undefined") settings[i]=this.default_settings[i]}if(settings["browsers"]=="known" && this.nav['isValidBrowser']==false){return;}if(settings["begin_toolbar"].length>0) settings["toolbar"]=settings["begin_toolbar"] +","+ settings["toolbar"];if(settings["end_toolbar"].length>0) settings["toolbar"]=settings["toolbar"] +","+ settings["end_toolbar"];settings["tab_toolbar"]=settings["toolbar"].replace(/ /g,"").split(",");settings["plugins"]=settings["plugins"].replace(/ /g,"").split(",");for(var i=0;i<settings["plugins"].length;i++){if(settings["plugins"][i].length==0) settings["plugins"].splice(i,1);}this.get_template();this.load_script(this.baseURL + "langs/"+ settings["language"] + ".js");if(settings["syntax"].length>0){settings["syntax"]=settings["syntax"].toLowerCase();this.load_script(this.baseURL + "reg_syntax/"+ settings["syntax"] + ".js");}eAs[settings["id"]]={"settings": settings};eAs[settings["id"]]["displayed"]=false;eAs[settings["id"]]["hidden"]=false;eAL.start(settings["id"]);};EAL.prototype.delete_instance=function(id){eAL.execCommand(id, "EA_delete");if(window.frames["frame_"+id] && eAs[id]["displayed"]) window.frames["frame_"+id].editArea.execCommand("EA_unload");eAL.toggle(id, "off");var span=document.getElementById("EditAreaArroundInfos_"+id);if(span){span.parentNode.removeChild(span);}var iframe=document.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete window.frames["frame_"+id];}catch (e){}}delete eAs[id];};EAL.prototype.start=function(id){if(this.win!="loaded"){setTimeout("eAL.start('"+id+"');", 50);return;}for(var i in eAL.waiting_loading){if(eAL.waiting_loading[i]!="loaded"){setTimeout("eAL.start('"+id+"');", 50);return;}}if(!eAL.lang[eAs[id]["settings"]["language"]] || (eAs[id]["settings"]["syntax"].length>0 && !eAL.load_syntax[eAs[id]["settings"]["syntax"]]) ){setTimeout("eAL.start('"+id+"');", 50);return;}if(eAs[id]["settings"]["syntax"].length>0) eAL.init_syntax_regexp();if(!document.getElementById("EditAreaArroundInfos_"+id) && (eAs[id]["settings"]["debug"] || eAs[id]["settings"]["allow_toggle"])){var span=document.createElement("span");span.id="EditAreaArroundInfos_"+id;var html="";if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked":"";html+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+ id +"' class='toggle_"+ id +"' type='checkbox' onclick='eAL.toggle(\""+ id +"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+ id +"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"]) html+="<textarea id='edit_area_debug_"+ id +"' style='z-index: 20;width: 100%;height: 120px;overflow: auto;border: solid black 1px;'></textarea><br />";html=eAL.translate(html, eAs[id]["settings"]["language"]);span.innerHTML=html;var father=document.getElementById(id).parentNode;var next=document.getElementById(id).nextSibling;if(next==null) father.appendChild(span);
|
||||
else father.insertBefore(span, next);}if(!eAs[id]["initialized"]){this.execCommand(id, "EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(this.nav['isIE']){eAL.init_ie_textarea(id);}var html_toolbar_content="";area=eAs[id];for(var i=0;i<area["settings"]["tab_toolbar"].length;i++){html_toolbar_content+=this.get_control_html(area["settings"]["tab_toolbar"][i], area["settings"]["language"]);}if(!this.iframe_script){this.iframe_script="";for(var i=0;i<this.sub_scripts_to_load.length;i++) this.iframe_script+='<script language="javascript" type="text/javascript" src="'+ this.baseURL + this.sub_scripts_to_load[i] +'.js"></script>';}for(var i=0;i<area["settings"]["plugins"].length;i++){if(!eAL.all_plugins_loaded) this.iframe_script+='<script language="javascript" type="text/javascript" src="'+ this.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/' + area["settings"]["plugins"][i] +'.js"></script>';this.iframe_script+='<script language="javascript" type="text/javascript" src="'+ this.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/langs/' + area["settings"]["language"] +'.js"></script>';}if(!this.iframe_css){this.iframe_css="<link href='"+ this.baseURL +"edit_area.css' rel='stylesheet' type='text/css' />";}var template=this.template.replace(/\[__BASEURL__\]/g, this.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=this.translate(template, area["settings"]["language"], "template");template=template.replace("[__CSSRULES__]", this.iframe_css);template=template.replace("[__JSCODE__]", this.iframe_script);template=template.replace("[__EA_VERSION__]", this.version);area.textarea=document.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;var father=area.textarea.parentNode;var content=document.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content, "frameBorder", "0");content.style.overflow="hidden";content.style.display="none";var next=area.textarea.nextSibling;if(next==null) father.appendChild(content);
|
||||
else father.insertBefore(content, next);var frame=window.frames["frame_"+area["settings"]["id"]];frame.document.open();frame.eAs=eAs;frame.area_id=area["settings"]["id"];frame.document.area_id=area["settings"]["id"];frame.document.write(template);frame.document.close();};EAL.prototype.toggle=function(id, toggle_to){if(!toggle_to) toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true && toggle_to=="off"){this.toggle_off(id);}
|
||||
else if(eAs[id]["displayed"]==false && toggle_to=="on"){this.toggle_on(id);}return false;};EAL.prototype.toggle_off=function(id){if(window.frames["frame_"+id]){var frame=window.frames["frame_"+id];if(frame.editArea.fullscreen['isFull']) frame.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;eAs[id]["textarea"].wrap="off";setAttribute(eAs[id]["textarea"], "wrap", "off");var parNod=eAs[id]["textarea"].parentNode;var nxtSib=eAs[id]["textarea"].nextSibling;parNod.removeChild(eAs[id]["textarea"]);parNod.insertBefore(eAs[id]["textarea"], nxtSib);eAs[id]["textarea"].value=frame.editArea.textarea.value;var selStart=frame.editArea.last_selection["selectionStart"];var selEnd=frame.editArea.last_selection["selectionEnd"];var scrollTop=frame.document.getElementById("result").scrollTop;var scrollLeft=frame.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';eAs[id]["textarea"].style.display="inline";eAs[id]["textarea"].focus();if(this.nav['isIE']){eAs[id]["textarea"].selectionStart=selStart;eAs[id]["textarea"].selectionEnd=selEnd;eAs[id]["textarea"].focused=true;set_IE_selection(eAs[id]["textarea"]);}
|
||||
else{if(this.nav['isOpera']){eAs[id]["textarea"].setSelectionRange(0, 0);}try{eAs[id]["textarea"].setSelectionRange(selStart, selEnd);}catch(e){};}eAs[id]["textarea"].scrollTop=scrollTop;eAs[id]["textarea"].scrollLeft=scrollLeft;frame.editArea.execCommand("toggle_off");}};EAL.prototype.toggle_on=function(id){if(window.frames["frame_"+id]){var frame=window.frames["frame_"+id];area=window.frames["frame_"+id].editArea;area.textarea.value=eAs[id]["textarea"].value;var selStart=0;var selEnd=0;var scrollTop=0;var scrollLeft=0;if(eAs[id]["textarea"].use_last==true){var selStart=eAs[id]["textarea"].last_selectionStart;var selEnd=eAs[id]["textarea"].last_selectionEnd;var scrollTop=eAs[id]["textarea"].last_scrollTop;var scrollLeft=eAs[id]["textarea"].last_scrollLeft;eAs[id]["textarea"].use_last=false;}
|
||||
else{try{var selStart=eAs[id]["textarea"].selectionStart;var selEnd=eAs[id]["textarea"].selectionEnd;var scrollTop=eAs[id]["textarea"].scrollTop;var scrollLeft=eAs[id]["textarea"].scrollLeft;}catch(ex){}}this.set_editarea_size_from_textarea(id, document.getElementById("frame_"+id));eAs[id]["textarea"].style.display="none";document.getElementById("frame_"+id).style.display="inline";area.execCommand("focus");eAs[id]["displayed"]=true;area.execCommand("update_size");window.frames["frame_"+id].document.getElementById("result").scrollTop=scrollTop;window.frames["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;area.area_select(selStart, selEnd-selStart);area.execCommand("toggle_on");}
|
||||
else{var elem=document.getElementById(id);elem.last_selectionStart=elem.selectionStart;elem.last_selectionEnd=elem.selectionEnd;elem.last_scrollTop=elem.scrollTop;elem.last_scrollLeft=elem.scrollLeft;elem.use_last=true;eAL.start(id);}};EAL.prototype.set_editarea_size_from_textarea=function(id, frame){var elem=document.getElementById(id);var width=Math.max(eAs[id]["settings"]["min_width"], elem.offsetWidth)+"px";var height=Math.max(eAs[id]["settings"]["min_height"], elem.offsetHeight)+"px";if(elem.style.width.indexOf("%")!=-1) width=elem.style.width;if(elem.style.height.indexOf("%")!=-1) height=elem.style.height;frame.style.width=width;frame.style.height=height;};EAL.prototype.set_base_url=function(){if (!this.baseURL){var elements=document.getElementsByTagName('script');for (var i=0;i<elements.length;i++){if (elements[i].src && elements[i].src.match(/edit_area_[^\\\/]*$/i) ){var src=elements[i].src;src=src.substring(0, src.lastIndexOf('/'));this.baseURL=src;this.file_name=elements[i].src.substr(elements[i].src.lastIndexOf("/")+1);break;}}}var documentBasePath=document.location.href;if (documentBasePath.indexOf('?') !=-1) documentBasePath=documentBasePath.substring(0, documentBasePath.indexOf('?'));var documentURL=documentBasePath;documentBasePath=documentBasePath.substring(0, documentBasePath.lastIndexOf('/'));if (this.baseURL.indexOf('://')==-1 && this.baseURL.charAt(0) !='/'){this.baseURL=documentBasePath + "/" + this.baseURL;}this.baseURL+="/";};EAL.prototype.get_button_html=function(id, img, exec, baseURL){if(!baseURL) baseURL=this.baseURL;var cmd='editArea.execCommand(\'' + exec + '\')';html='<a href="javascript:' + cmd + '" onclick="' + cmd + ';return false;" onmousedown="return false;" target="_self">';html+='<img id="' + id + '" src="'+ baseURL +'images/' + img + '" title="{$' + id + '}" width="20" height="20" class="editAreaButtonNormal" onmouseover="editArea.switchClass(this,\'editAreaButtonOver\');" onmouseout="editArea.restoreClass(this);" onmousedown="editArea.restoreAndSwitchClass(this,\'editAreaButtonDown\');" /></a>';return html;};EAL.prototype.get_control_html=function(button_name, lang){for (var i=0;i<this.advanced_buttons.length;i++){var but=this.advanced_buttons[i];if (but[0]==button_name){return this.get_button_html(but[0], but[1], but[2]);}}switch (button_name){case "*": case "return": return "<br />";case "|": case "separator": return '<img src="'+ this.baseURL +'images/spacer.gif" width="1" height="15" class="editAreaSeparatorLine">';case "select_font": html="<select id='area_font_size' onchange='javascript:editArea.execCommand(\"change_font_size\")'>" +" <option value='-1'>{$font_size}</option>" +" <option value='8'>8 pt</option>" +" <option value='9'>9 pt</option>" +" <option value='10'>10 pt</option>" +" <option value='11'>11 pt</option>" +" <option value='12'>12 pt</option>" +" <option value='14'>14 pt</option>" +" </select>";return html;}return "<span id='tmp_tool_"+button_name+"'>["+button_name+"]</span>";};EAL.prototype.get_template=function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest) xhr_object=new XMLHttpRequest();
|
||||
else if(window.ActiveXObject) xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
else{alert("XMLHTTPRequest not supported. EditArea not loaded");return;}xhr_object.open("GET", this.baseURL+"template.html", false);xhr_object.send(null);if(xhr_object.readyState==4) this.template=xhr_object.responseText;
|
||||
else this.has_error();}};EAL.prototype.translate=function(text, lang, mode){if(mode=="word") text=eAL.get_word_translation(text, lang);
|
||||
else if(mode="template"){eAL.current_language=lang;text=text.replace(/\{\$([^\}]+)\}/gm, eAL.translate_template);}return text;};EAL.prototype.translate_template=function(){return eAL.get_word_translation(EAL.prototype.translate_template.arguments[1], eAL.current_language);};EAL.prototype.get_word_translation=function(val, lang){for(var i in eAL.lang[lang]){if(i==val) return eAL.lang[lang][i];}return "_"+val;};EAL.prototype.load_script=function(url){if (this.loadedFiles[url]) return;try{var script=document.createElement("script");script.type="text/javascript";script.src=url;var head=document.getElementsByTagName("head");head[0].appendChild(script);}catch(e){document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');}this.loadedFiles[url]=true;};EAL.prototype.add_event=function(obj, name, handler){if (obj.attachEvent){obj.attachEvent("on" + name, handler);}
|
||||
else{obj.addEventListener(name, handler, false);}};EAL.prototype.remove_event=function(obj, name, handler){if (obj.detachEvent) obj.detachEvent("on" + name, handler);
|
||||
else obj.removeEventListener(name, handler, false);};EAL.prototype.reset=function(e){var formObj=eAL.nav['isIE'] ? window.event.srcElement : e.target;for(var i in eAs){var is_child=false;for (var x=0;x<formObj.elements.length;x++){if(formObj.elements[x].id==i) is_child=true;}if(window.frames["frame_"+i] && is_child && eAs[i]["displayed"]==true){var exec='window.frames["frame_'+ i +'"].editArea.textarea.value=document.getElementById("'+ i +'").value;';exec+='window.frames["frame_'+ i +'"].editArea.execCommand("focus");';exec+='window.frames["frame_'+ i +'"].editArea.check_line_selection();';exec+='window.frames["frame_'+ i +'"].editArea.execCommand("reset");';window.setTimeout(exec, 10);}}return;};EAL.prototype.submit=function(e){var formObj=eAL.nav['isIE'] ? window.event.srcElement : e.target;for(var i in eAs){var is_child=false;for (var x=0;x<formObj.elements.length;x++){if(formObj.elements[x].id==i) is_child=true;}if(is_child){if(window.frames["frame_"+i] && eAs[i]["displayed"]==true) document.getElementById(i).value=window.frames["frame_"+ i].editArea.textarea.value;eAL.execCommand(i,"EA_submit");}}if(typeof(formObj.edit_area_replaced_submit)=="function"){res=formObj.edit_area_replaced_submit();if(res==false){if(eAL.nav['isIE']) return false;
|
||||
else e.preventDefault();}}return;};EAL.prototype.getValue=function(id){if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){return window.frames["frame_"+ id].editArea.textarea.value;}
|
||||
else if(elem=document.getElementById(id)){return elem.value;}return false;};EAL.prototype.setValue=function(id, new_val){if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){window.frames["frame_"+ id].editArea.textarea.value=new_val;window.frames["frame_"+ id].editArea.execCommand("focus");window.frames["frame_"+ id].editArea.check_line_selection(false);window.frames["frame_"+ id].editArea.execCommand("onchange");}
|
||||
else if(elem=document.getElementById(id)){elem.value=new_val;}};EAL.prototype.getSelectionRange=function(id){var sel={"start": 0, "end": 0};if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){var editArea=window.frames["frame_"+ id].editArea;sel["start"]=editArea.textarea.selectionStart;sel["end"]=editArea.textarea.selectionEnd;}
|
||||
else if(elem=document.getElementById(id)){sel=getSelectionRange(elem);}return sel;};EAL.prototype.setSelectionRange=function(id, new_start, new_end){if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){window.frames["frame_"+ id].editArea.area_select(new_start, new_end-new_start);if(!this.nav['isIE']){window.frames["frame_"+ id].editArea.check_line_selection(false);window.frames["frame_"+ id].editArea.scroll_to_view();}}
|
||||
else if(elem=document.getElementById(id)){setSelectionRange(elem, new_start, new_end);}};EAL.prototype.getSelectedText=function(id){var sel=this.getSelectionRange(id);return this.getValue(id).substring(sel["start"], sel["end"]);};EAL.prototype.setSelectedText=function(id, new_val){new_val=new_val.replace(/\r/g, "");var sel=this.getSelectionRange(id);var text=this.getValue(id);if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){var scrollTop=window.frames["frame_"+ id].document.getElementById("result").scrollTop;var scrollLeft=window.frames["frame_"+ id].document.getElementById("result").scrollLeft;}
|
||||
else{var scrollTop=document.getElementById(id).scrollTop;var scrollLeft=document.getElementById(id).scrollLeft;}text=text.substring(0, sel["start"])+ new_val +text.substring(sel["end"]);this.setValue(id, text);var new_sel_end=sel["start"]+ new_val.length;this.setSelectionRange(id, sel["start"], new_sel_end);if(new_val !=this.getSelectedText(id).replace(/\r/g, "")){this.setSelectionRange(id, sel["start"], new_sel_end+ new_val.split("\n").length -1);}if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){window.frames["frame_"+ id].document.getElementById("result").scrollTop=scrollTop;window.frames["frame_"+ id].document.getElementById("result").scrollLeft=scrollLeft;window.frames["frame_"+ id].editArea.execCommand("onchange");}
|
||||
else{document.getElementById(id).scrollTop=scrollTop;document.getElementById(id).scrollLeft=scrollLeft;}};EAL.prototype.insertTags=function(id, open_tag, close_tag){var old_sel=this.getSelectionRange(id);text=open_tag + this.getSelectedText(id) + close_tag;eAL.setSelectedText(id, text);var new_sel=this.getSelectionRange(id);if(old_sel["end"] > old_sel["start"]) this.setSelectionRange(id, new_sel["end"], new_sel["end"]);
|
||||
else this.setSelectionRange(id, old_sel["start"]+open_tag.length, old_sel["start"]+open_tag.length);};EAL.prototype.hide=function(id){if(document.getElementById(id) && !this.hidden[id]){this.hidden[id]=new Object();this.hidden[id]["selectionRange"]=this.getSelectionRange(id);if(document.getElementById(id).style.display!="none"){this.hidden[id]["scrollTop"]=document.getElementById(id).scrollTop;this.hidden[id]["scrollLeft"]=document.getElementById(id).scrollLeft;}if(window.frames["frame_"+id]){this.hidden[id]["toggle"]=eAs[id]["displayed"];if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){var scrollTop=window.frames["frame_"+ id].document.getElementById("result").scrollTop;var scrollLeft=window.frames["frame_"+ id].document.getElementById("result").scrollLeft;}
|
||||
else{var scrollTop=document.getElementById(id).scrollTop;var scrollLeft=document.getElementById(id).scrollLeft;}this.hidden[id]["scrollTop"]=scrollTop;this.hidden[id]["scrollLeft"]=scrollLeft;if(eAs[id]["displayed"]==true) eAL.toggle_off(id);}var span=document.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='none';}document.getElementById(id).style.display="none";}};EAL.prototype.show=function(id){if((elem=document.getElementById(id)) && this.hidden[id]){elem.style.display="inline";elem.scrollTop=this.hidden[id]["scrollTop"];elem.scrollLeft=this.hidden[id]["scrollLeft"];var span=document.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='inline';}if(window.frames["frame_"+id]){elem.style.display="inline";if(this.hidden[id]["toggle"]==true) eAL.toggle_on(id);scrollTop=this.hidden[id]["scrollTop"];scrollLeft=this.hidden[id]["scrollLeft"];if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){window.frames["frame_"+ id].document.getElementById("result").scrollTop=scrollTop;window.frames["frame_"+ id].document.getElementById("result").scrollLeft=scrollLeft;}
|
||||
else{elem.scrollTop=scrollTop;elem.scrollLeft=scrollLeft;}}sel=this.hidden[id]["selectionRange"];this.setSelectionRange(id, sel["start"], sel["end"]);delete this.hidden[id];}};EAL.prototype.execCommand=function(id, cmd){switch(cmd){case "EA_init": if(eAs[id]['settings']["EA_init_callback"].length>0) eval(eAs[id]['settings']["EA_init_callback"]+"('"+ id +"');");break;case "EA_delete": if(eAs[id]['settings']["EA_delete_callback"].length>0) eval(eAs[id]['settings']["EA_delete_callback"]+"('"+ id +"');");break;case "EA_submit": if(eAs[id]['settings']["submit_callback"].length>0) eval(eAs[id]['settings']["submit_callback"]+"('"+ id +"');");break;}if(window.frames["frame_"+id]){return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +';');}return false;};var eAL=new EAL();var eAs=new Object();function getAttribute( elm, aname ){try{var avalue=elm.getAttribute( aname );}catch(exept){}if ( ! avalue ){for ( var i=0;i < elm.attributes.length;i ++ ){var taName=elm.attributes [i] .name.toLowerCase();if ( taName==aname ){avalue=elm.attributes [i] .value;return avalue;}}}return avalue;};function setAttribute( elm, attr, val ){if(attr=="class"){elm.setAttribute("className", val);elm.setAttribute("class", val);}
|
||||
else{elm.setAttribute(attr, val);}};function getChildren(elem, elem_type, elem_attribute, elem_attribute_match, option, depth){if(!option) var option="single";if(!depth) var depth=-1;if(elem){var children=elem.childNodes;var result=null;var results=new Array();for (var x=0;x<children.length;x++){strTagName=new String(children[x].tagName);children_class="?";if(strTagName!="undefined"){child_attribute=getAttribute(children[x],elem_attribute);if((strTagName.toLowerCase()==elem_type.toLowerCase() || elem_type=="") && (elem_attribute=="" || child_attribute==elem_attribute_match)){if(option=="all"){results.push(children[x]);}
|
||||
else{return children[x];}}if(depth!=0){result=getChildren(children[x], elem_type, elem_attribute, elem_attribute_match, option, depth-1);if(option=="all"){if(result.length>0){results=results.concat(result);}}
|
||||
else if(result!=null){return result;}}}}if(option=="all") return results;}return null;};function isChildOf(elem, parent){if(elem){if(elem==parent) return true;while(elem.parentNode !='undefined'){return isChildOf(elem.parentNode, parent);}}return false;};function getMouseX(e){if(e!=null && typeof(e.pageX)!="undefined"){return e.pageX;}
|
||||
else{return (e!=null?e.x:event.x)+ document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null && typeof(e.pageY)!="undefined"){return e.pageY;}
|
||||
else{return (e!=null?e.y:event.y)+ document.documentElement.scrollTop;}};function calculeOffsetLeft(r){return calculeOffset(r,"offsetLeft") };function calculeOffsetTop(r){return calculeOffset(r,"offsetTop") };function calculeOffset(element,attr){var offset=0;while(element){offset+=element[attr];element=element.offsetParent}return offset;};function get_css_property(elem, prop){if(document.defaultView){return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);}
|
||||
else if(elem.currentStyle){var prop=prop.replace(/-\D/gi, function(sMatch){return sMatch.charAt(sMatch.length - 1).toUpperCase();});return elem.currentStyle[prop];}
|
||||
else return null;}var move_current_element;function start_move_element(e, id, frame){var elem_id=(e.target || e.srcElement).id;if(id) elem_id=id;if(!frame) frame=window;if(frame.event) e=frame.event;move_current_element=frame.document.getElementById(elem_id);move_current_element.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);move_current_element.start_pos_x=mouse_x - (move_current_element.style.left.replace("px","") || calculeOffsetLeft(move_current_element));move_current_element.start_pos_y=mouse_y - (move_current_element.style.top.replace("px","") || calculeOffsetTop(move_current_element));return false;};function end_move_element(e){move_current_element.frame.document.onmousemove="";move_current_element.frame.document.onmouseup="";move_current_element=null;};function move_element(e){if(move_current_element.frame && move_current_element.frame.event) e=move_current_element.frame.event;var mouse_x=getMouseX(e);var mouse_y=getMouseY(e);var new_top=mouse_y - move_current_element.start_pos_y;var new_left=mouse_x - move_current_element.start_pos_x;var max_left=move_current_element.frame.document.body.offsetWidth- move_current_element.offsetWidth;max_top=move_current_element.frame.document.body.offsetHeight- move_current_element.offsetHeight;new_top=Math.min(Math.max(0, new_top), max_top);new_left=Math.min(Math.max(0, new_left), max_left);move_current_element.style.top=new_top+"px";move_current_element.style.left=new_left+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return {"start": textarea.selectionStart, "end": textarea.selectionEnd};};function setSelectionRange(textarea, start, end){textarea.focus();start=Math.max(0, Math.min(textarea.value.length, start));end=Math.max(start, Math.min(textarea.value.length, end));if(nav['isOpera']){textarea.selectionEnd=1;textarea.selectionStart=0;textarea.selectionEnd=1;textarea.selectionStart=0;}textarea.selectionStart=start;textarea.selectionEnd=end;if(nav['isIE']) set_IE_selection(textarea);};function get_IE_selection(textarea){if(textarea && textarea.focused){if(!textarea.ea_line_height){var div=document.createElement("div");div.style.fontFamily=get_css_property(textarea, "font-family");div.style.fontSize=get_css_property(textarea, "font-size");div.style.visibility="hidden";div.innerHTML="0";document.body.appendChild(div);textarea.ea_line_height=div.offsetHeight;document.body.removeChild(div);}var range=document.selection.createRange();var stored_range=range.duplicate();stored_range.moveToElementText( textarea );stored_range.setEndPoint( 'EndToEnd', range );if(stored_range.parentElement()==textarea){var elem=textarea;var scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}var relative_top=range.offsetTop - calculeOffsetTop(textarea)+ scrollTop;var line_start=Math.round((relative_top / textarea.ea_line_height) +1);var line_nb=Math.round(range.boundingHeight / textarea.ea_line_height);var range_start=stored_range.text.length - range.text.length;var tab=textarea.value.substr(0, range_start).split("\n");range_start+=(line_start - tab.length)*2;textarea.selectionStart=range_start;var range_end=textarea.selectionStart + range.text.length;tab=textarea.value.substr(0, range_start + range.text.length).split("\n");range_end+=(line_start + line_nb - 1 - tab.length)*2;textarea.selectionEnd=range_end;}}setTimeout("get_IE_selection(document.getElementById('"+ textarea.id +"'));", 50);};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(textarea){var nbLineStart=textarea.value.substr(0, textarea.selectionStart).split("\n").length - 1;var nbLineEnd=textarea.value.substr(0, textarea.selectionEnd).split("\n").length - 1;var range=document.selection.createRange();range.moveToElementText( textarea );range.setEndPoint( 'EndToStart', range );range.moveStart('character', textarea.selectionStart - nbLineStart);range.moveEnd('character', textarea.selectionEnd - nbLineEnd - (textarea.selectionStart - nbLineStart) );range.select();};eAL.waiting_loading["elements_functions.js"]="loaded";EAL.prototype.start_resize_area=function(){document.onmouseup=eAL.end_resize_area;document.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);var textarea=eAs[eAL.resize["id"]]["textarea"];var div=document.getElementById("edit_area_resize");if(!div){div=document.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}var width=textarea.offsetWidth -2;var height=textarea.offsetHeight -2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";var father=textarea.parentNode;father.insertBefore(div, textarea);textarea.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){document.onmouseup="";document.onmousemove=""Line truncated
|
||||
else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n";style+="."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded";
|
||||
var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "<script language='Javascript' type='text/javascript'> function EA(){this.error=false;this.inlinePopup=new Array({popup_id: \"area_search_replace\", icon_id: \"search\"}, {popup_id: \"edit_area_help\", icon_id: \"help\"});this.plugins=new Object();this.line_number=0;this.nav=parent.eAL.nav;this.last_selection=new Object();this.last_text_to_highlight=\"\";this.last_hightlighted_text=\"\";this.textareaFocused=false;this.previous=new Array();this.next=new Array();this.last_undo=\"\";this.assocBracket=new Object();this.revertAssocBracket=new Object();this.assocBracket[\"(\"]=\")\";this.assocBracket[\"{\"]=\"}\";this.assocBracket[\"[\"]=\"]\";for(var index in this.assocBracket){this.revertAssocBracket[this.assocBracket[index]]=index;}this.lineHeight=16;this.tab_nb_char=8;if(this.nav['isOpera']) this.tab_nb_char=6;this.is_tabbing=false;this.fullscreen={'isFull': false};this.isResizing=false;this.id=area_id;this.settings=eAs[this.id][\"settings\"];if((\"\"+this.settings['replace_tab_by_spaces']).match(/^[0-9]+$/)){this.tab_nb_char=this.settings['replace_tab_by_spaces'];this.tabulation=\"\";for(var i=0;i<this.tab_nb_char;i++) this.tabulation+=\" \";}\nelse this.tabulation=\"\t\";};EA.prototype.update_size=function(){if(eAs[eA.id] && eAs[eA.id][\"displayed\"]==true){if(eA.fullscreen['isFull']){parent.document.getElementById(\"frame_\"+eA.id).style.width=parent.document.getElementsByTagName(\"html\")[0].clientWidth + \"px\";parent.document.getElementById(\"frame_\"+eA.id).style.height=parent.document.getElementsByTagName(\"html\")[0].clientHeight + \"px\";}var height=document.body.offsetHeight - eA.get_all_toolbar_height() - 4;eA.result.style.height=height +\"px\";var width=document.body.offsetWidth -2;eA.result.style.width=width+\"px\";for(var i=0;i<eA.inlinePopup.length;i++){var popup=document.getElementById(eA.inlinePopup[i][\"popup_id\"]);var max_left=document.body.offsetWidth- popup.offsetWidth;var max_top=document.body.offsetHeight- popup.offsetHeight;if(popup.offsetTop>max_top) popup.style.top=max_top+\"px\";if(popup.offsetLeft>max_left) popup.style.left=max_left+\"px\";}}};EA.prototype.init=function(){this.textarea=document.getElementById(\"textarea\");this.container=document.getElementById(\"container\");this.result=document.getElementById(\"result\");this.content_highlight=document.getElementById(\"content_highlight\");this.selection_field=document.getElementById(\"selection_field\");spans=parent.getChildren(document.getElementById(\"toolbar_1\"), \"span\", \"\", \"\", \"all\", -1);for(var i=0;i<spans.length;i++){id=spans[i].id.replace(/tmp_tool_(.*)/, \"$1\");if(id!=spans[i].id){for(var j in this.plugins){if(typeof(this.plugins[j].get_control_html)==\"function\" ){html=this.plugins[j].get_control_html(id);if(html!=false){html=parent.eAL.translate(html, this.settings[\"language\"], \"template\");var new_span=document.createElement(\"span\");new_span.innerHTML=html;var father=spans[i].parentNode;spans[i].parentNode.replaceChild(new_span, spans[i]);break;}}}}}this.textarea.value=eAs[this.id][\"textarea\"].value;if(this.settings[\"debug\"]) this.debug=parent.document.getElementById(\"edit_area_debug_\"+this.id);if(document.getElementById(\"redo\") !=null) this.switchClassSticky(document.getElementById(\"redo\"), 'editAreaButtonDisabled', true);if(typeof(parent.eAL.syntax[this.settings[\"syntax\"]])!=\"undefined\"){for(var i in parent.eAL.syntax){this.add_style(parent.eAL.syntax[i][\"styles\"]);}}if(this.nav['isOpera']) document.getElementById(\"editor\").onkeypress=keyDown;\nelse document.getElementById(\"editor\").onkeydown=keyDown;for(var i=0;i<this.inlinePopup.length;i++){if(this.nav['isIE'] || this.nav['isFirefox']) document.getElementById(this.inlinePopup[i][\"popup_id\"]).onkeydown=keyDown;\nelse document.getElementById(this.inlinePopup[i][\"popup_id\"]).onkeypress=keyDown;}if(this.settings[\"allow_resize\"]==\"both\" || this.settings[\"allow_resize\"]==\"x\" || this.settings[\"allow_resize\"]==\"y\") this.allow_resize(true);parent.eAL.toggle(this.id, \"on\");this.change_smooth_selection_mode(eA.smooth_selection);this.execCommand(\"change_highlight\", this.settings[\"start_highlight\"]);this.set_font(eA.settings[\"font_family\"], eA.settings[\"font_size\"]);children=parent.getChildren(document.body, \"\", \"selec\", \"none\", \"all\", -1);for(var i=0;i<children.length;i++){if(this.nav['isIE']) children[i].unselectable=true;\nelse children[i].onmousedown=function(){return false};}if(this.nav['isGecko']){this.textarea.spellcheck=this.settings[\"gecko_spellcheck\"];}if(this.nav['isOpera']){document.getElementById(\"editor\").style.position=\"absolute\";document.getElementById(\"selection_field\").style.marginTop=\"-1pt\";document.getElementById(\"selection_field\").style.paddingTop=\"1pt\";document.getElementById(\"cursor_pos\").style.marginTop=\"-1pt\";document.getElementById(\"end_bracket\").style.marginTop=\"-1pt\Line truncated
|
||||
editAreaLoader.template= "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" > <head> <title>EditArea</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> [__CSSRULES__] [__JSCODE__] </head> <body> <div class='editor' id='editor'> <div class='area_toolbar' id='toolbar_1'>[__TOOLBAR__]</div> <div id='result'> <div id='container'> <div id='cursor_pos' class='edit_area_cursor'> </div> <div id='end_bracket' class='edit_area_cursor'> </div> <div id='selection_field'></div> <div id='line_number' selec='none'></div> <div id='content_highlight'></div> <div id='test_font_size'></div> <textarea id='textarea' wrap='off' onchange='editArea.execCommand(\"onchange\");' onfocus='javascript:editArea.textareaFocused=true;' onblur='javascript:editArea.textareaFocused=false;'> </textarea> </div> </div> <div class='area_toolbar' id='toolbar_2'> <table class='statusbar' cellspacing='0' cellpadding='0'> <tr> <td class='total' selec='none'>{$position}:</td> <td class='infos' selec='none'> {$line_abbr} <span id='linePos'>0</span>, {$char_abbr} <span id='currPos'>0</span> </td> <td class='total' selec='none'>{$total}:</td> <td class='infos' selec='none'> {$line_abbr} <span id='nbLine'>0</span>, {$char_abbr} <span id='nbChar'>0</span> </td> <td class='resize'> <span id='resize_area'><img src='[__BASEURL__]images/statusbar_resize.gif' alt='resize' selec='none'></span> </td> </tr> </table> </div> </div> <div id='processing'> <div id='processing_text'> {$processing} </div> </div> <div id='area_search_replace' class='editarea_popup'> <table cellspacing='2' cellpadding='0' style='width: 100%'> <tr> <td selec='none'>{$search}</td> <td><input type='text' id='area_search' /></td> <td id='close_area_search_replace'> <a onclick='Javascript:editArea.execCommand(\"hidden_search\")'><img selec='none' src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a><br /> </tr><tr> <td selec='none'>{$replace}</td> <td><input type='text' id='area_replace' /></td> <td><img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,\"area_search_replace\", parent.frames[\"frame_\"+editArea.id]);' src='[__BASEURL__]images/move.gif' alt='{$move_popup}' title='{$move_popup}' /></td> </tr> </table> <div class='button'> <input type='checkbox' id='area_search_match_case' /><label for='area_search_match_case' selec='none'>{$match_case}</label> <input type='checkbox' id='area_search_reg_exp' /><label for='area_search_reg_exp' selec='none'>{$reg_exp}</label> <br /> <a onclick='Javascript:editArea.execCommand(\"area_search\")' selec='none'>{$find_next}</a> <a onclick='Javascript:editArea.execCommand(\"area_replace\")' selec='none'>{$replace}</a> <a onclick='Javascript:editArea.execCommand(\"area_replace_all\")' selec='none'>{$replace_all}</a><br /> </div> <div id='area_search_msg' selec='none'></div> </div> <div id='edit_area_help' class='editarea_popup'> <div class='close_popup'> <a onclick='Javascript:editArea.execCommand(\"close_all_inline_popup\")'><img src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a> </div> <div><h2>Editarea [__EA_VERSION__]</h2><br /> <h3>{$shortcuts}:</h3> {$tab}: {$add_tab}<br /> {$shift}+{$tab}: {$remove_tab}<br /> {$ctrl}+f: {$search_command}<br /> {$ctrl}+r: {$replace_command}<br /> {$ctrl}+h: {$highlight}<br /> {$ctrl}+g: {$go_to_line}<br /> {$ctrl}+z: {$undo}<br /> {$ctrl}+y: {$redo}<br /> {$ctrl}+e: {$help}<br /> {$ctrl}+q, {$esc}: {$close_popup}<br /> {$accesskey} E: {$toggle}<br /> <br /> <em>{$about_notice}</em> <br /><div class='copyright'>© Christophe Dolivet - 2007</div> </div> </div> </div> </body> </html> ";
|
||||
editAreaLoader.iframe_css= "<style>body, html{}body, html, table, form, textarea{}#editor{}#result{z-index: 4;}#container{overflow: hidden;}#textarea{position: relative;top: 0px;left: 0px;padding: 0px 0px 0px 45px;width: 100%;height: 100%;overflow: hidden;z-index: 7;border: solid green 0px;}#content_highlight{white-space: pre;padding: 1px 0 0 45px;position : absolute;z-index: 4;overflow: visible;border: solid yellow 0px;}#selection_field{padding: 0px 0px 0 45px;background-color: #FFFF99;height: 1px;position: absolute;z-index: 5;top: -100px;margin: 1px 0 0 0px;white-space: pre;overflow: hidden;}#line_number{position: absolute;overflow: hidden;border-right: solid black 1px;z-index:8;width: 38px;padding-right: 5px;text-align: right;color: #AAAAAA;}#test_font_size{padding: 0;margin: 0;visibility: hidden;position: absolute;white-space: pre;}pre{margin: 0;padding: 0;}.hidden{opacity: 0.2;-moz-opacity: 0.2;filter:alpha(opacity=20);}#result .edit_area_cursor{position: absolute;z-index:6;background-color: #FF6633;top: -100px;margin: 1px 0 0 0px;}#result .edit_area_selection_field .overline{background-color: #996600;}.editarea_popup{border: solid 1px #888888;background-color: #ECE9D8;width: 250px;padding: 4px;position: absolute;visibility: hidden;z-index: 15;top: -500px;}.editarea_popup, .editarea_popup table{font-family: sans-serif;font-size: 10pt;}.editarea_popup img{border: 0;}.editarea_popup .close_popup{float: right;line-height: 16px;border: 0px;padding: 0px;}.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{margin: 0px;padding: 0px;}.editarea_popup .copyright{text-align: right;}div#area_search_replace{}div#area_search_replace img{border: 0px;}div#area_search_replace div.button{text-align: center;line-height: 1.7em;}div#area_search_replace .button a{cursor: pointer;border: solid 1px #888888;background-color: #DEDEDE;text-decoration: none;padding: 0 2px;color: #000000;white-space: nowrap;}div#area_search_replace a:hover{background-color: #EDEDED;}div#area_search_replace #move_area_search_replace{cursor: move;border: solid 1px #888888;}div#area_search_replace #close_area_search_replace{text-align: right;vertical-align: top;white-space: nowrap;}div#area_search_replace #area_search_msg{height: 18px;overflow: hidden;border-top: solid 1px #888888;margin-top: 3px;}#edit_area_help{width: 350px;}#edit_area_help div.close_popup{float: right;}.area_toolbar{width: 100%;margin: 0px;padding: 0px;background-color: #ECE9D8;text-align: center;}.area_toolbar, .area_toolbar table{font: 11px sans-serif;}.area_toolbar img{border: 0px;vertical-align: middle;}.area_toolbar input{margin: 0px;padding: 0px;}.area_toolbar select{font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;font-size: 7pt;font-weight: normal;margin: 2px 0 0 0 ;padding: 0;vertical-align: top;background-color: #F0F0EE;}table.statusbar{width: 100%;}.area_toolbar td.infos{text-align: center;width: 130px;border-right: solid 1px #888888;border-width: 0 1px 0 0;padding: 0;}.area_toolbar td.total{text-align: right;width: 50px;padding: 0;}.area_toolbar td.resize{text-align: right;}.area_toolbar span#resize_area{cursor: nw-resize;visibility: hidden;}.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {border: 0px; margin: 0px; padding: 0px; background: transparent;margin-top: 0px;margin-left: 1px;padding: 0px;}.editAreaButtonNormal {border: 1px solid #ECE9D8 !important;cursor: pointer;}.editAreaButtonOver {border: 1px solid #0A246A !important;cursor: pointer;background-color: #B6BDD2;}.editAreaButtonDown {cursor: pointer;border: 1px solid #0A246A !important;background-color: #8592B5;}.editAreaButtonSelected {border: 1px solid #C0C0BB !important;cursor: pointer;background-color: #F4F2E8;}.editAreaButtonDisabled {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);-moz-opacity:0.3;opacity: 0.3;border: 1px solid #F0F0EE !important;cursor: pointer;}.editAreaSeparatorLine {margin: 1px 2px;background-color: #C0C0BB;width: 2px;height: 18px;}#processing{display: none;background-color:#ECE9D8;border: solid #888888 1px;position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index: 100;text-align: center;}#processing_text{position:absolute;left: 50%;top: 50%;width: 200px;height: 20px;margin-left: -100px;margin-top: -10px;text-align: center;}</style>";
|
||||
|
Before Width: | Height: | Size: 102 B |
|
Before Width: | Height: | Size: 198 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 295 B |
|
Before Width: | Height: | Size: 256 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 257 B |
|
Before Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 147 B |
|
Before Width: | Height: | Size: 825 B |
|
Before Width: | Height: | Size: 169 B |
|
Before Width: | Height: | Size: 168 B |
|
Before Width: | Height: | Size: 285 B |
|
Before Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 191 B |
|
Before Width: | Height: | Size: 174 B |
|
Before Width: | Height: | Size: 43 B |
|
Before Width: | Height: | Size: 79 B |
|
Before Width: | Height: | Size: 175 B |
@@ -1,45 +0,0 @@
|
||||
editAreaLoader.lang["de"]={
|
||||
new_document: "neues leeres Dokument",
|
||||
search_button: "suchen und ersetzen",
|
||||
search_command: "suche nächsten / öffne Suchfeld",
|
||||
search: "suche",
|
||||
replace: "ersetze",
|
||||
replace_command: "ersetze / öffne Suchfeld",
|
||||
find_next: "finde nächsten",
|
||||
replace_all: "ersetze alle Treffer",
|
||||
reg_exp: "reguläre Ausdrücke",
|
||||
match_case: "passt auf den Begriff<br />",
|
||||
not_found: "Nicht gefunden.",
|
||||
occurrence_replaced: "Die Vorkommen wurden ersetzt.",
|
||||
search_field_empty: "leeres Suchfeld",
|
||||
restart_search_at_begin: "Ende des zu durchsuchenden Bereiches erreicht. Es wird die Suche von Anfang an fortgesetzt.", //find a shorter translation
|
||||
move_popup: "Suchfenster bewegen",
|
||||
font_size: "--Schriftgröße--",
|
||||
go_to_line: "gehe zu Zeile",
|
||||
go_to_line_prompt: "gehe zu Zeilennummmer:",
|
||||
undo: "rückgängig machen",
|
||||
redo: "wiederherstellen",
|
||||
change_smooth_selection: "aktiviere/deaktiviere einige Features (weniger Bildschirmnutzung aber mehr CPU-Belastung)",
|
||||
highlight: "Syntax Highlighting an- und ausschalten",
|
||||
reset_highlight: "Highlighting zurücksetzen (falls mit Text nicht konform)",
|
||||
help: "über",
|
||||
save: "sichern",
|
||||
load: "öffnen",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Position",
|
||||
total: "Gesamt",
|
||||
close_popup: "Popup schließen",
|
||||
shortcuts: "Shortcuts",
|
||||
add_tab: "Tab zum Text hinzufügen",
|
||||
remove_tab: "Tab aus Text entfernen",
|
||||
about_notice: "Bemerkung: Syntax Highlighting ist nur für kurze Texte",
|
||||
toggle: "Editor an- und ausschalten",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "In Bearbeitung...",
|
||||
fullscreen: "fullscreen"
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
editAreaLoader.lang["dk"]={
|
||||
new_document: "nyt tomt dokument",
|
||||
search_button: "søg og erstat",
|
||||
search_command: "find næste / åben søgefelt",
|
||||
search: "søg",
|
||||
replace: "erstat",
|
||||
replace_command: "erstat / åben søgefelt",
|
||||
find_next: "find næste",
|
||||
replace_all: "erstat alle",
|
||||
reg_exp: "regular expressions",
|
||||
match_case: "forskel på store/små bogstaver<br />",
|
||||
not_found: "not found.",
|
||||
occurrence_replaced: "occurences replaced.",
|
||||
search_field_empty: "Search field empty",
|
||||
restart_search_at_begin: "End of area reached. Restart at begin.",
|
||||
move_popup: "flyt søgepopup",
|
||||
font_size: "--Skriftstørrelse--",
|
||||
go_to_line: "gå til linie",
|
||||
go_to_line_prompt: "gå til linienummer:",
|
||||
undo: "fortryd",
|
||||
redo: "gentag",
|
||||
change_smooth_selection: "slå display funktioner til/fra (smartere display men mere CPU krævende)",
|
||||
highlight: "slå syntax highlight til/fra",
|
||||
reset_highlight: "nulstil highlight (hvis den er desynkroniseret fra teksten)",
|
||||
help: "om",
|
||||
save: "gem",
|
||||
load: "hent",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Position",
|
||||
total: "Total",
|
||||
close_popup: "luk popup",
|
||||
shortcuts: "Genveje",
|
||||
add_tab: "tilføj tabulation til tekst",
|
||||
remove_tab: "fjern tabulation fra tekst",
|
||||
about_notice: "Husk: syntax highlight funktionen bør kun bruge til små tekster",
|
||||
toggle: "Slå editor til / fra",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Skift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Processing...",
|
||||
fullscreen: "fullscreen"
|
||||
};
|
||||
@@ -1,46 +0,0 @@
|
||||
editAreaLoader.lang["en"]={
|
||||
new_document: "new empty document",
|
||||
search_button: "search and replace",
|
||||
search_command: "search next / open search area",
|
||||
search: "search",
|
||||
replace: "replace",
|
||||
replace_command: "replace / open search area",
|
||||
find_next: "find next",
|
||||
replace_all: "replace all",
|
||||
reg_exp: "regular expressions",
|
||||
match_case: "match case",
|
||||
not_found: "not found.",
|
||||
occurrence_replaced: "occurences replaced.",
|
||||
search_field_empty: "Search field empty",
|
||||
restart_search_at_begin: "End of area reached. Restart at begin.",
|
||||
move_popup: "move search popup",
|
||||
font_size: "--Font size--",
|
||||
go_to_line: "go to line",
|
||||
go_to_line_prompt: "go to line number:",
|
||||
undo: "undo",
|
||||
redo: "redo",
|
||||
change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
|
||||
highlight: "toggle syntax highlight on/off",
|
||||
reset_highlight: "reset highlight (if desyncronized from text)",
|
||||
help: "about",
|
||||
save: "save",
|
||||
save_as: "save as",
|
||||
load: "load",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Position",
|
||||
total: "Total",
|
||||
close_popup: "close popup",
|
||||
shortcuts: "Shortcuts",
|
||||
add_tab: "add tabulation to text",
|
||||
remove_tab: "remove tabulation to text",
|
||||
about_notice: "Notice: syntax highlight function is only for small text",
|
||||
toggle: "Toggle editor",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Processing...",
|
||||
fullscreen: "fullscreen"
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
editAreaLoader.lang["fr"]={
|
||||
new_document: "nouveau document (efface le contenu)",
|
||||
search_button: "rechercher / remplacer",
|
||||
search_command: "rechercher suivant / ouvrir la fenêtre de recherche",
|
||||
search: "rechercher",
|
||||
replace: "remplacer",
|
||||
replace_command: "remplacer / ouvrir la fenêtre de recherche",
|
||||
find_next: "rechercher",
|
||||
replace_all: "tout remplacer",
|
||||
reg_exp: "expr. régulière",
|
||||
match_case: "respecter la casse",
|
||||
not_found: "pas trouvé.",
|
||||
occurrence_replaced: "remplacements éffectués.",
|
||||
search_field_empty: "Le champ de recherche est vide.",
|
||||
restart_search_at_begin: "Fin du texte atteint, poursuite au début.",
|
||||
move_popup: "déplacer la fenêtre de recherche",
|
||||
font_size: "--Taille police--",
|
||||
go_to_line: "aller à la ligne",
|
||||
go_to_line_prompt: "aller a la ligne numero:",
|
||||
undo: "annuler",
|
||||
redo: "refaire",
|
||||
change_smooth_selection: "activer/désactiver des fonctions d'affichage (meilleur affichage mais plus de charge processeur)",
|
||||
highlight: "activer/désactiver la coloration syntaxique",
|
||||
reset_highlight: "réinitialiser la coloration syntaxique (si désyncronisée du texte)",
|
||||
help: "à propos",
|
||||
save: "sauvegarder",
|
||||
load: "charger",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Position",
|
||||
total: "Total",
|
||||
close_popup: "fermer le popup",
|
||||
shortcuts: "Racourcis clavier",
|
||||
add_tab: "ajouter une tabulation dans le texte",
|
||||
remove_tab: "retirer une tabulation dans le texte",
|
||||
about_notice: "Note: la coloration syntaxique n'est prévue que pour de courts textes.",
|
||||
toggle: "basculer l'éditeur",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Maj",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "chargement...",
|
||||
fullscreen: "plein écran"
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
editAreaLoader.lang["hr"]={
|
||||
new_document: "Novi dokument",
|
||||
search_button: "Traži i izmijeni",
|
||||
search_command: "Traži dalje / Otvori prozor za traženje",
|
||||
search: "Traži",
|
||||
replace: "Izmijeni",
|
||||
replace_command: "Izmijeni / Otvori prozor za traženje",
|
||||
find_next: "Traži dalje",
|
||||
replace_all: "Izmjeni sve",
|
||||
reg_exp: "Regularni izrazi",
|
||||
match_case: "Bitna vel. slova",
|
||||
not_found: "nije naðeno.",
|
||||
occurrence_replaced: "izmjenjenih.",
|
||||
search_field_empty: "Prazno polje za traženje!",
|
||||
restart_search_at_begin: "Došao do kraja. Poèeo od poèetka.",
|
||||
move_popup: "Pomakni prozor",
|
||||
font_size: "--Velièina teksta--",
|
||||
go_to_line: "Odi na redak",
|
||||
go_to_line_prompt: "Odi na redak:",
|
||||
undo: "Vrati natrag",
|
||||
redo: "Napravi ponovo",
|
||||
change_smooth_selection: "Ukljuèi/iskljuèi neke moguænosti prikaza (pametniji prikaz, ali zagušeniji CPU)",
|
||||
highlight: "Ukljuèi/iskljuèi bojanje sintakse",
|
||||
reset_highlight: "Ponovi kolorizaciju (ako je nesinkronizirana s tekstom)",
|
||||
help: "O edit_area",
|
||||
save: "Spremi",
|
||||
load: "Uèitaj",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Zn",
|
||||
position: "Pozicija",
|
||||
total: "Ukupno",
|
||||
close_popup: "Zatvori prozor",
|
||||
shortcuts: "Kratice",
|
||||
add_tab: "Dodaj tabulaciju",
|
||||
remove_tab: "Makni tabulaciju",
|
||||
about_notice: "Napomena: koloriziranje sintakse je samo za kratke kodove",
|
||||
toggle: "Prebaci naèin ureðivanja",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Procesiram...",
|
||||
fullscreen: "Cijeli prozor"
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
editAreaLoader.lang["it"]={
|
||||
new_document: "nuovo documento vuoto",
|
||||
search_button: "cerca e sostituisci",
|
||||
search_command: "trova successivo / apri finestra di ricerca",
|
||||
search: "cerca",
|
||||
replace: "sostituisci",
|
||||
replace_command: "sostituisci / apri finestra di ricerca",
|
||||
find_next: "trova successivo",
|
||||
replace_all: "sostituisci tutti",
|
||||
reg_exp: "espressioni regolari",
|
||||
match_case: "confronta maiuscole/minuscole<br />",
|
||||
not_found: "non trovato.",
|
||||
occurrence_replaced: "occorrenze sostituite.",
|
||||
search_field_empty: "Campo ricerca vuoto",
|
||||
restart_search_at_begin: "Fine del testo raggiunta. Ricomincio dall'inizio.",
|
||||
move_popup: "sposta popup di ricerca",
|
||||
font_size: "-- Dimensione --",
|
||||
go_to_line: "vai alla linea",
|
||||
go_to_line_prompt: "vai alla linea numero:",
|
||||
undo: "annulla",
|
||||
redo: "ripeti",
|
||||
change_smooth_selection: "abilita/disabilita alcune caratteristiche della visualizzazione",
|
||||
highlight: "abilita/disabilita colorazione della sintassi",
|
||||
reset_highlight: "aggiorna colorazione (se non sincronizzata)",
|
||||
help: "informazioni su...",
|
||||
save: "salva",
|
||||
load: "carica",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Posizione",
|
||||
total: "Totale",
|
||||
close_popup: "chiudi popup",
|
||||
shortcuts: "Scorciatoie",
|
||||
add_tab: "aggiungi tabulazione",
|
||||
remove_tab: "rimuovi tabulazione",
|
||||
about_notice: "Avviso: la colorazione della sintassi vale solo con testo piccolo",
|
||||
toggle: "Abilita/disabilita editor",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "In corso...",
|
||||
fullscreen: "fullscreen"
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
editAreaLoader.lang["ja"]={
|
||||
new_document: "新規作成",
|
||||
search_button: "検索・置換",
|
||||
search_command: "次を検索 / 検索窓を表示",
|
||||
search: "検索",
|
||||
replace: "置換",
|
||||
replace_command: "置換 / 置換窓を表示",
|
||||
find_next: "次を検索",
|
||||
replace_all: "全置換",
|
||||
reg_exp: "正規表現",
|
||||
match_case: "大文字小文字の区別",
|
||||
not_found: "見つかりません。",
|
||||
occurrence_replaced: "置換しました。",
|
||||
search_field_empty: "検索対象文字列が空です。",
|
||||
restart_search_at_begin: "終端に達しました、始めに戻ります",
|
||||
move_popup: "検索窓を移動",
|
||||
font_size: "--フォントサイズ--",
|
||||
go_to_line: "指定行へ移動",
|
||||
go_to_line_prompt: "指定行へ移動します:",
|
||||
undo: "元に戻す",
|
||||
redo: "やり直し",
|
||||
change_smooth_selection: "スムース表示の切り替え(CPUを使います)",
|
||||
highlight: "構文強調表示の切り替え",
|
||||
reset_highlight: "構文強調表示のリセット",
|
||||
help: "ヘルプを表示",
|
||||
save: "保存",
|
||||
load: "読み込み",
|
||||
line_abbr: "行",
|
||||
char_abbr: "文字",
|
||||
position: "位置",
|
||||
total: "合計",
|
||||
close_popup: "ポップアップを閉じる",
|
||||
shortcuts: "ショートカット",
|
||||
add_tab: "タブを挿入する",
|
||||
remove_tab: "タブを削除する",
|
||||
about_notice: "注意:構文強調表示は短いテキストでしか有効に機能しません。",
|
||||
toggle: "テキストエリアとeditAreaの切り替え",
|
||||
accesskey: "アクセスキー",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "処理中です...",
|
||||
fullscreen: "fullscreen"
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
editAreaLoader.lang["nl"]={
|
||||
new_document: "nieuw leeg document",
|
||||
search_button: "zoek en vervang",
|
||||
search_command: "zoek volgende / zoekscherm openen",
|
||||
search: "zoek",
|
||||
replace: "vervang",
|
||||
replace_command: "vervang / zoekscherm openen",
|
||||
find_next: "volgende vinden",
|
||||
replace_all: "alles vervangen",
|
||||
reg_exp: "reguliere expressies",
|
||||
match_case: "hoofdletter gevoelig",
|
||||
not_found: "niet gevonden.",
|
||||
occurrence_replaced: "object vervangen.",
|
||||
search_field_empty: "Zoek veld leeg",
|
||||
restart_search_at_begin: "Niet meer instanties gevonden, begin opnieuw",
|
||||
move_popup: "versleep zoek scherm",
|
||||
font_size: "--Letter grootte--",
|
||||
go_to_line: "Ga naar regel",
|
||||
go_to_line_prompt: "Ga naar regel nummer:",
|
||||
undo: "Ongedaan maken",
|
||||
redo: "Opnieuw doen",
|
||||
change_smooth_selection: "zet wat schermopties aan/uit (kan langzamer zijn)",
|
||||
highlight: "zet syntax highlight aan/uit",
|
||||
reset_highlight: "reset highlight (indien gedesynchronizeerd)",
|
||||
help: "informatie",
|
||||
save: "opslaan",
|
||||
load: "laden",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Positie",
|
||||
total: "Totaal",
|
||||
close_popup: "Popup sluiten",
|
||||
shortcuts: "Snelkoppelingen",
|
||||
add_tab: "voeg tabs toe in tekst",
|
||||
remove_tab: "verwijder tabs uit tekst",
|
||||
about_notice: "Notitie: syntax highlight functie is alleen voor kleine tekst",
|
||||
toggle: "geavanceerde bewerkingsopties",
|
||||
accesskey: "Accessknop",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Verwerken...",
|
||||
fullscreen: "fullscreen"
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
editAreaLoader.lang["pl"]={
|
||||
new_document: "nowy dokument",
|
||||
search_button: "znajdź i zamień",
|
||||
search_command: "znajdź następny",
|
||||
search: "znajdź",
|
||||
replace: "zamień",
|
||||
replace_command: "zamień",
|
||||
find_next: "następny",
|
||||
replace_all: "zamień wszystko",
|
||||
reg_exp: "wyrażenie regularne",
|
||||
match_case: "uwzględnij wielkość liter<br />",
|
||||
not_found: "nie znaleziono.",
|
||||
occurrence_replaced: "wystąpień zamieniono.",
|
||||
search_field_empty: "Nie wprowadzono tekstu",
|
||||
restart_search_at_begin: "Koniec dokumentu. Wyszukiwanie od początku.",
|
||||
move_popup: "przesuń okienko wyszukiwania",
|
||||
font_size: "Rozmiar",
|
||||
go_to_line: "idź do linii",
|
||||
go_to_line_prompt: "numer linii:",
|
||||
undo: "cofnij",
|
||||
redo: "przywróć",
|
||||
change_smooth_selection: "włącz/wyłącz niektóre opcje wyglądu (zaawansowane opcje wyglądu obciążają procesor)",
|
||||
highlight: "włącz/wyłącz podświetlanie składni",
|
||||
reset_highlight: "odśwież podświetlanie składni (jeśli rozsynchronizowało się z tekstem)",
|
||||
help: "o programie",
|
||||
save: "zapisz",
|
||||
load: "otwórz",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Zn",
|
||||
position: "Pozycja",
|
||||
total: "W sumie",
|
||||
close_popup: "zamknij okienko",
|
||||
shortcuts: "Skróty klawiaturowe",
|
||||
add_tab: "dodaj wcięcie do zaznaczonego tekstu",
|
||||
remove_tab: "usuń wcięcie",
|
||||
about_notice: "Uwaga: podświetlanie składni nie jest zalecane dla długich tekstów",
|
||||
toggle: "Włącz/wyłącz edytor",
|
||||
accesskey: "Alt+",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Przetwarzanie...",
|
||||
fullscreen: "fullscreen"
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
editAreaLoader.lang["pt"]={
|
||||
new_document: "Novo documento",
|
||||
search_button: "Localizar e substituir",
|
||||
search_command: "Localizar próximo",
|
||||
search: "Localizar",
|
||||
replace: "Substituir",
|
||||
replace_command: "Substituir",
|
||||
find_next: "Localizar",
|
||||
replace_all: "Subst. tudo",
|
||||
reg_exp: "Expressões regulares",
|
||||
match_case: "Diferenciar maiúsculas e minúsculas",
|
||||
not_found: "Não encontrado.",
|
||||
occurrence_replaced: "Ocorrências substituidas",
|
||||
search_field_empty: "Campo localizar vazio.",
|
||||
restart_search_at_begin: "Fim das ocorrências. Recomeçar do inicio.",
|
||||
move_popup: "Mover janela",
|
||||
font_size: "--Tamanho da fonte--",
|
||||
go_to_line: "Ir para linha",
|
||||
go_to_line_prompt: "Ir para a linha:",
|
||||
undo: "Desfazer",
|
||||
redo: "Refazer",
|
||||
change_smooth_selection: "Opções visuais",
|
||||
highlight: "Cores de sintaxe",
|
||||
reset_highlight: "Resetar cores (se não sincronizado)",
|
||||
help: "Sobre",
|
||||
save: "Salvar",
|
||||
load: "Carregar",
|
||||
line_abbr: "Ln",
|
||||
char_abbr: "Ch",
|
||||
position: "Posição",
|
||||
total: "Total",
|
||||
close_popup: "Fechar",
|
||||
shortcuts: "Shortcuts",
|
||||
add_tab: "Adicionar tabulação",
|
||||
remove_tab: "Remover tabulação",
|
||||
about_notice: "Atenção: Cores de sintaxe são indicados somente para textos pequenos",
|
||||
toggle: "Exibir editor",
|
||||
accesskey: "Accesskey",
|
||||
tab: "Tab",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "Processando...",
|
||||
fullscreen: "fullscreen"
|
||||
};
|
||||
@@ -1,46 +0,0 @@
|
||||
editAreaLoader.lang["zh_cn"]={
|
||||
new_document: "新建文件",
|
||||
search_button: "查找与替换",
|
||||
search_command: "新查找/打开查找框",
|
||||
search: "查找",
|
||||
replace: "替换",
|
||||
replace_command: "替换/打开查找框",
|
||||
find_next: "查找下一个",
|
||||
replace_all: "替换全部",
|
||||
reg_exp: "正则表达式",
|
||||
match_case: "大小写区分",
|
||||
not_found: "无匹配.",
|
||||
occurrence_replaced: "被替换次数.",
|
||||
search_field_empty: "查找关键词为空",
|
||||
restart_search_at_begin: "已达文字框底,重新开始.",
|
||||
move_popup: "移动查找窗口",
|
||||
font_size: "--文字大小--",
|
||||
go_to_line: "指定行数",
|
||||
go_to_line_prompt: "移动到指定行数:",
|
||||
undo: "上一步",
|
||||
redo: "下一步",
|
||||
change_smooth_selection: "激活/禁止某些显示特效",
|
||||
highlight: "代码高亮开关",
|
||||
reset_highlight: "重设代码高亮",
|
||||
help: "关于",
|
||||
save: "保存",
|
||||
save_as: "别存为",
|
||||
load: "加载",
|
||||
line_abbr: "行数",
|
||||
char_abbr: "字节",
|
||||
position: "位置",
|
||||
total: "总共",
|
||||
close_popup: "关闭窗口",
|
||||
shortcuts: "快捷键",
|
||||
add_tab: "添加间隔号",
|
||||
remove_tab: "删除间隔号",
|
||||
about_notice: "提示:代码高度功能只适用于小文档",
|
||||
toggle: "转换编辑",
|
||||
accesskey: "可访问键",
|
||||
tab: "间隔号",
|
||||
shift: "Shift",
|
||||
ctrl: "Ctrl",
|
||||
esc: "Esc",
|
||||
processing: "处理中...",
|
||||
fullscreen: "全屏"
|
||||
};
|
||||
@@ -1,69 +0,0 @@
|
||||
editAreaLoader.load_syntax["basic"] = {
|
||||
'COMMENT_SINGLE' : {1 : "'", 2 : 'rem'}
|
||||
,'COMMENT_MULTI' : { }
|
||||
,'QUOTEMARKS' : {1: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
'statements' : [
|
||||
'if','then','for','wend','while',
|
||||
'else','elseif','select','case','end select',
|
||||
'until','next','step','to','end if', 'call'
|
||||
]
|
||||
,'keywords' : [
|
||||
'sub', 'end sub', 'function', 'end function', 'exit',
|
||||
'exit function', 'dim', 'redim', 'shared', 'const',
|
||||
'is', 'absolute', 'access', 'any', 'append', 'as',
|
||||
'base', 'beep', 'binary', 'bload', 'bsave', 'chain',
|
||||
'chdir', 'circle', 'clear', 'close', 'cls', 'color',
|
||||
'com', 'common', 'data', 'date', 'declare', 'def',
|
||||
'defdbl', 'defint', 'deflng', 'defsng', 'defstr',
|
||||
'double', 'draw', 'environ', 'erase', 'error', 'field',
|
||||
'files', 'fn', 'get', 'gosub', 'goto', 'integer', 'key',
|
||||
'kill', 'let', 'line', 'list', 'locate', 'lock', 'long',
|
||||
'lprint', 'lset', 'mkdir', 'name', 'off', 'on', 'open',
|
||||
'option', 'out', 'output', 'paint', 'palette', 'pcopy',
|
||||
'poke', 'preset', 'print', 'pset', 'put', 'random',
|
||||
'randomize', 'read', 'reset', 'restore', 'resume',
|
||||
'return', 'rmdir', 'rset', 'run', 'screen', 'seg',
|
||||
'shell', 'single', 'sleep', 'sound', 'static', 'stop',
|
||||
'strig', 'string', 'swap', 'system', 'time', 'timer',
|
||||
'troff', 'tron', 'type', 'unlock', 'using', 'view',
|
||||
'wait', 'width', 'window', 'write'
|
||||
]
|
||||
,'functions' : [
|
||||
'abs', 'asc', 'atn', 'cdbl', 'chr', 'cint', 'clng',
|
||||
'cos', 'csng', 'csrlin', 'cvd', 'cvdmbf', 'cvi', 'cvl',
|
||||
'cvs', 'cvsmbf', 'eof', 'erdev', 'erl', 'err', 'exp',
|
||||
'fileattr', 'fix', 'fre', 'freefile', 'hex', 'inkey',
|
||||
'inp', 'input', 'instr', 'int', 'ioctl', 'lbound',
|
||||
'lcase', 'left', 'len', 'loc', 'lof', 'log', 'lpos',
|
||||
'ltrim', 'mid', 'mkd', 'mkdmbf', 'mki', 'mkl', 'mks',
|
||||
'mksmbf', 'oct', 'peek', 'pen', 'play', 'pmap', 'point',
|
||||
'pos', 'right', 'rnd', 'rtrim', 'seek', 'sgn', 'sin',
|
||||
'space', 'spc', 'sqr', 'stick', 'str', 'tab', 'tan',
|
||||
'ubound', 'ucase', 'val', 'varptr', 'varseg'
|
||||
]
|
||||
,'operators' : [
|
||||
'and', 'eqv', 'imp', 'mod', 'not', 'or', 'xor'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'+', '-', '/', '*', '=', '<', '>', '!', '&'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #99CC00;'
|
||||
,'QUOTESMARKS': 'color: #333399;'
|
||||
,'KEYWORDS' : {
|
||||
'keywords' : 'color: #3366FF;'
|
||||
,'functions' : 'color: #0000FF;'
|
||||
,'statements' : 'color: #3366FF;'
|
||||
,'operators' : 'color: #FF0000;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF0000;'
|
||||
,'DELIMITERS' : 'color: #0000FF;'
|
||||
|
||||
}
|
||||
};
|
||||
@@ -1,44 +0,0 @@
|
||||
editAreaLoader.load_syntax["brainfuck"] = {
|
||||
'COMMENT_SINGLE' : {}
|
||||
,'COMMENT_MULTI' : {}
|
||||
,'QUOTEMARKS' : {}
|
||||
,'KEYWORD_CASE_SENSITIVE' : true
|
||||
,'OPERATORS' :[
|
||||
'+', '-'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'[', ']'
|
||||
]
|
||||
,'REGEXPS' : {
|
||||
'bfispis' : {
|
||||
'search' : '()(\\.)()'
|
||||
,'class' : 'bfispis'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before'
|
||||
}
|
||||
,'bfupis' : {
|
||||
'search' : '()(\\,)()'
|
||||
,'class' : 'bfupis'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before'
|
||||
}
|
||||
,'bfmemory' : {
|
||||
'search' : '()([<>])()'
|
||||
,'class' : 'bfmemory'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before'
|
||||
}
|
||||
}
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'OPERATORS' : 'color: #88AA00;'
|
||||
,'DELIMITERS' : 'color: #00C138;'
|
||||
,'REGEXPS' : {
|
||||
'bfispis' : 'color: #EE0000;'
|
||||
,'bfupis' : 'color: #4455ee;'
|
||||
,'bfmemory' : 'color: #DD00DD;'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
editAreaLoader.load_syntax["c"] = {
|
||||
'COMMENT_SINGLE' : {1 : '//'}
|
||||
,'COMMENT_MULTI' : {'/*' : '*/'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : true
|
||||
,'KEYWORDS' : {
|
||||
'constants' : [
|
||||
'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true'
|
||||
]
|
||||
,'types' : [
|
||||
'FILE', 'auto', 'char', 'const', 'double',
|
||||
'extern', 'float', 'inline', 'int', 'long', 'register',
|
||||
'short', 'signed', 'size_t', 'static', 'struct',
|
||||
'time_t', 'typedef', 'union', 'unsigned', 'void',
|
||||
'volatile'
|
||||
]
|
||||
,'statements' : [
|
||||
'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof',
|
||||
'switch', 'while'
|
||||
]
|
||||
,'keywords' : [
|
||||
'break', 'case', 'continue', 'default', 'delete',
|
||||
'return'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'REGEXPS' : {
|
||||
'precompiler' : {
|
||||
'search' : '()(#[^\r\n]*)()'
|
||||
,'class' : 'precompiler'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before'
|
||||
}
|
||||
/* ,'precompilerstring' : {
|
||||
'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
|
||||
,'class' : 'precompilerstring'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before'
|
||||
}*/
|
||||
}
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
'constants' : 'color: #EE0000;'
|
||||
,'types' : 'color: #0000EE;'
|
||||
,'statements' : 'color: #60CA00;'
|
||||
,'keywords' : 'color: #48BDDF;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #0038E1;'
|
||||
,'REGEXPS' : {
|
||||
'precompiler' : 'color: #009900;'
|
||||
,'precompilerstring' : 'color: #994400;'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,65 +0,0 @@
|
||||
editAreaLoader.load_syntax["cpp"] = {
|
||||
'COMMENT_SINGLE' : {1 : '//'}
|
||||
,'COMMENT_MULTI' : {'/*' : '*/'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : true
|
||||
,'KEYWORDS' : {
|
||||
'constants' : [
|
||||
'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr',
|
||||
'true'
|
||||
]
|
||||
,'types' : [
|
||||
'FILE', 'auto', 'char', 'class', 'const', 'double',
|
||||
'extern', 'float', 'friend', 'inline', 'int',
|
||||
'iterator', 'long', 'map', 'operator', 'queue',
|
||||
'register', 'short', 'signed', 'size_t', 'stack',
|
||||
'static', 'string', 'struct', 'time_t', 'typedef',
|
||||
'union', 'unsigned', 'vector', 'void', 'volatile'
|
||||
]
|
||||
,'statements' : [
|
||||
'catch', 'do', 'else', 'enum', 'for', 'goto', 'if',
|
||||
'sizeof', 'switch', 'this', 'throw', 'try', 'while'
|
||||
]
|
||||
,'keywords' : [
|
||||
'break', 'case', 'continue', 'default', 'delete',
|
||||
'namespace', 'new', 'private', 'protected', 'public',
|
||||
'return', 'using'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'REGEXPS' : {
|
||||
'precompiler' : {
|
||||
'search' : '()(#[^\r\n]*)()'
|
||||
,'class' : 'precompiler'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before'
|
||||
}
|
||||
/* ,'precompilerstring' : {
|
||||
'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
|
||||
,'class' : 'precompilerstring'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before'
|
||||
}*/
|
||||
}
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
'constants' : 'color: #EE0000;'
|
||||
,'types' : 'color: #0000EE;'
|
||||
,'statements' : 'color: #60CA00;'
|
||||
,'keywords' : 'color: #48BDDF;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #0038E1;'
|
||||
,'REGEXPS' : {
|
||||
'precompiler' : 'color: #009900;'
|
||||
,'precompilerstring' : 'color: #994400;'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,84 +0,0 @@
|
||||
editAreaLoader.load_syntax["css"] = {
|
||||
'COMMENT_SINGLE' : {1 : '@'}
|
||||
,'COMMENT_MULTI' : {'/*' : '*/'}
|
||||
,'QUOTEMARKS' : ['"', "'"]
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
'attributes' : [
|
||||
'aqua', 'azimuth', 'background-attachment', 'background-color',
|
||||
'background-image', 'background-position', 'background-repeat',
|
||||
'background', 'border-bottom-color', 'border-bottom-style',
|
||||
'border-bottom-width', 'border-left-color', 'border-left-style',
|
||||
'border-left-width', 'border-right', 'border-right-color',
|
||||
'border-right-style', 'border-right-width', 'border-top-color',
|
||||
'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
|
||||
'border-left', 'border-width', 'border-color', 'border-spacing',
|
||||
'border-style', 'border-top', 'border', 'caption-side',
|
||||
'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
|
||||
'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
|
||||
'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
|
||||
'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
|
||||
'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
|
||||
'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
|
||||
'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
|
||||
'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
|
||||
'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
|
||||
'outline-width', 'overflow', 'padding-bottom', 'padding-left',
|
||||
'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
|
||||
'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
|
||||
'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
|
||||
'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
|
||||
'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
|
||||
'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
|
||||
'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
|
||||
'width', 'word-spacing', 'z-index', 'bottom', 'left'
|
||||
]
|
||||
,'values' : [
|
||||
'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
|
||||
'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
|
||||
'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic',
|
||||
'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
|
||||
'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
|
||||
'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
|
||||
'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
|
||||
'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
|
||||
'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
|
||||
'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
|
||||
'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
|
||||
'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
|
||||
'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
|
||||
'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
|
||||
'pointer', 'portrait', 'purple', 'px',
|
||||
'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
|
||||
's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square',
|
||||
'static', 'status-bar', 'super', 'sw-resize',
|
||||
'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent',
|
||||
'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
|
||||
'visible',
|
||||
'w-resize', 'wait', 'white', 'wider',
|
||||
'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
|
||||
'yellow', 'yes'
|
||||
]
|
||||
,'specials' : [
|
||||
'important'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
':', ';', '!', '.', '#'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'{', '}'
|
||||
]
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
'attributes' : 'color: #48BDDF;'
|
||||
,'values' : 'color: #2B60FF;'
|
||||
,'specials' : 'color: #FF0000;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #60CA00;'
|
||||
|
||||
}
|
||||
};
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* last update: 2006-08-24
|
||||
*/
|
||||
|
||||
editAreaLoader.load_syntax["html"] = {
|
||||
'COMMENT_SINGLE' : {}
|
||||
,'COMMENT_MULTI' : {'<!--' : '-->'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
]
|
||||
,'REGEXPS' : {
|
||||
'doctype' : {
|
||||
'search' : '()(<!DOCTYPE[^>]*>)()'
|
||||
,'class' : 'doctype'
|
||||
,'modifiers' : ''
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'tags' : {
|
||||
'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
|
||||
,'class' : 'tags'
|
||||
,'modifiers' : 'gi'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'attributes' : {
|
||||
'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
|
||||
,'class' : 'attributes'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
}
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
}
|
||||
,'OPERATORS' : 'color: #E775F0;'
|
||||
,'DELIMITERS' : ''
|
||||
,'REGEXPS' : {
|
||||
'attributes': 'color: #B1AC41;'
|
||||
,'tags': 'color: #E62253;'
|
||||
,'doctype': 'color: #8DCFB5;'
|
||||
,'test': 'color: #00FF00;'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,60 +0,0 @@
|
||||
editAreaLoader.load_syntax["js"] = {
|
||||
'COMMENT_SINGLE' : {1 : '//'}
|
||||
,'COMMENT_MULTI' : {'/*' : '*/'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : true
|
||||
,'KEYWORDS' : {
|
||||
'statements' : [
|
||||
'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
|
||||
'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
|
||||
'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
|
||||
'while', 'write', 'with'
|
||||
]
|
||||
,'keywords' : [
|
||||
'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
|
||||
'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
|
||||
'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',
|
||||
// the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
|
||||
'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
|
||||
'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
|
||||
'arguments', 'locationbar', 'pageXoffset', 'Form',
|
||||
'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
|
||||
'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
|
||||
'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
|
||||
'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
|
||||
'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
|
||||
'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
|
||||
'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
|
||||
'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
|
||||
'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
|
||||
'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
|
||||
'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
|
||||
'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'
|
||||
]
|
||||
,'functions' : [
|
||||
// common functions for Window object
|
||||
'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
|
||||
'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
|
||||
'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
|
||||
'stop'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'+', '-', '/', '*', '=', '<', '>', '%', '!'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
'statements' : 'color: #60CA00;'
|
||||
,'keywords' : 'color: #48BDDF;'
|
||||
,'functions' : 'color: #2B60FF;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #0038E1;'
|
||||
|
||||
}
|
||||
};
|
||||
@@ -1,82 +0,0 @@
|
||||
editAreaLoader.load_syntax["pas"] = {
|
||||
'COMMENT_SINGLE' : {}
|
||||
,'COMMENT_MULTI' : {'{' : '}', '(*':'*)'}
|
||||
,'QUOTEMARKS' : {1: '"', 2: "'"}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
'constants' : [
|
||||
'Blink', 'Black', 'Blue', 'Green', 'Cyan', 'Red',
|
||||
'Magenta', 'Brown', 'LightGray', 'DarkGray',
|
||||
'LightBlue', 'LightGreen', 'LightCyan', 'LightRed',
|
||||
'LightMagenta', 'Yellow', 'White', 'MaxSIntValue',
|
||||
'MaxUIntValue', 'maxint', 'maxLongint', 'maxSmallint',
|
||||
'erroraddr', 'errorcode', 'LineEnding'
|
||||
]
|
||||
,'keywords' : [
|
||||
'in', 'or', 'div', 'mod', 'and', 'shl', 'shr', 'xor',
|
||||
'pow', 'is', 'not','Absolute', 'And_then', 'Array',
|
||||
'Begin', 'Bindable', 'Case', 'Const', 'Do', 'Downto',
|
||||
'Else', 'End', 'Export', 'File', 'For', 'Function',
|
||||
'Goto', 'If', 'Import', 'Implementation', 'Inherited',
|
||||
'Inline', 'Interface', 'Label', 'Module', 'Nil',
|
||||
'Object', 'Of', 'Only', 'Operator', 'Or_else',
|
||||
'Otherwise', 'Packed', 'Procedure', 'Program',
|
||||
'Protected', 'Qualified', 'Record', 'Repeat',
|
||||
'Restricted', 'Set', 'Then', 'To', 'Type', 'Unit',
|
||||
'Until', 'Uses', 'Value', 'Var', 'Virtual', 'While',
|
||||
'With'
|
||||
]
|
||||
,'functions' : [
|
||||
'Abs', 'Addr', 'Append', 'Arctan', 'Assert', 'Assign',
|
||||
'Assigned', 'BinStr', 'Blockread', 'Blockwrite',
|
||||
'Break', 'Chdir', 'Chr', 'Close', 'CompareByte',
|
||||
'CompareChar', 'CompareDWord', 'CompareWord', 'Concat',
|
||||
'Continue', 'Copy', 'Cos', 'CSeg', 'Dec', 'Delete',
|
||||
'Dispose', 'DSeg', 'Eof', 'Eoln', 'Erase', 'Exclude',
|
||||
'Exit', 'Exp', 'Filepos', 'Filesize', 'FillByte',
|
||||
'Fillchar', 'FillDWord', 'Fillword', 'Flush', 'Frac',
|
||||
'Freemem', 'Getdir', 'Getmem', 'GetMemoryManager',
|
||||
'Halt', 'HexStr', 'Hi', 'High', 'Inc', 'Include',
|
||||
'IndexByte', 'IndexChar', 'IndexDWord', 'IndexWord',
|
||||
'Insert', 'IsMemoryManagerSet', 'Int', 'IOresult',
|
||||
'Length', 'Ln', 'Lo', 'LongJmp', 'Low', 'Lowercase',
|
||||
'Mark', 'Maxavail', 'Memavail', 'Mkdir', 'Move',
|
||||
'MoveChar0', 'New', 'Odd', 'OctStr', 'Ofs', 'Ord',
|
||||
'Paramcount', 'Paramstr', 'Pi', 'Pos', 'Power', 'Pred',
|
||||
'Ptr', 'Random', 'Randomize', 'Read', 'Readln',
|
||||
'Real2Double', 'Release', 'Rename', 'Reset', 'Rewrite',
|
||||
'Rmdir', 'Round', 'Runerror', 'Seek', 'SeekEof',
|
||||
'SeekEoln', 'Seg', 'SetMemoryManager', 'SetJmp',
|
||||
'SetLength', 'SetString', 'SetTextBuf', 'Sin', 'SizeOf',
|
||||
'Sptr', 'Sqr', 'Sqrt', 'SSeg', 'Str', 'StringOfChar',
|
||||
'Succ', 'Swap', 'Trunc', 'Truncate', 'Upcase', 'Val',
|
||||
'Write', 'WriteLn'
|
||||
]
|
||||
,'types' : [
|
||||
'Integer', 'Shortint', 'SmallInt', 'Longint',
|
||||
'Longword', 'Int64', 'Byte', 'Word', 'Cardinal',
|
||||
'QWord', 'Boolean', 'ByteBool', 'LongBool', 'Char',
|
||||
'Real', 'Single', 'Double', 'Extended', 'Comp',
|
||||
'String', 'ShortString', 'AnsiString', 'PChar'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'@', '*', '+', '-', '/', '^', ':=', '<', '=', '>'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']'
|
||||
]
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
'specials' : 'color: #EE0000;'
|
||||
,'constants' : 'color: #654321;'
|
||||
,'keywords' : 'color: #48BDDF;'
|
||||
,'functions' : 'color: #449922;'
|
||||
,'types' : 'color: #2B60FF;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #60CA00;'
|
||||
}
|
||||
};
|
||||
@@ -1,75 +0,0 @@
|
||||
editAreaLoader.load_syntax["php"] = {
|
||||
'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
|
||||
,'COMMENT_MULTI' : {'/*' : '*/'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
'statements' : [
|
||||
'include', 'require', 'include_once', 'require_once',
|
||||
'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
|
||||
'endif', 'switch', 'case', 'endswitch',
|
||||
'return', 'break', 'continue'
|
||||
]
|
||||
,'reserved' : [
|
||||
'_GET', '_POST', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
|
||||
'null', '__LINE__', '__FILE__',
|
||||
'false', '<?php', '?>', '<?',
|
||||
'<script language', '</script>',
|
||||
'true', 'var', 'default',
|
||||
'function', 'class', 'new', '&new', 'this',
|
||||
'__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
|
||||
'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
|
||||
'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
|
||||
'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
|
||||
'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
|
||||
'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
|
||||
'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
|
||||
|
||||
]
|
||||
,'functions' : [
|
||||
'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
|
||||
'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
|
||||
'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
|
||||
'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
|
||||
'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
|
||||
'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
|
||||
'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
|
||||
'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
|
||||
'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
|
||||
'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
|
||||
'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
|
||||
'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
|
||||
'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
|
||||
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'REGEXPS' : {
|
||||
// highlight all variables ($...)
|
||||
'variables' : {
|
||||
'search' : '()(\\$\\w+)()'
|
||||
,'class' : 'variables'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
}
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #879EFA;'
|
||||
,'KEYWORDS' : {
|
||||
'reserved' : 'color: #48BDDF;'
|
||||
,'functions' : 'color: #0040FD;'
|
||||
,'statements' : 'color: #60CA00;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF00FF;'
|
||||
,'DELIMITERS' : 'color: #2B60FF;'
|
||||
,'REGEXPS' : {
|
||||
'variables' : 'color: #E0BD54;'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,144 +0,0 @@
|
||||
/**
|
||||
* Python syntax v 1.1
|
||||
*
|
||||
* v1.1 by Andre Roberge (2006/12/27)
|
||||
*
|
||||
**/
|
||||
editAreaLoader.load_syntax["python"] = {
|
||||
'COMMENT_SINGLE' : {1 : '#'}
|
||||
,'COMMENT_MULTI' : {}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : true
|
||||
,'KEYWORDS' : {
|
||||
/*
|
||||
** Set 1: reserved words
|
||||
** http://python.org/doc/current/ref/keywords.html
|
||||
** Note: 'as' and 'with' have been added starting with Python 2.5
|
||||
*/
|
||||
'reserved' : [
|
||||
'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
|
||||
'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if',
|
||||
'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise',
|
||||
'return', 'try', 'while', 'with', 'yield'
|
||||
//the following are *almost* reserved; we'll treat them as such
|
||||
, 'False', 'True', 'None'
|
||||
]
|
||||
/*
|
||||
** Set 2: builtins
|
||||
** http://python.org/doc/current/lib/built-in-funcs.html
|
||||
*/
|
||||
,'builtins' : [
|
||||
'__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp',
|
||||
'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile',
|
||||
'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
|
||||
'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
|
||||
'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
|
||||
'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
|
||||
'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
|
||||
'vars', 'xrange', 'zip',
|
||||
// Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html
|
||||
//'False', 'True', 'None' have been included in 'reserved'
|
||||
'NotImplemented', 'Ellipsis',
|
||||
// Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
|
||||
'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
|
||||
'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
|
||||
'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
|
||||
'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
|
||||
'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
|
||||
'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
|
||||
'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
|
||||
'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
|
||||
'RuntimeWarning', 'FutureWarning',
|
||||
// we will include the string methods as well
|
||||
// http://python.org/doc/current/lib/string-methods.html
|
||||
'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
|
||||
'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',
|
||||
'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
|
||||
'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
|
||||
'translate', 'upper', 'zfill'
|
||||
]
|
||||
/*
|
||||
** Set 3: standard library
|
||||
** http://python.org/doc/current/lib/modindex.html
|
||||
*/
|
||||
,'stdlib' : [
|
||||
'__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
|
||||
'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
|
||||
'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
|
||||
'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
|
||||
'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler',
|
||||
'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
|
||||
'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
|
||||
'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
|
||||
'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
|
||||
'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
|
||||
'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
|
||||
'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
|
||||
'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
|
||||
'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
|
||||
'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
|
||||
'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
|
||||
'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
|
||||
'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
|
||||
'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
|
||||
're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
|
||||
'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
|
||||
'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
|
||||
'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
|
||||
'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
|
||||
'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
|
||||
'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
|
||||
'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
|
||||
'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
|
||||
'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
|
||||
'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib'
|
||||
|
||||
]
|
||||
/*
|
||||
** Set 4: special methods
|
||||
** http://python.org/doc/current/ref/specialnames.html
|
||||
*/
|
||||
,'special' : [
|
||||
// Basic customization: http://python.org/doc/current/ref/customization.html
|
||||
'__new__', '__init__', '__del__', '__repr__', '__str__',
|
||||
'__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
|
||||
'__hash__', '__nonzero__', '__unicode__', '__dict__',
|
||||
// Attribute access: http://python.org/doc/current/ref/attribute-access.html
|
||||
'__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
|
||||
'__delete__', '__slots__',
|
||||
// Class creation, callable objects
|
||||
'__metaclass__', '__call__',
|
||||
// Container types: http://python.org/doc/current/ref/sequence-types.html
|
||||
'__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
|
||||
'__getslice__', '__setslice__', '__delslice__',
|
||||
// Numeric types: http://python.org/doc/current/ref/numeric-types.html
|
||||
'__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
|
||||
'__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
|
||||
'__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
|
||||
'__long__','__lshift__',
|
||||
'__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
|
||||
'__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
|
||||
'__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__',
|
||||
'__sub__','__xor__'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #660066;'
|
||||
,'KEYWORDS' : {
|
||||
'reserved' : 'color: #0000FF;'
|
||||
,'builtins' : 'color: #009900;'
|
||||
,'stdlib' : 'color: #009900;'
|
||||
,'special': 'color: #006666;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #993300;'
|
||||
,'DELIMITERS' : 'color: #993300;'
|
||||
|
||||
}
|
||||
};
|
||||
@@ -1,52 +0,0 @@
|
||||
editAreaLoader.load_syntax["vb"] = {
|
||||
'COMMENT_SINGLE' : {1 : "'"}
|
||||
,'COMMENT_MULTI' : { }
|
||||
,'QUOTEMARKS' : {1: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
'statements' : [
|
||||
'if','then','for','each','while','do','loop',
|
||||
'else','elseif','select','case','end select',
|
||||
'until','next','step','to','in','end if'
|
||||
]
|
||||
,'keywords' : [
|
||||
'empty','isempty','nothing','null','isnull','true','false',
|
||||
'set','call',
|
||||
'sub','end sub','function','end function','exit','exit function',
|
||||
'dim','Mod','In','private','public','shared','const'
|
||||
]
|
||||
|
||||
,'functions' : [
|
||||
'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime',
|
||||
'Hour','IsDate','Minute','Month',
|
||||
'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year',
|
||||
'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency',
|
||||
'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct',
|
||||
'Rnd','Sgn','Sin','Sqr','Tan',
|
||||
'Array','Filter','IsArray','Join','LBound','Split','UBound',
|
||||
'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp',
|
||||
'String','StrReverse','UCase',
|
||||
'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric',
|
||||
'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion',
|
||||
'ScriptEngineMinorVersion','SetLocale','TypeName','VarType'
|
||||
]
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
'+', '-', '/', '*', '=', '<', '>', '!', '&'
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
'(', ')', '[', ']', '{', '}'
|
||||
]
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #99CC00;'
|
||||
,'QUOTESMARKS': 'color: #333399;'
|
||||
,'KEYWORDS' : {
|
||||
'keywords' : 'color: #3366FF;'
|
||||
,'functions' : 'color: #0000FF;'
|
||||
,'statements' : 'color: #3366FF;'
|
||||
}
|
||||
,'OPERATORS' : 'color: #FF0000;'
|
||||
,'DELIMITERS' : 'color: #0000FF;'
|
||||
|
||||
}
|
||||
};
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* last update: 2006-08-24
|
||||
*/
|
||||
|
||||
editAreaLoader.load_syntax["xml"] = {
|
||||
'COMMENT_SINGLE' : {}
|
||||
,'COMMENT_MULTI' : {'<!--' : '-->'}
|
||||
,'QUOTEMARKS' : {1: "'", 2: '"'}
|
||||
,'KEYWORD_CASE_SENSITIVE' : false
|
||||
,'KEYWORDS' : {
|
||||
}
|
||||
,'OPERATORS' :[
|
||||
]
|
||||
,'DELIMITERS' :[
|
||||
]
|
||||
,'REGEXPS' : {
|
||||
'xml' : {
|
||||
'search' : '()(<\\?[^>]*?\\?>)()'
|
||||
,'class' : 'xml'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'cdatas' : {
|
||||
'search' : '()(<!\\[CDATA\\[.*?\\]\\]>)()'
|
||||
,'class' : 'cdata'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'tags' : {
|
||||
'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
|
||||
,'class' : 'tags'
|
||||
,'modifiers' : 'gi'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
,'attributes' : {
|
||||
'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
|
||||
,'class' : 'attributes'
|
||||
,'modifiers' : 'g'
|
||||
,'execute' : 'before' // before or after
|
||||
}
|
||||
}
|
||||
,'STYLES' : {
|
||||
'COMMENTS': 'color: #AAAAAA;'
|
||||
,'QUOTESMARKS': 'color: #6381F8;'
|
||||
,'KEYWORDS' : {
|
||||
}
|
||||
,'OPERATORS' : 'color: #E775F0;'
|
||||
,'DELIMITERS' : ''
|
||||
,'REGEXPS' : {
|
||||
'attributes': 'color: #B1AC41;'
|
||||
,'tags': 'color: #E62253;'
|
||||
,'xml': 'color: #8DCFB5;'
|
||||
,'cdata': 'color: #50B020;'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
//function below added by logan (cailongqun [at] yahoo [dot] com [dot] cn) from www.phpletter.com
|
||||
function selectFile()
|
||||
{
|
||||
var selectedFileRowNum = $('#selectedFileRowNum').val();
|
||||
if(selectedFileRowNum != '' && $('#row' + selectedFileRowNum))
|
||||
{
|
||||
|
||||
// insert information now
|
||||
var url = $('#fileUrl'+selectedFileRowNum).val();
|
||||
window.opener.SetUrl( url ) ;
|
||||
window.close() ;
|
||||
|
||||
}else
|
||||
{
|
||||
alert(noFileSelected);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function cancelSelectFile()
|
||||
{
|
||||
// close popup window
|
||||
window.close() ;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
function selectFile(url)
|
||||
{
|
||||
window.opener.document.getElementById(elementId).value = url;
|
||||
window.close() ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function cancelSelectFile()
|
||||
{
|
||||
// close popup window
|
||||
window.close() ;
|
||||
}
|
||||
|
||||