@ -30,6 +30,8 @@ if ($detect->isMobile() && $setting->getValue('website_mobile_theme')) {
|
||||
}
|
||||
define('THEME', $theme);
|
||||
|
||||
//Required for Smarty
|
||||
require_once(CLASS_DIR . '/template.class.php');
|
||||
// Load smarty now that we have our theme defined
|
||||
require_once(INCLUDE_DIR . '/smarty.inc.php');
|
||||
|
||||
@ -59,5 +61,4 @@ require_once(CLASS_DIR . '/api.class.php');
|
||||
require_once(INCLUDE_DIR . '/lib/Michelf/Markdown.php');
|
||||
require_once(INCLUDE_DIR . '/lib/scrypt.php');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
202
public/include/classes/template.class.php
Normal file
@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
// Make sure we are called from index.php
|
||||
if (!defined('SECURITY'))
|
||||
die('Hacking attempt');
|
||||
|
||||
class Template extends Base {
|
||||
protected $table = 'templates';
|
||||
/**
|
||||
* Get filepath for template name based on current PAGE and ACTION
|
||||
*/
|
||||
public function getFullpath($name) {
|
||||
$chunks = array(PAGE);
|
||||
if( ACTION )
|
||||
$chunks[] = ACTION;
|
||||
$chunks[] = $name;
|
||||
|
||||
return join('/', $chunks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all available themes
|
||||
* Read theme folders from THEME_DIR
|
||||
*
|
||||
* @return array - list of available themes
|
||||
*/
|
||||
public function getThemes() {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
$aTmpThemes = glob(THEME_DIR . '/*');
|
||||
$aThemes = array();
|
||||
foreach ($aTmpThemes as $dir) {
|
||||
if (basename($dir) != 'cache' && basename($dir) != 'compile' && basename($dir) != 'mail') $aThemes[basename($dir)] = basename($dir);
|
||||
}
|
||||
return $aThemes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cached getActiveTemplates method
|
||||
*
|
||||
* @see getActiveTemplates
|
||||
*/
|
||||
private static $active_templates;
|
||||
public function cachedGetActiveTemplates() {
|
||||
if ( is_null(self::$active_templates) ) {
|
||||
self::$active_templates = $this->getActiveTemplates();
|
||||
}
|
||||
return self::$active_templates;
|
||||
}
|
||||
/**
|
||||
* Return the all active templates as hash,
|
||||
* where key is template and value is modified_at
|
||||
*
|
||||
* @return array - list of active templates
|
||||
*/
|
||||
public function getActiveTemplates() {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
$stmt = $this->mysqli->prepare("SELECT template, modified_at FROM $this->table WHERE active = 1");
|
||||
if ($stmt && $stmt->execute() && $result = $stmt->get_result()) {
|
||||
$rows = $result->fetch_all(MYSQLI_ASSOC);
|
||||
$hash = array();
|
||||
foreach($rows as $row) {
|
||||
$hash[$row['template']] = strtotime($row['modified_at']);
|
||||
}
|
||||
return $hash;
|
||||
}
|
||||
|
||||
$this->setErrorMessage('Failed to get active templates');
|
||||
$this->debug->append('Template::getActiveTemplates failed: ' . $this->mysqli->error);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the content of specific template file
|
||||
*
|
||||
* @param $file - file of template related to THEME_DIR
|
||||
* @return string - content of the template file
|
||||
*/
|
||||
public function getTemplateContent($file) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
$filepath = THEME_DIR . '/' . $file;
|
||||
return file_get_contents($filepath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all possible templates of specific theme
|
||||
*
|
||||
* @param $theme - name of the theme
|
||||
* @return array - list of available templates of theme
|
||||
*/
|
||||
public function getTemplateFiles($theme) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
$folder = THEME_DIR . '/' . $theme;
|
||||
|
||||
$dir = new RecursiveDirectoryIterator($folder);
|
||||
$ite = new RecursiveIteratorIterator($dir);
|
||||
$files = new RegexIterator($ite, '!'.preg_quote($folder, '!').'/(.*\.tpl$)!', RegexIterator::GET_MATCH);
|
||||
$fileList = array();
|
||||
foreach($files as $file) {
|
||||
$fileList[] = $theme . '/' . $file[1];
|
||||
}
|
||||
|
||||
return $fileList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tree of all possible templates, where key is filename
|
||||
* and value is whether array of subfiles if filename is directory
|
||||
* or true, if filename is file
|
||||
*
|
||||
* @param $themes - optional, themes array
|
||||
* @return array - tree of all templates
|
||||
*/
|
||||
public function getTemplatesTree($themes = null) {
|
||||
if( is_null($themes) )
|
||||
$themes = $this->getThemes();
|
||||
|
||||
$templates = array();
|
||||
foreach($themes as $theme) {
|
||||
$templates[$theme] = $this->_getTemplatesTreeRecursive(THEME_DIR . '/' . $theme);
|
||||
}
|
||||
|
||||
return $templates;
|
||||
|
||||
}
|
||||
|
||||
private function _getTemplatesTreeRecursive($path) {
|
||||
if( !is_dir($path) ) {
|
||||
return preg_match("/\.tpl$/", $path);
|
||||
} else {
|
||||
$subfiles = scandir($path);
|
||||
if ( $subfiles === false )
|
||||
return false;
|
||||
|
||||
$files = array();
|
||||
foreach($subfiles as $subfile) {
|
||||
if($subfile == ".." || $subfile == ".") continue;
|
||||
$subpath = $path . '/' . $subfile;
|
||||
$subsubfiles = $this->_getTemplatesTreeRecursive($subpath);
|
||||
if ( !$subsubfiles ) continue;
|
||||
$files[$subfile] = $subsubfiles;
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return specific template from database
|
||||
*
|
||||
* @param $template - name (filepath) of the template
|
||||
* @return array - result from database
|
||||
*/
|
||||
public function getEntry($template, $columns = "*") {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
|
||||
$stmt = $this->mysqli->prepare("SELECT $columns FROM $this->table WHERE template = ?");
|
||||
if ($stmt && $stmt->bind_param('s', $template) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $result->fetch_assoc();
|
||||
|
||||
$this->setErrorMessage('Failed to get the template');
|
||||
$this->debug->append('Template::getEntry failed: ' . $this->mysqli->error);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return last modified time of specific template from database
|
||||
*
|
||||
* @param $template - name (filepath) of the template
|
||||
* @return timestamp - last modified time of template
|
||||
*/
|
||||
public function getEntryMTime($template) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
|
||||
$entry = $this->getEntry($template, "modified_at, active");
|
||||
if ( $entry && $entry['active'])
|
||||
return strtotime($entry['modified_at']);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update template in database
|
||||
*
|
||||
* @param $template - name (filepath) of the template
|
||||
* @param $content - content of the template
|
||||
* @param $active - active flag for the template
|
||||
**/
|
||||
public function updateEntry($template, $content, $active=0) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
$stmt = $this->mysqli->prepare("INSERT INTO $this->table (`template`, `content`, `active`, `modified_at`) VALUES(?, ?, ?, CURRENT_TIMESTAMP) ON DUPLICATE KEY UPDATE content = VALUES(content), active = VALUES(active), modified_at = CURRENT_TIMESTAMP");
|
||||
if ($stmt && $stmt->bind_param('ssi', $template, $content, $active) && $stmt->execute())
|
||||
return true;
|
||||
|
||||
$this->setErrorMessage('Database error');
|
||||
$this->debug->append('Template::updateEntry failed: ' . $this->mysqli->error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$template = new Template();
|
||||
$template->setDebug($debug);
|
||||
$template->setMysql($mysqli);
|
||||
@ -3,12 +3,7 @@
|
||||
// Make sure we are called from index.php
|
||||
if (!defined('SECURITY')) die('Hacking attempt');
|
||||
|
||||
// Load a list of themes available
|
||||
$aTmpThemes = glob(THEME_DIR . '/*');
|
||||
$aThemes = array();
|
||||
foreach ($aTmpThemes as $dir) {
|
||||
if (basename($dir) != 'cache' && basename($dir) != 'compile' && basename($dir) != 'mail') $aThemes[basename($dir)] = basename($dir);
|
||||
}
|
||||
$aThemes = $template->getThemes();
|
||||
|
||||
// Load the settings available in this system
|
||||
$aSettings['website'][] = array(
|
||||
|
||||
50
public/include/pages/admin/templates.inc.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
// Make sure we are called from index.php
|
||||
if (!defined('SECURITY')) die('Hacking attempt');
|
||||
|
||||
// Check user to ensure they are admin
|
||||
if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) {
|
||||
header("HTTP/1.1 404 Page not found");
|
||||
die("404 Page not found");
|
||||
}
|
||||
|
||||
$aThemes = $template->getThemes();
|
||||
$aTemplates = $template->getTemplatesTree($aThemes);
|
||||
$aActiveTemplates = $template->cachedGetActiveTemplates();
|
||||
|
||||
$aFlatTemplatesList = array();
|
||||
foreach($aThemes as $sTheme) {
|
||||
$templates = $template->getTemplateFiles($sTheme);
|
||||
$aFlatTemplatesList = array_merge($aFlatTemplatesList, $templates);
|
||||
}
|
||||
|
||||
//Fetch current slug and template
|
||||
$sTemplate = @$_REQUEST['template'];
|
||||
if(!in_array($sTemplate, $aFlatTemplatesList)) {
|
||||
$sTemplate = $aFlatTemplatesList[0];
|
||||
}
|
||||
|
||||
$sOriginalTemplate = $template->getTemplateContent($sTemplate);
|
||||
|
||||
if (@$_REQUEST['do'] == 'save') {
|
||||
if ($template->updateEntry(@$_REQUEST['template'], @$_REQUEST['content'], @$_REQUEST['active'])) {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Page updated', 'TYPE' => 'success');
|
||||
} else {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Page update failed: ' . $template->getError(), 'TYPE' => 'errormsg');
|
||||
}
|
||||
}
|
||||
|
||||
$oDatabaseTemplate = $template->getEntry($sTemplate);
|
||||
|
||||
if ( $oDatabaseTemplate === false ) {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Can\'t fetch template from Database. Have you created `templates` table? Run 005_create_templates_table.sql from sql folder', 'TYPE' => 'errormsg');
|
||||
}
|
||||
|
||||
$smarty->assign("TEMPLATES", $aTemplates);
|
||||
$smarty->assign("ACTIVE_TEMPLATES", $aActiveTemplates);
|
||||
$smarty->assign("CURRENT_TEMPLATE", $sTemplate);
|
||||
$smarty->assign("ORIGINAL_TEMPLATE", $sOriginalTemplate);
|
||||
$smarty->assign("DATABASE_TEMPLATE", $oDatabaseTemplate);
|
||||
$smarty->assign("CONTENT", "default.tpl");
|
||||
?>
|
||||
@ -10,6 +10,145 @@ define('SMARTY_DIR', INCLUDE_DIR . '/smarty/libs/');
|
||||
// Include the actual smarty class file
|
||||
include(SMARTY_DIR . 'Smarty.class.php');
|
||||
|
||||
/**
|
||||
* Custom Smarty Template Resource for Pages
|
||||
* Get templates from Database
|
||||
* Allow admin to manage his templates from Backoffice
|
||||
*/
|
||||
class Smarty_Resource_Database extends Smarty_Resource_Custom {
|
||||
protected $template;
|
||||
|
||||
public function __construct($template) {
|
||||
$this->template = $template;
|
||||
}
|
||||
/**
|
||||
* Fetch a template and its modification time from database
|
||||
*
|
||||
* @param string $name template name
|
||||
* @param string $source template source
|
||||
* @param integer $mtime template modification timestamp (epoch)
|
||||
* @return void
|
||||
*/
|
||||
protected function fetch($name, &$source, &$mtime) {
|
||||
$oTemplate = $this->template->getEntry($this->fullTemplateName($name));
|
||||
if ( $oTemplate && $oTemplate['active'] ) {
|
||||
$source = $oTemplate['content'];
|
||||
$mtime = strtotime($oTemplate['modified_at']);
|
||||
} else {
|
||||
$source = null;
|
||||
$mtime = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a template's modification time from database
|
||||
*
|
||||
* @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source.
|
||||
* @param string $name template name
|
||||
* @return integer timestamp (epoch) the template was modified
|
||||
*/
|
||||
protected function fetchTimestamp($name) {
|
||||
$templates = $this->template->cachedGetActiveTemplates();
|
||||
$mtime = @$templates[$this->fullTemplateName($name)];
|
||||
return $mtime ? $mtime : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepend THEME name to template name to get valid DB primary key
|
||||
*
|
||||
* @param string $name template name
|
||||
*/
|
||||
protected function fullTemplateName($name) {
|
||||
return $this->normalisePath(THEME . "/" . $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalise a file path string so that it can be checked safely.
|
||||
*
|
||||
* Attempt to avoid invalid encoding bugs by transcoding the path. Then
|
||||
* remove any unnecessary path components including '.', '..' and ''.
|
||||
*
|
||||
* @param $path string
|
||||
* The path to normalise.
|
||||
* @return string
|
||||
* The path, normalised.
|
||||
* @see https://gist.github.com/thsutton/772287
|
||||
*/
|
||||
protected function normalisePath($path) {
|
||||
// Process the components
|
||||
$parts = explode('/', $path);
|
||||
$safe = array();
|
||||
foreach ($parts as $idx => $part) {
|
||||
if (empty($part) || ('.' == $part)) {
|
||||
continue;
|
||||
} elseif ('..' == $part) {
|
||||
array_pop($safe);
|
||||
continue;
|
||||
} else {
|
||||
$safe[] = $part;
|
||||
}
|
||||
}
|
||||
// Return the "clean" path
|
||||
$path = implode(DIRECTORY_SEPARATOR, $safe);
|
||||
return $path;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Smarty_Resource_Hybrid extends Smarty_Resource {
|
||||
|
||||
protected $databaseResource;
|
||||
|
||||
protected $fileResource;
|
||||
|
||||
public function __construct($dbResource, $fileResource) {
|
||||
$this->databaseResource = $dbResource;
|
||||
$this->fileResource = $fileResource;
|
||||
}
|
||||
|
||||
/**
|
||||
* populate Source Object with meta data from Resource
|
||||
*
|
||||
* @param Smarty_Template_Source $source source object
|
||||
* @param Smarty_Internal_Template $_template template object
|
||||
*/
|
||||
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) {
|
||||
if ( !@$_REQUEST['disable_template_override'] ) {
|
||||
$this->databaseResource->populate($source, $_template);
|
||||
if( $source->exists )
|
||||
return;
|
||||
}
|
||||
$source->type = 'file';
|
||||
return $this->fileResource->populate($source, $_template);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load template's source into current template object
|
||||
*
|
||||
* @param Smarty_Template_Source $source source object
|
||||
* @return string template source
|
||||
* @throws SmartyException if source cannot be loaded
|
||||
*/
|
||||
public function getContent(Smarty_Template_Source $source) {
|
||||
try {
|
||||
return $this->databaseResource->getContent($source);
|
||||
} catch(SmartyException $e) {
|
||||
return $this->fileResource->getContent($source);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine basename for compiled filename
|
||||
*
|
||||
* @param Smarty_Template_Source $source source object
|
||||
* @return string resource's basename
|
||||
*/
|
||||
public function getBasename(Smarty_Template_Source $source) {
|
||||
return $this->fileResource->getBasename($source);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// We initialize smarty here
|
||||
$debug->append('Instantiating Smarty Object', 3);
|
||||
$smarty = new Smarty;
|
||||
@ -18,6 +157,11 @@ $smarty = new Smarty;
|
||||
$debug->append('Define Smarty Paths', 3);
|
||||
$smarty->template_dir = BASEPATH . 'templates/' . THEME . '/';
|
||||
$smarty->compile_dir = BASEPATH . 'templates/compile/';
|
||||
$smarty->registerResource('hybrid', new Smarty_Resource_Hybrid(
|
||||
new Smarty_Resource_Database($template),
|
||||
new Smarty_Internal_Resource_File()
|
||||
));
|
||||
$smarty->default_resource_type = "hybrid";
|
||||
$smarty_cache_key = md5(serialize($_REQUEST) . serialize(@$_SESSION['USERDATA']['id']));
|
||||
|
||||
// Optional smarty caching, check Smarty documentation for details
|
||||
|
||||
@ -80,6 +80,9 @@ if (!empty($action)) {
|
||||
require_once(PAGES_DIR . '/' . $arrPages[$page]);
|
||||
}
|
||||
|
||||
define('PAGE', $page);
|
||||
define('ACTION', $action);
|
||||
|
||||
// For our content inclusion
|
||||
$smarty->assign("PAGE", $page);
|
||||
$smarty->assign("ACTION", $action);
|
||||
|
||||
278
public/site_assets/mpos/js/dynatree/GPL-LICENSE.txt
Normal file
@ -0,0 +1,278 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
7
public/site_assets/mpos/js/dynatree/MIT-License.txt
Normal file
@ -0,0 +1,7 @@
|
||||
Copyright (c) 2006-2013 Martin Wendt (http://wwWendt.de)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
3450
public/site_assets/mpos/js/dynatree/jquery.dynatree.js
Normal file
4
public/site_assets/mpos/js/dynatree/jquery.dynatree.min.js
vendored
Normal file
BIN
public/site_assets/mpos/js/dynatree/skin-vista/icons.gif
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
public/site_assets/mpos/js/dynatree/skin-vista/loading.gif
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
453
public/site_assets/mpos/js/dynatree/skin-vista/ui.dynatree.css
Normal file
@ -0,0 +1,453 @@
|
||||
/*******************************************************************************
|
||||
* Tree container
|
||||
*/
|
||||
ul.dynatree-container
|
||||
{
|
||||
font-family: tahoma, arial, helvetica;
|
||||
font-size: 10pt; /* font size should not be too big */
|
||||
white-space: nowrap;
|
||||
padding: 3px;
|
||||
margin: 0; /* issue 201 */
|
||||
background-color: white;
|
||||
border: 1px dotted gray;
|
||||
overflow: auto;
|
||||
height: 100%; /* issue 263 */
|
||||
}
|
||||
|
||||
ul.dynatree-container ul
|
||||
{
|
||||
padding: 0 0 0 16px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
ul.dynatree-container li
|
||||
{
|
||||
list-style-image: none;
|
||||
list-style-position: outside;
|
||||
list-style-type: none;
|
||||
-moz-background-clip:border;
|
||||
-moz-background-inline-policy: continuous;
|
||||
-moz-background-origin: padding;
|
||||
background-attachment: scroll;
|
||||
background-color: transparent;
|
||||
background-position: 0 0;
|
||||
background-repeat: repeat-y;
|
||||
background-image: none; /* no v-lines */
|
||||
|
||||
margin:0;
|
||||
padding:1px 0 0 0;
|
||||
}
|
||||
/* Suppress lines for last child node */
|
||||
ul.dynatree-container li.dynatree-lastsib
|
||||
{
|
||||
background-image: none;
|
||||
}
|
||||
/* Suppress lines if level is fixed expanded (option minExpandLevel) */
|
||||
ul.dynatree-no-connector > li
|
||||
{
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
/* Style, when control is disabled */
|
||||
.ui-dynatree-disabled ul.dynatree-container
|
||||
{
|
||||
opacity: 0.5;
|
||||
/* filter: alpha(opacity=50); /* Yields a css warning */
|
||||
background-color: silver;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Common icon definitions
|
||||
*/
|
||||
span.dynatree-empty,
|
||||
span.dynatree-vline,
|
||||
span.dynatree-connector,
|
||||
span.dynatree-expander,
|
||||
span.dynatree-icon,
|
||||
span.dynatree-checkbox,
|
||||
span.dynatree-radio,
|
||||
span.dynatree-drag-helper-img,
|
||||
#dynatree-drop-marker
|
||||
{
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
/* display: -moz-inline-box; /* @ FF 1+2 removed for issue 221*/
|
||||
/* -moz-box-align: start; /* issue 221 */
|
||||
display: inline-block; /* Required to make a span sizeable */
|
||||
vertical-align: top;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left;
|
||||
background-image: url("icons.gif");
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
/** Used by 'icon' node option: */
|
||||
ul.dynatree-container img
|
||||
{
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-left: 3px;
|
||||
vertical-align: top;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Lines and connectors
|
||||
*/
|
||||
|
||||
/*
|
||||
span.dynatree-empty
|
||||
{
|
||||
}
|
||||
span.dynatree-vline
|
||||
{
|
||||
}
|
||||
*/
|
||||
span.dynatree-connector
|
||||
{
|
||||
background-image: none;
|
||||
}
|
||||
/*
|
||||
.dynatree-lastsib span.dynatree-connector
|
||||
{
|
||||
}
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* Expander icon
|
||||
* Note: IE6 doesn't correctly evaluate multiples class names,
|
||||
* so we create combined class names that can be used in the CSS.
|
||||
*
|
||||
* Prefix: dynatree-exp-
|
||||
* 1st character: 'e': expanded, 'c': collapsed
|
||||
* 2nd character (optional): 'd': lazy (Delayed)
|
||||
* 3rd character (optional): 'l': Last sibling
|
||||
*/
|
||||
|
||||
span.dynatree-expander
|
||||
{
|
||||
background-position: 0px -80px;
|
||||
cursor: pointer;
|
||||
}
|
||||
span.dynatree-expander:hover
|
||||
{
|
||||
background-position: -16px -80px;
|
||||
}
|
||||
.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */
|
||||
{
|
||||
}
|
||||
.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */
|
||||
{
|
||||
}
|
||||
.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */
|
||||
{
|
||||
}
|
||||
.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */
|
||||
.dynatree-exp-ed span.dynatree-expander, /* Expanded, delayed, not last sibling */
|
||||
.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */
|
||||
.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */
|
||||
{
|
||||
background-position: -32px -80px;
|
||||
}
|
||||
.dynatree-exp-e span.dynatree-expander:hover, /* Expanded, not delayed, not last sibling */
|
||||
.dynatree-exp-ed span.dynatree-expander:hover, /* Expanded, delayed, not last sibling */
|
||||
.dynatree-exp-el span.dynatree-expander:hover, /* Expanded, not delayed, last sibling */
|
||||
.dynatree-exp-edl span.dynatree-expander:hover /* Expanded, delayed, last sibling */
|
||||
{
|
||||
background-position: -48px -80px;
|
||||
}
|
||||
.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */
|
||||
{
|
||||
background-position: 0 0;
|
||||
background-image: url("loading.gif");
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Checkbox icon
|
||||
*/
|
||||
span.dynatree-checkbox
|
||||
{
|
||||
margin-left: 3px;
|
||||
background-position: 0px -32px;
|
||||
}
|
||||
span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -16px -32px;
|
||||
}
|
||||
|
||||
.dynatree-partsel span.dynatree-checkbox
|
||||
{
|
||||
background-position: -64px -32px;
|
||||
}
|
||||
.dynatree-partsel span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -80px -32px;
|
||||
}
|
||||
|
||||
.dynatree-selected span.dynatree-checkbox
|
||||
{
|
||||
background-position: -32px -32px;
|
||||
}
|
||||
.dynatree-selected span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -48px -32px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Radiobutton icon
|
||||
* This is a customization, that may be activated by overriding the 'checkbox'
|
||||
* class name as 'dynatree-radio' in the tree options.
|
||||
*/
|
||||
span.dynatree-radio
|
||||
{
|
||||
margin-left: 3px;
|
||||
background-position: 0px -48px;
|
||||
}
|
||||
span.dynatree-radio:hover
|
||||
{
|
||||
background-position: -16px -48px;
|
||||
}
|
||||
|
||||
.dynatree-partsel span.dynatree-radio
|
||||
{
|
||||
background-position: -64px -48px;
|
||||
}
|
||||
.dynatree-partsel span.dynatree-radio:hover
|
||||
{
|
||||
background-position: -80px -48px;
|
||||
}
|
||||
|
||||
.dynatree-selected span.dynatree-radio
|
||||
{
|
||||
background-position: -32px -48px;
|
||||
}
|
||||
.dynatree-selected span.dynatree-radio:hover
|
||||
{
|
||||
background-position: -48px -48px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Node type icon
|
||||
* Note: IE6 doesn't correctly evaluate multiples class names,
|
||||
* so we create combined class names that can be used in the CSS.
|
||||
*
|
||||
* Prefix: dynatree-ico-
|
||||
* 1st character: 'e': expanded, 'c': collapsed
|
||||
* 2nd character (optional): 'f': folder
|
||||
*/
|
||||
|
||||
span.dynatree-icon /* Default icon */
|
||||
{
|
||||
margin-left: 3px;
|
||||
background-position: 0px 0px;
|
||||
}
|
||||
|
||||
.dynatree-has-children span.dynatree-icon /* Default icon */
|
||||
{
|
||||
/* background-position: 0px -16px; */
|
||||
}
|
||||
|
||||
.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */
|
||||
{
|
||||
background-position: 0px -16px;
|
||||
}
|
||||
|
||||
.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */
|
||||
{
|
||||
background-position: -64px -16px;
|
||||
}
|
||||
|
||||
/* Status node icons */
|
||||
|
||||
.dynatree-statusnode-wait span.dynatree-icon
|
||||
{
|
||||
background-image: url("loading.gif");
|
||||
}
|
||||
|
||||
.dynatree-statusnode-error span.dynatree-icon
|
||||
{
|
||||
background-position: 0px -112px;
|
||||
/* background-image: url("ltError.gif");*/
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Node titles
|
||||
*/
|
||||
|
||||
/* @Chrome: otherwise hit area of node titles is broken (issue 133)
|
||||
Removed again for issue 165; (133 couldn't be reproduced) */
|
||||
span.dynatree-node
|
||||
{
|
||||
/* display: -moz-inline-box; /* issue 133, 165, 172, 192. removed for issue 221 */
|
||||
/* -moz-box-align: start; /* issue 221 */
|
||||
display: inline-block; /* issue 373 Required to make a span sizeable */
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
/* Remove blue color and underline from title links */
|
||||
ul.dynatree-container a
|
||||
/*, ul.dynatree-container a:visited*/
|
||||
{
|
||||
color: black; /* inherit doesn't work on IE */
|
||||
text-decoration: none;
|
||||
vertical-align: top;
|
||||
margin: 0px;
|
||||
margin-left: 3px;
|
||||
/* outline: 0; /* @ Firefox, prevent dotted border after click */
|
||||
/* Set transparent border to prevent jumping when active node gets a border
|
||||
(we can do this, because this theme doesn't use vertical lines)
|
||||
*/
|
||||
border: 1px solid white; /* Note: 'transparent' would not work in IE6 */
|
||||
|
||||
}
|
||||
|
||||
ul.dynatree-container a:hover
|
||||
{
|
||||
/* text-decoration: underline; */
|
||||
background: #F2F7FD; /* light blue */
|
||||
border-color: #B8D6FB; /* darker light blue */
|
||||
}
|
||||
|
||||
span.dynatree-node a
|
||||
{
|
||||
display: inline-block; /* Better alignment, when title contains <br> */
|
||||
/* vertical-align: top;*/
|
||||
padding-left: 3px;
|
||||
padding-right: 3px; /* Otherwise italic font will be outside bounds */
|
||||
/* line-height: 16px; /* should be the same as img height, in case 16 px */
|
||||
}
|
||||
span.dynatree-folder a
|
||||
{
|
||||
/* font-weight: bold; */ /* custom */
|
||||
}
|
||||
|
||||
ul.dynatree-container a:focus,
|
||||
span.dynatree-focused a:link /* @IE */
|
||||
{
|
||||
background-color: #EFEBDE; /* gray */
|
||||
}
|
||||
|
||||
span.dynatree-has-children a
|
||||
{
|
||||
/* font-style: oblique; /* custom: */
|
||||
}
|
||||
|
||||
span.dynatree-expanded a
|
||||
{
|
||||
}
|
||||
|
||||
span.dynatree-selected a
|
||||
{
|
||||
/* color: green; */
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
span.dynatree-active a
|
||||
{
|
||||
border: 1px solid #99DEFD;
|
||||
background-color: #D8F0FA;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Drag'n'drop support
|
||||
*/
|
||||
|
||||
/*** Helper object ************************************************************/
|
||||
div.dynatree-drag-helper
|
||||
{
|
||||
}
|
||||
div.dynatree-drag-helper a
|
||||
{
|
||||
border: 1px solid gray;
|
||||
background-color: white;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
span.dynatree-drag-helper-img
|
||||
{
|
||||
/*
|
||||
position: relative;
|
||||
left: -16px;
|
||||
*/
|
||||
}
|
||||
div.dynatree-drag-helper /*.dynatree-drop-accept*/
|
||||
{
|
||||
/* border-color: green;
|
||||
background-color: red;*/
|
||||
}
|
||||
div.dynatree-drop-accept span.dynatree-drag-helper-img
|
||||
{
|
||||
background-position: -32px -112px;
|
||||
}
|
||||
div.dynatree-drag-helper.dynatree-drop-reject
|
||||
{
|
||||
border-color: red;
|
||||
}
|
||||
div.dynatree-drop-reject span.dynatree-drag-helper-img
|
||||
{
|
||||
background-position: -16px -112px;
|
||||
}
|
||||
|
||||
/*** Drop marker icon *********************************************************/
|
||||
|
||||
#dynatree-drop-marker
|
||||
{
|
||||
width: 24px;
|
||||
position: absolute;
|
||||
background-position: 0 -128px;
|
||||
margin: 0;
|
||||
}
|
||||
#dynatree-drop-marker.dynatree-drop-after,
|
||||
#dynatree-drop-marker.dynatree-drop-before
|
||||
{
|
||||
width:64px;
|
||||
background-position: 0 -144px;
|
||||
}
|
||||
#dynatree-drop-marker.dynatree-drop-copy
|
||||
{
|
||||
background-position: -64px -128px;
|
||||
}
|
||||
#dynatree-drop-marker.dynatree-drop-move
|
||||
{
|
||||
background-position: -64px -128px;
|
||||
}
|
||||
|
||||
/*** Source node while dragging ***********************************************/
|
||||
|
||||
span.dynatree-drag-source
|
||||
{
|
||||
/* border: 1px dotted gray; */
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
span.dynatree-drag-source a
|
||||
{
|
||||
color: gray;
|
||||
}
|
||||
|
||||
/*** Target node while dragging cursor is over it *****************************/
|
||||
|
||||
span.dynatree-drop-target
|
||||
{
|
||||
/*border: 1px solid gray;*/
|
||||
}
|
||||
span.dynatree-drop-target a
|
||||
{
|
||||
}
|
||||
span.dynatree-drop-target.dynatree-drop-accept a
|
||||
{
|
||||
/*border: 1px solid green;*/
|
||||
background-color: #3169C6 !important;
|
||||
color: white !important; /* @ IE6 */
|
||||
text-decoration: none;
|
||||
}
|
||||
span.dynatree-drop-target.dynatree-drop-reject
|
||||
{
|
||||
/*border: 1px solid red;*/
|
||||
}
|
||||
span.dynatree-drop-target.dynatree-drop-after a
|
||||
{
|
||||
}
|
||||
BIN
public/site_assets/mpos/js/dynatree/skin/icons-rtl.gif
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/site_assets/mpos/js/dynatree/skin/icons.gif
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/site_assets/mpos/js/dynatree/skin/loading.gif
Normal file
|
After Width: | Height: | Size: 570 B |
441
public/site_assets/mpos/js/dynatree/skin/ui.dynatree.css
Normal file
@ -0,0 +1,441 @@
|
||||
/*******************************************************************************
|
||||
* Tree container
|
||||
*/
|
||||
ul.dynatree-container
|
||||
{
|
||||
font-family: tahoma, arial, helvetica;
|
||||
font-size: 10pt; /* font size should not be too big */
|
||||
white-space: nowrap;
|
||||
padding: 3px;
|
||||
margin: 0; /* issue 201 */
|
||||
background-color: white;
|
||||
border: 1px dotted gray;
|
||||
overflow: auto;
|
||||
height: 100%; /* issue 263 */
|
||||
}
|
||||
|
||||
ul.dynatree-container ul
|
||||
{
|
||||
padding: 0 0 0 16px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
ul.dynatree-container li
|
||||
{
|
||||
list-style-image: none;
|
||||
list-style-position: outside;
|
||||
list-style-type: none;
|
||||
-moz-background-clip:border;
|
||||
-moz-background-inline-policy: continuous;
|
||||
-moz-background-origin: padding;
|
||||
background-attachment: scroll;
|
||||
background-color: transparent;
|
||||
background-repeat: repeat-y;
|
||||
background-image: url("vline.gif");
|
||||
background-position: 0 0;
|
||||
/*
|
||||
background-image: url("icons_96x256.gif");
|
||||
background-position: -80px -64px;
|
||||
*/
|
||||
margin: 0;
|
||||
padding: 1px 0 0 0;
|
||||
}
|
||||
/* Suppress lines for last child node */
|
||||
ul.dynatree-container li.dynatree-lastsib
|
||||
{
|
||||
background-image: none;
|
||||
}
|
||||
/* Suppress lines if level is fixed expanded (option minExpandLevel) */
|
||||
ul.dynatree-no-connector > li
|
||||
{
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
/* Style, when control is disabled */
|
||||
.ui-dynatree-disabled ul.dynatree-container
|
||||
{
|
||||
opacity: 0.5;
|
||||
/* filter: alpha(opacity=50); /* Yields a css warning */
|
||||
background-color: silver;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Common icon definitions
|
||||
*/
|
||||
span.dynatree-empty,
|
||||
span.dynatree-vline,
|
||||
span.dynatree-connector,
|
||||
span.dynatree-expander,
|
||||
span.dynatree-icon,
|
||||
span.dynatree-checkbox,
|
||||
span.dynatree-radio,
|
||||
span.dynatree-drag-helper-img,
|
||||
#dynatree-drop-marker
|
||||
{
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
/* display: -moz-inline-box; /* @ FF 1+2 removed for issue 221 */
|
||||
/* -moz-box-align: start; /* issue 221 */
|
||||
display: inline-block; /* Required to make a span sizeable */
|
||||
vertical-align: top;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left;
|
||||
background-image: url("icons.gif");
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
/** Used by 'icon' node option: */
|
||||
ul.dynatree-container img
|
||||
{
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-left: 3px;
|
||||
vertical-align: top;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Lines and connectors
|
||||
*/
|
||||
|
||||
span.dynatree-connector
|
||||
{
|
||||
background-position: -16px -64px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Expander icon
|
||||
* Note: IE6 doesn't correctly evaluate multiples class names,
|
||||
* so we create combined class names that can be used in the CSS.
|
||||
*
|
||||
* Prefix: dynatree-exp-
|
||||
* 1st character: 'e': expanded, 'c': collapsed
|
||||
* 2nd character (optional): 'd': lazy (Delayed)
|
||||
* 3rd character (optional): 'l': Last sibling
|
||||
*/
|
||||
|
||||
span.dynatree-expander
|
||||
{
|
||||
background-position: 0px -80px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */
|
||||
{
|
||||
background-position: 0px -96px;
|
||||
}
|
||||
.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */
|
||||
{
|
||||
background-position: -64px -80px;
|
||||
}
|
||||
.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */
|
||||
{
|
||||
background-position: -64px -96px;
|
||||
}
|
||||
.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */
|
||||
.dynatree-exp-ed span.dynatree-expander /* Expanded, delayed, not last sibling */
|
||||
{
|
||||
background-position: -32px -80px;
|
||||
}
|
||||
.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */
|
||||
.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */
|
||||
{
|
||||
background-position: -32px -96px;
|
||||
}
|
||||
.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */
|
||||
{
|
||||
background-position: 0 0;
|
||||
background-image: url("loading.gif");
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Checkbox icon
|
||||
*/
|
||||
span.dynatree-checkbox
|
||||
{
|
||||
margin-left: 3px;
|
||||
background-position: 0px -32px;
|
||||
}
|
||||
span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -16px -32px;
|
||||
}
|
||||
|
||||
.dynatree-partsel span.dynatree-checkbox
|
||||
{
|
||||
background-position: -64px -32px;
|
||||
}
|
||||
.dynatree-partsel span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -80px -32px;
|
||||
}
|
||||
|
||||
.dynatree-selected span.dynatree-checkbox
|
||||
{
|
||||
background-position: -32px -32px;
|
||||
}
|
||||
.dynatree-selected span.dynatree-checkbox:hover
|
||||
{
|
||||
background-position: -48px -32px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Radiobutton icon
|
||||
* This is a customization, that may be activated by overriding the 'checkbox'
|
||||
* class name as 'dynatree-radio' in the tree options.
|
||||
*/
|
||||
span.dynatree-radio
|
||||
{
|
||||
margin-left: 3px;
|
||||
background-position: 0px -48px;
|
||||
}
|
||||
span.dynatree-radio:hover
|
||||
{
|
||||
background-position: -16px -48px;
|
||||
}
|
||||
|
||||
.dynatree-partsel span.dynatree-radio
|
||||
{
|
||||
background-position: -64px -48px;
|
||||
}
|
||||
.dynatree-partsel span.dynatree-radio:hover
|
||||
{
|
||||
background-position: -80px -48px;
|
||||
}
|
||||
|
||||
.dynatree-selected span.dynatree-radio
|
||||
{
|
||||
background-position: -32px -48px;
|
||||
}
|
||||
.dynatree-selected span.dynatree-radio:hover
|
||||
{
|
||||
background-position: -48px -48px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Node type icon
|
||||
* Note: IE6 doesn't correctly evaluate multiples class names,
|
||||
* so we create combined class names that can be used in the CSS.
|
||||
*
|
||||
* Prefix: dynatree-ico-
|
||||
* 1st character: 'e': expanded, 'c': collapsed
|
||||
* 2nd character (optional): 'f': folder
|
||||
*/
|
||||
|
||||
span.dynatree-icon /* Default icon */
|
||||
{
|
||||
margin-left: 3px;
|
||||
background-position: 0px 0px;
|
||||
}
|
||||
|
||||
.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */
|
||||
{
|
||||
background-position: 0px -16px;
|
||||
}
|
||||
|
||||
.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */
|
||||
{
|
||||
background-position: -64px -16px;
|
||||
}
|
||||
|
||||
/* Status node icons */
|
||||
|
||||
.dynatree-statusnode-wait span.dynatree-icon
|
||||
{
|
||||
background-image: url("loading.gif");
|
||||
}
|
||||
|
||||
.dynatree-statusnode-error span.dynatree-icon
|
||||
{
|
||||
background-position: 0px -112px;
|
||||
/* background-image: url("ltError.gif");*/
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Node titles
|
||||
*/
|
||||
|
||||
/* @Chrome: otherwise hit area of node titles is broken (issue 133)
|
||||
Removed again for issue 165; (133 couldn't be reproduced) */
|
||||
span.dynatree-node
|
||||
{
|
||||
/* display: -moz-inline-box; /* issue 133, 165, 172, 192. removed for issue 221*/
|
||||
/* -moz-box-align: start; /* issue 221 */
|
||||
display: inline-block; /* issue 373 Required to make a span sizeable */
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
/* Remove blue color and underline from title links */
|
||||
ul.dynatree-container a
|
||||
/*, ul.dynatree-container a:visited*/
|
||||
{
|
||||
color: black; /* inherit doesn't work on IE */
|
||||
text-decoration: none;
|
||||
vertical-align: top;
|
||||
margin: 0px;
|
||||
margin-left: 3px;
|
||||
/* outline: 0; /* @ Firefox, prevent dotted border after click */
|
||||
}
|
||||
|
||||
ul.dynatree-container a:hover
|
||||
{
|
||||
/* text-decoration: underline; */
|
||||
background-color: #F2F7FD; /* light blue */
|
||||
border-color: #B8D6FB; /* darker light blue */
|
||||
}
|
||||
|
||||
span.dynatree-node a
|
||||
{
|
||||
font-size: 10pt; /* required for IE, quirks mode */
|
||||
display: inline-block; /* Better alignment, when title contains <br> */
|
||||
/* vertical-align: top;*/
|
||||
padding-left: 3px;
|
||||
padding-right: 3px; /* Otherwise italic font will be outside bounds */
|
||||
/* line-height: 16px; /* should be the same as img height, in case 16 px */
|
||||
}
|
||||
span.dynatree-folder a
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.dynatree-container a:focus,
|
||||
span.dynatree-focused a:link /* @IE */
|
||||
{
|
||||
background-color: #EFEBDE; /* gray */
|
||||
}
|
||||
|
||||
span.dynatree-has-children a
|
||||
{
|
||||
}
|
||||
|
||||
span.dynatree-expanded a
|
||||
{
|
||||
}
|
||||
|
||||
span.dynatree-selected a
|
||||
{
|
||||
color: green;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
span.dynatree-active a
|
||||
{
|
||||
background-color: #3169C6 !important;
|
||||
color: white !important; /* @ IE6 */
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Drag'n'drop support
|
||||
*/
|
||||
|
||||
/*** Helper object ************************************************************/
|
||||
div.dynatree-drag-helper
|
||||
{
|
||||
}
|
||||
div.dynatree-drag-helper a
|
||||
{
|
||||
border: 1px solid gray;
|
||||
background-color: white;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
span.dynatree-drag-helper-img
|
||||
{
|
||||
/*
|
||||
position: relative;
|
||||
left: -16px;
|
||||
*/
|
||||
}
|
||||
div.dynatree-drag-helper /*.dynatree-drop-accept*/
|
||||
{
|
||||
|
||||
/* border-color: green;
|
||||
background-color: red;*/
|
||||
}
|
||||
div.dynatree-drop-accept span.dynatree-drag-helper-img
|
||||
{
|
||||
background-position: -32px -112px;
|
||||
}
|
||||
div.dynatree-drag-helper.dynatree-drop-reject
|
||||
{
|
||||
border-color: red;
|
||||
}
|
||||
div.dynatree-drop-reject span.dynatree-drag-helper-img
|
||||
{
|
||||
background-position: -16px -112px;
|
||||
}
|
||||
|
||||
/*** Drop marker icon *********************************************************/
|
||||
|
||||
#dynatree-drop-marker
|
||||
{
|
||||
width: 24px;
|
||||
position: absolute;
|
||||
background-position: 0 -128px;
|
||||
margin: 0;
|
||||
/* border: 1px solid red; */
|
||||
}
|
||||
#dynatree-drop-marker.dynatree-drop-after,
|
||||
#dynatree-drop-marker.dynatree-drop-before
|
||||
{
|
||||
width:64px;
|
||||
background-position: 0 -144px;
|
||||
}
|
||||
#dynatree-drop-marker.dynatree-drop-copy
|
||||
{
|
||||
background-position: -64px -128px;
|
||||
}
|
||||
#dynatree-drop-marker.dynatree-drop-move
|
||||
{
|
||||
background-position: -64px -128px;
|
||||
}
|
||||
|
||||
/*** Source node while dragging ***********************************************/
|
||||
|
||||
span.dynatree-drag-source
|
||||
{
|
||||
/* border: 1px dotted gray; */
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
span.dynatree-drag-source a
|
||||
{
|
||||
color: gray;
|
||||
}
|
||||
|
||||
/*** Target node while dragging cursor is over it *****************************/
|
||||
|
||||
span.dynatree-drop-target
|
||||
{
|
||||
/*border: 1px solid gray;*/
|
||||
}
|
||||
span.dynatree-drop-target a
|
||||
{
|
||||
}
|
||||
span.dynatree-drop-target.dynatree-drop-accept a
|
||||
{
|
||||
/*border: 1px solid green;*/
|
||||
background-color: #3169C6 !important;
|
||||
color: white !important; /* @ IE6 */
|
||||
text-decoration: none;
|
||||
}
|
||||
span.dynatree-drop-target.dynatree-drop-reject
|
||||
{
|
||||
/*border: 1px solid red;*/
|
||||
}
|
||||
span.dynatree-drop-target.dynatree-drop-after a
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Custom node classes (sample)
|
||||
*/
|
||||
|
||||
span.custom1 a
|
||||
{
|
||||
background-color: maroon;
|
||||
color: yellow;
|
||||
}
|
||||
BIN
public/site_assets/mpos/js/dynatree/skin/vline-rtl.gif
Normal file
|
After Width: | Height: | Size: 842 B |
BIN
public/site_assets/mpos/js/dynatree/skin/vline.gif
Normal file
|
After Width: | Height: | Size: 844 B |
125
public/site_assets/mpos/js/jquery-ui.custom.min.js
vendored
Normal file
94
public/site_assets/mpos/js/jquery.cookie.js
Normal file
@ -0,0 +1,94 @@
|
||||
/*!
|
||||
* jQuery Cookie Plugin v1.3.1
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2013 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else {
|
||||
// Browser globals.
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function raw(s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
function decoded(s) {
|
||||
return decodeURIComponent(s.replace(pluses, ' '));
|
||||
}
|
||||
|
||||
function converted(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
try {
|
||||
return config.json ? JSON.parse(s) : s;
|
||||
} catch(er) {}
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// write
|
||||
if (value !== undefined) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setDate(t.getDate() + days);
|
||||
}
|
||||
|
||||
value = config.json ? JSON.stringify(value) : String(value);
|
||||
|
||||
return (document.cookie = [
|
||||
config.raw ? key : encodeURIComponent(key),
|
||||
'=',
|
||||
config.raw ? value : encodeURIComponent(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// read
|
||||
var decode = config.raw ? raw : decoded;
|
||||
var cookies = document.cookie.split('; ');
|
||||
var result = key ? undefined : {};
|
||||
for (var i = 0, l = cookies.length; i < l; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var name = decode(parts.shift());
|
||||
var cookie = decode(parts.join('='));
|
||||
|
||||
if (key && key === name) {
|
||||
result = converted(cookie);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!key) {
|
||||
result[name] = converted(cookie);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
if ($.cookie(key) !== undefined) {
|
||||
$.cookie(key, '', $.extend(options, { expires: -1 }));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
}));
|
||||
73
public/templates/mpos/admin/templates/default.tpl
Normal file
@ -0,0 +1,73 @@
|
||||
<article class="module width_quarter">
|
||||
<header><h3>Select Page</h3></header>
|
||||
<div class="templates-tree" id="templates-tree">
|
||||
{include file="admin/templates/tree.tpl" files=$TEMPLATES prefix=""}
|
||||
</div>
|
||||
<p>* Bold templates are activated</p>
|
||||
<link rel='stylesheet' type='text/css' href='{$PATH}/js/dynatree/skin/ui.dynatree.css'>
|
||||
<script type="text/javascript" src="{$PATH}/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/jquery-ui.custom.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/dynatree/jquery.dynatree.min.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#templates-tree").each(function() {
|
||||
$(this).find("li").each(function() {
|
||||
if($(this).find("li.dynatree-activated").length) {
|
||||
$(this).attr("data", "addClass:'dynatree-has-activated'");
|
||||
}
|
||||
});
|
||||
}).dynatree({
|
||||
minExpandLevel: 2,
|
||||
clickFolderMode: 2,
|
||||
selectMode: 1,
|
||||
persist: true,
|
||||
//To show the active template onLoad
|
||||
onPostInit: function(isReloading, isError) {
|
||||
this.reactivate();
|
||||
},
|
||||
onActivate: function(node) {
|
||||
if( node.tree.isUserEvent() && node.data.href )
|
||||
location.href = node.data.href;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.templates-tree .dynatree-container { border: none; }
|
||||
.templates-tree span.dynatree-folder a { font-weight: normal; }
|
||||
.templates-tree span.dynatree-active a,
|
||||
.templates-tree span.dynatree-has-activated a,
|
||||
.templates-tree span.dynatree-activated a { font-weight: bold; }
|
||||
</style>
|
||||
</article>
|
||||
|
||||
<article class="module width_3_quarter">
|
||||
<header><h3> Edit template '{$CURRENT_TEMPLATE}' </h3></header>
|
||||
<form method="POST" action="{$smarty.server.PHP_SELF}">
|
||||
<input type="hidden" name="page" value="{$smarty.request.page}">
|
||||
<input type="hidden" name="action" value="{$smarty.request.action}">
|
||||
<input type="hidden" name="template" value="{$CURRENT_TEMPLATE}">
|
||||
<input type="hidden" name="do" value="save">
|
||||
<div class="module_content">
|
||||
<fieldset>
|
||||
<label>Active</label>
|
||||
<input type="hidden" name="active" value="0" />
|
||||
<input type="checkbox" name="active" value="1" id="active" {nocache}{if $DATABASE_TEMPLATE.active}checked{/if}{/nocache} />
|
||||
<label for="active"></label>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Content</label>
|
||||
<textarea name="content" rows="15" type="text" required>{nocache}{$DATABASE_TEMPLATE.content|escape}{/nocache}</textarea>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Original Template Content</label>
|
||||
<textarea readonly rows="15" type="text" required>{nocache}{$ORIGINAL_TEMPLATE|escape}{/nocache}</textarea>
|
||||
</fieldset>
|
||||
</div>
|
||||
<footer>
|
||||
<div class="submit_link">
|
||||
<input type="submit" value="Save" class="alt_btn">
|
||||
</div>
|
||||
</footer>
|
||||
</form>
|
||||
</article>
|
||||
25
public/templates/mpos/admin/templates/tree.tpl
Normal file
@ -0,0 +1,25 @@
|
||||
<ul>
|
||||
{foreach from=$files item="value" key="file"}
|
||||
{if is_array($value)}
|
||||
<li class="folder">
|
||||
{$file}
|
||||
{assign var="new_prefix" value="$prefix$file/"}
|
||||
{include file="admin/templates/tree.tpl" files=$value prefix=$new_prefix}
|
||||
</li>
|
||||
{else}
|
||||
{assign var="path" value="$prefix$file"}
|
||||
|
||||
{assign var="classes" value=array()}
|
||||
{if array_key_exists($path, $ACTIVE_TEMPLATES)}
|
||||
{assign var="tmp" value=array_push($classes,"dynatree-activated")}
|
||||
{/if}
|
||||
{if $CURRENT_TEMPLATE eq $path}
|
||||
{assign var="tmp" value=array_push($classes,"dynatree-active")}
|
||||
{/if}
|
||||
{assign var="classes" value=join(" ", $classes)}
|
||||
<li{if $classes} class="{$classes}" data="addClass:'{$classes}'{if strpos("dynatree-active", $classes) !== false}, activate: true{/if}"{/if}>
|
||||
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&template={$prefix}{$file}">{$file}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
@ -24,6 +24,7 @@
|
||||
<li class="icon-doc"><a href="{$smarty.server.PHP_SELF}?page=admin&action=news">News</a></li>
|
||||
<li class="icon-chart"><a href="{$smarty.server.PHP_SELF}?page=admin&action=reports">Reports</a></li>
|
||||
<li class="icon-photo"><a href="{$smarty.server.PHP_SELF}?page=admin&action=poolworkers">Pool Workers</a></li>
|
||||
<li class="icon-pencil"><a href="{$smarty.server.PHP_SELF}?page=admin&action=templates">Templates</a></li>
|
||||
</ul>
|
||||
{/if}
|
||||
{if $smarty.session.AUTHENTICATED|default}
|
||||
|
||||
@ -215,6 +215,14 @@ CREATE TABLE IF NOT EXISTS `transactions` (
|
||||
KEY `archived` (`archived`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `templates` (
|
||||
`template` varchar(255) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`content` mediumtext,
|
||||
`modified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`template`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
|
||||
7
sql/005_create_templates_table.sql
Normal file
@ -0,0 +1,7 @@
|
||||
CREATE TABLE `templates` (
|
||||
`template` varchar(255) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`content` mediumtext,
|
||||
`modified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`template`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||