Revize 47
Přidáno uživatelem kenod před více než 16 roky(ů)
freenetis/trunk/kohana/application/vendors/phpgacl/admin/admin.css | ||
---|---|---|
body {
|
||
background-color:#ffffff;
|
||
margin: 0px;
|
||
padding: 0px;
|
||
}
|
||
|
||
div {
|
||
position: relative;
|
||
}
|
||
|
||
div#top-tr {
|
||
margin: 0px;
|
||
padding: 0px;
|
||
background: #cccccc url("images/top-r.png") no-repeat top right;
|
||
}
|
||
|
||
div#top-tl {
|
||
margin: 0px;
|
||
padding: 0px;
|
||
background: url("images/top-l.png") no-repeat top left;
|
||
}
|
||
|
||
div#top-br {
|
||
margin: 0px;
|
||
padding: 0px;
|
||
background: url("images/div-r.png") no-repeat bottom right;
|
||
}
|
||
|
||
div#top-bl {
|
||
margin: 0px;
|
||
padding: 10px 180px 0px 10px;
|
||
background: url("images/div-l.png") no-repeat bottom left;
|
||
}
|
||
|
||
div#top-bl h1 {
|
||
position: absolute;
|
||
visibility: hidden;
|
||
}
|
||
|
||
div#top-bl h2 {
|
||
color: #eeeeee;
|
||
font-size: 150%;
|
||
margin: 6px 4px;
|
||
padding: 0px;
|
||
}
|
||
|
||
ul#menu {
|
||
margin: 0px;
|
||
padding: 0px;
|
||
|
||
display: table;
|
||
width: 100%;
|
||
list-style-type: none;
|
||
}
|
||
|
||
ul#menu li {
|
||
float: left;
|
||
|
||
margin: 0px 2px 0px 0px;
|
||
padding: 0px;
|
||
background: #999999 url("images/tab-off-r.png") no-repeat top right;
|
||
border-bottom: 1px solid #666666;
|
||
}
|
||
|
||
ul#menu li a {
|
||
display: block;
|
||
margin: 0px;
|
||
padding: 2px 5px 1px 5px;
|
||
background: url("images/tab-off-l.png") no-repeat top left;
|
||
|
||
color: #d8d8d8;
|
||
text-decoration: none;
|
||
text-align: center;
|
||
font-weight: normal;
|
||
|
||
width: .1em;
|
||
white-space: nowrap;
|
||
min-width: 50px;
|
||
}
|
||
|
||
ul#menu li>a {
|
||
width: auto;
|
||
}
|
||
|
||
ul#menu li a:hover {
|
||
color: #ffffff;
|
||
}
|
||
|
||
ul#menu li.current {
|
||
background-color: #ffffff;
|
||
background-image: url("images/tab-on-r.png");
|
||
border-bottom-width: 0px;
|
||
}
|
||
|
||
ul#menu li.current a {
|
||
background-image: url("images/tab-on-l.png");
|
||
padding-bottom: 2px;
|
||
|
||
color: #666666;
|
||
text-decoration: none;
|
||
}
|
||
|
||
ul#menu li.current a:hover {
|
||
color: #666666;
|
||
}
|
||
|
||
div#mid-r {
|
||
margin: 0px;
|
||
padding: 0px;
|
||
background: #ffffff url("images/mid-r.png") repeat-y top right;
|
||
}
|
||
|
||
div#mid-l {
|
||
margin: 0px;
|
||
padding: 4px 10px;
|
||
background: url("images/mid-l.png") repeat-y top left;
|
||
}
|
||
|
||
div#bot-tr {
|
||
margin: 0px;
|
||
padding: 0px;
|
||
background: url("images/div-r.png") no-repeat top right;
|
||
}
|
||
|
||
div#bot-tl {
|
||
margin: 0px;
|
||
padding: 2px 10px 10px 10px;
|
||
background: url("images/div-l.png") no-repeat top left;
|
||
|
||
font-size: 8pt;
|
||
text-align: center;
|
||
}
|
||
|
||
div#bot-tl a {
|
||
text-decoration: none;
|
||
}
|
||
|
||
div#bot-br {
|
||
margin: 0px;
|
||
padding: 0px;
|
||
background: #cccccc url("images/bot-r.png") no-repeat bottom right;
|
||
}
|
||
|
||
div#bot-bl {
|
||
margin: 0px;
|
||
padding: 0px;
|
||
background: url("images/bot-l.png") no-repeat bottom left;
|
||
}
|
||
|
||
body, td, th {
|
||
font-family: Verdana, Helvetica, Arial, sans-serif;
|
||
font-size: 9pt;
|
||
}
|
||
|
||
table, td, th {
|
||
border: 0px;
|
||
}
|
||
|
||
tr {
|
||
background-color: #cccccc;
|
||
}
|
||
|
||
th {
|
||
background-color: #d3dce3;
|
||
font-weight: bold;
|
||
text-align: center;
|
||
}
|
||
|
||
tr.controls {
|
||
background-color: #999999;
|
||
}
|
||
|
||
tr.odd {
|
||
background-color: #c0c0c0;
|
||
}
|
||
|
||
tr.even {
|
||
background-color: #d0d0d0;
|
||
}
|
||
|
||
tr.spacer {
|
||
background-color: transparent;
|
||
height: 10px;
|
||
}
|
||
|
||
td.green {
|
||
background-color: green;
|
||
}
|
||
|
||
td.red {
|
||
background-color: red;
|
||
}
|
||
|
||
input, select, textarea {
|
||
font-family: verdana, sans-serif;
|
||
font-size: 9pt;
|
||
border: 1px solid #333333;
|
||
}
|
||
|
||
input {
|
||
padding: 1px 2px;
|
||
}
|
||
|
||
input.checkbox, input.radio {
|
||
border: 0px;
|
||
margin: 1px 2px 0px;
|
||
padding: 0px;
|
||
}
|
||
|
||
input.button {
|
||
width: 100px;
|
||
}
|
||
|
||
input.paypal {
|
||
border-width: 0px;
|
||
}
|
||
|
||
.navigation {
|
||
font-family: verdana, sans-serif;
|
||
font-size: 8pt;
|
||
padding-bottom: 5px;
|
||
}
|
||
|
||
.navigation a {
|
||
color: #0000ff;
|
||
}
|
||
|
||
.navigation a:hover {
|
||
color: #aa0000;
|
||
background-color: #f0f0f0;
|
||
}
|
||
|
||
.footer {
|
||
font-size: 8pt;
|
||
text-align: center;
|
||
}
|
||
|
||
form {
|
||
margin: 0px;
|
||
}
|
||
|
||
tr.hide {
|
||
display: none;
|
||
}
|
||
|
||
tr.show {
|
||
}
|
||
|
||
td.tabon {
|
||
background: #438EC5;
|
||
}
|
||
|
||
td.taboff {
|
||
background: #ABC3D4;
|
||
}
|
||
|
||
select {
|
||
width: 99%;
|
||
margin-top: 5px;
|
||
}
|
||
|
||
textarea, input#return_value {
|
||
width: 99%;
|
||
}
|
||
|
||
input.un-select {
|
||
width: 99%;
|
||
margin-top: 5px;
|
||
}
|
||
|
||
input.select {
|
||
width: 99%;
|
||
margin-top: 5px;
|
||
}
|
||
|
||
input.deselect {
|
||
width: 99%;
|
||
margin-top: 8px;
|
||
}
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.assign_smarty_interface.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* Smarty assign_smarty_interface core plugin
|
||
*
|
||
* Type: core<br>
|
||
* Name: assign_smarty_interface<br>
|
||
* Purpose: assign the $smarty interface variable
|
||
* @param array Format: null
|
||
* @param Smarty
|
||
*/
|
||
function smarty_core_assign_smarty_interface($params, &$smarty)
|
||
{
|
||
if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) {
|
||
return;
|
||
}
|
||
|
||
$_globals_map = array('g' => 'HTTP_GET_VARS',
|
||
'p' => 'HTTP_POST_VARS',
|
||
'c' => 'HTTP_COOKIE_VARS',
|
||
's' => 'HTTP_SERVER_VARS',
|
||
'e' => 'HTTP_ENV_VARS');
|
||
|
||
$_smarty_vars_request = array();
|
||
|
||
foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) {
|
||
if (isset($_globals_map[$_c])) {
|
||
$_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]);
|
||
}
|
||
}
|
||
$_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']);
|
||
|
||
$smarty->_smarty_vars['request'] = $_smarty_vars_request;
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.load_resource_plugin.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* load a resource plugin
|
||
*
|
||
* @param string $type
|
||
*/
|
||
|
||
// $type
|
||
|
||
function smarty_core_load_resource_plugin($params, &$smarty)
|
||
{
|
||
/*
|
||
* Resource plugins are not quite like the other ones, so they are
|
||
* handled differently. The first element of plugin info is the array of
|
||
* functions provided by the plugin, the second one indicates whether
|
||
* all of them exist or not.
|
||
*/
|
||
|
||
$_plugin = &$smarty->_plugins['resource'][$params['type']];
|
||
if (isset($_plugin)) {
|
||
if (!$_plugin[1] && count($_plugin[0])) {
|
||
$_plugin[1] = true;
|
||
foreach ($_plugin[0] as $_plugin_func) {
|
||
if (!is_callable($_plugin_func)) {
|
||
$_plugin[1] = false;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
if (!$_plugin[1]) {
|
||
$smarty->_trigger_fatal_error("[plugin] resource '" . $params['type'] . "' is not implemented", null, null, __FILE__, __LINE__);
|
||
}
|
||
|
||
return;
|
||
}
|
||
|
||
$_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']);
|
||
$_found = ($_plugin_file != false);
|
||
|
||
if ($_found) { /*
|
||
* If the plugin file is found, it -must- provide the properly named
|
||
* plugin functions.
|
||
*/
|
||
include_once($_plugin_file);
|
||
|
||
/*
|
||
* Locate functions that we require the plugin to provide.
|
||
*/
|
||
$_resource_ops = array('source', 'timestamp', 'secure', 'trusted');
|
||
$_resource_funcs = array();
|
||
foreach ($_resource_ops as $_op) {
|
||
$_plugin_func = 'smarty_resource_' . $params['type'] . '_' . $_op;
|
||
if (!function_exists($_plugin_func)) {
|
||
$smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", null, null, __FILE__, __LINE__);
|
||
return;
|
||
} else {
|
||
$_resource_funcs[] = $_plugin_func;
|
||
}
|
||
}
|
||
|
||
$smarty->_plugins['resource'][$params['type']] = array($_resource_funcs, true);
|
||
}
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.rm_auto.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* delete an automagically created file by name and id
|
||
*
|
||
* @param string $auto_base
|
||
* @param string $auto_source
|
||
* @param string $auto_id
|
||
* @param integer $exp_time
|
||
* @return boolean
|
||
*/
|
||
|
||
// $auto_base, $auto_source = null, $auto_id = null, $exp_time = null
|
||
|
||
function smarty_core_rm_auto($params, &$smarty)
|
||
{
|
||
if (!@is_dir($params['auto_base']))
|
||
return false;
|
||
|
||
if(!isset($params['auto_id']) && !isset($params['auto_source'])) {
|
||
$_params = array(
|
||
'dirname' => $params['auto_base'],
|
||
'level' => 0,
|
||
'exp_time' => $params['exp_time']
|
||
);
|
||
require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
|
||
$_res = smarty_core_rmdir($_params, $smarty);
|
||
} else {
|
||
$_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']);
|
||
|
||
if(isset($params['auto_source'])) {
|
||
if (isset($params['extensions'])) {
|
||
$_res = false;
|
||
foreach ((array)$params['extensions'] as $_extension)
|
||
$_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']);
|
||
} else {
|
||
$_res = $smarty->_unlink($_tname, $params['exp_time']);
|
||
}
|
||
} elseif ($smarty->use_sub_dirs) {
|
||
$_params = array(
|
||
'dirname' => $_tname,
|
||
'level' => 1,
|
||
'exp_time' => $params['exp_time']
|
||
);
|
||
require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
|
||
$_res = smarty_core_rmdir($_params, $smarty);
|
||
} else {
|
||
// remove matching file names
|
||
$_handle = opendir($params['auto_base']);
|
||
$_res = true;
|
||
while (false !== ($_filename = readdir($_handle))) {
|
||
if($_filename == '.' || $_filename == '..') {
|
||
continue;
|
||
} elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) {
|
||
$_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
return $_res;
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.write_compiled_include.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* Extract non-cacheable parts out of compiled template and write it
|
||
*
|
||
* @param string $compile_path
|
||
* @param string $template_compiled
|
||
* @return boolean
|
||
*/
|
||
|
||
function smarty_core_write_compiled_include($params, &$smarty)
|
||
{
|
||
$_tag_start = 'if \(\$this->caching && \!\$this->_cache_including\) \{ echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; \};';
|
||
$_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\) \{ echo \'\{/nocache\:(\\2)#(\\3)\}\'; \};';
|
||
|
||
preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us',
|
||
$params['compiled_content'], $_match_source, PREG_SET_ORDER);
|
||
|
||
// no nocache-parts found: done
|
||
if (count($_match_source)==0) return;
|
||
|
||
// convert the matched php-code to functions
|
||
$_include_compiled = "<?php /* Smarty version ".$smarty->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
|
||
$_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n";
|
||
|
||
$_compile_path = $params['include_file_path'];
|
||
|
||
$smarty->_cache_serials[$_compile_path] = $params['cache_serial'];
|
||
$_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>";
|
||
|
||
$_include_compiled .= $params['plugins_code'];
|
||
$_include_compiled .= "<?php";
|
||
|
||
$this_varname = ((double)phpversion() >= 5.0) ? '_smarty' : 'this';
|
||
for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) {
|
||
$_match =& $_match_source[$_i];
|
||
$source = $_match[4];
|
||
if ($this_varname == '_smarty') {
|
||
/* rename $this to $_smarty in the sourcecode */
|
||
$tokens = token_get_all('<?php ' . $_match[4]);
|
||
|
||
/* remove trailing <?php */
|
||
$open_tag = '';
|
||
while ($tokens) {
|
||
$token = array_shift($tokens);
|
||
if (is_array($token)) {
|
||
$open_tag .= $token[1];
|
||
} else {
|
||
$open_tag .= $token;
|
||
}
|
||
if ($open_tag == '<?php ') break;
|
||
}
|
||
|
||
for ($i=0, $count = count($tokens); $i < $count; $i++) {
|
||
if (is_array($tokens[$i])) {
|
||
if ($tokens[$i][0] == T_VARIABLE && $tokens[$i][1] == '$this') {
|
||
$tokens[$i] = '$' . $this_varname;
|
||
} else {
|
||
$tokens[$i] = $tokens[$i][1];
|
||
}
|
||
}
|
||
}
|
||
$source = implode('', $tokens);
|
||
}
|
||
|
||
/* add function to compiled include */
|
||
$_include_compiled .= "
|
||
function _smarty_tplfunc_$_match[2]_$_match[3](&\$$this_varname)
|
||
{
|
||
$source
|
||
}
|
||
|
||
";
|
||
}
|
||
$_include_compiled .= "\n\n?>\n";
|
||
|
||
$_params = array('filename' => $_compile_path,
|
||
'contents' => $_include_compiled, 'create_dirs' => true);
|
||
|
||
require_once(SMARTY_CORE_DIR . 'core.write_file.php');
|
||
smarty_core_write_file($_params, $smarty);
|
||
return true;
|
||
}
|
||
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.process_cached_inserts.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* Replace cached inserts with the actual results
|
||
*
|
||
* @param string $results
|
||
* @return string
|
||
*/
|
||
function smarty_core_process_cached_inserts($params, &$smarty)
|
||
{
|
||
preg_match_all('!'.$smarty->_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis',
|
||
$params['results'], $match);
|
||
list($cached_inserts, $insert_args) = $match;
|
||
|
||
for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {
|
||
if ($smarty->debugging) {
|
||
$_params = array();
|
||
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
|
||
$debug_start_time = smarty_core_get_microtime($_params, $smarty);
|
||
}
|
||
|
||
$args = unserialize($insert_args[$i]);
|
||
$name = $args['name'];
|
||
|
||
if (isset($args['script'])) {
|
||
$_params = array('resource_name' => $smarty->_dequote($args['script']));
|
||
require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
|
||
if(!smarty_core_get_php_resource($_params, $smarty)) {
|
||
return false;
|
||
}
|
||
$resource_type = $_params['resource_type'];
|
||
$php_resource = $_params['php_resource'];
|
||
|
||
|
||
if ($resource_type == 'file') {
|
||
$smarty->_include($php_resource, true);
|
||
} else {
|
||
$smarty->_eval($php_resource);
|
||
}
|
||
}
|
||
|
||
$function_name = $smarty->_plugins['insert'][$name][0];
|
||
if (empty($args['assign'])) {
|
||
$replace = $function_name($args, $smarty);
|
||
} else {
|
||
$smarty->assign($args['assign'], $function_name($args, $smarty));
|
||
$replace = '';
|
||
}
|
||
|
||
$params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i]));
|
||
if ($smarty->debugging) {
|
||
$_params = array();
|
||
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
|
||
$smarty->_smarty_debug_info[] = array('type' => 'insert',
|
||
'filename' => 'insert_'.$name,
|
||
'depth' => $smarty->_inclusion_depth,
|
||
'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time);
|
||
}
|
||
}
|
||
|
||
return $params['results'];
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.write_cache_file.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* Prepend the cache information to the cache file
|
||
* and write it
|
||
*
|
||
* @param string $tpl_file
|
||
* @param string $cache_id
|
||
* @param string $compile_id
|
||
* @param string $results
|
||
* @return true|null
|
||
*/
|
||
|
||
// $tpl_file, $cache_id, $compile_id, $results
|
||
|
||
function smarty_core_write_cache_file($params, &$smarty)
|
||
{
|
||
|
||
// put timestamp in cache header
|
||
$smarty->_cache_info['timestamp'] = time();
|
||
if ($smarty->cache_lifetime > -1){
|
||
// expiration set
|
||
$smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime;
|
||
} else {
|
||
// cache will never expire
|
||
$smarty->_cache_info['expires'] = -1;
|
||
}
|
||
|
||
// collapse nocache.../nocache-tags
|
||
if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) {
|
||
// remove everything between every pair of outermost noache.../nocache-tags
|
||
// and replace it by a single nocache-tag
|
||
// this new nocache-tag will be replaced by dynamic contents in
|
||
// smarty_core_process_compiled_includes() on a cache-read
|
||
|
||
$match_count = count($match[0]);
|
||
$results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE);
|
||
|
||
$level = 0;
|
||
$j = 0;
|
||
for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) {
|
||
if ($results[$i] == $match[0][$j]) {
|
||
// nocache tag
|
||
if ($match[1][$j]) { // closing tag
|
||
$level--;
|
||
unset($results[$i]);
|
||
} else { // opening tag
|
||
if ($level++ > 0) unset($results[$i]);
|
||
}
|
||
$j++;
|
||
} elseif ($level > 0) {
|
||
unset($results[$i]);
|
||
}
|
||
}
|
||
$params['results'] = implode('', $results);
|
||
}
|
||
$smarty->_cache_info['cache_serials'] = $smarty->_cache_serials;
|
||
|
||
// prepend the cache header info into cache file
|
||
$_cache_info = serialize($smarty->_cache_info);
|
||
$params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results'];
|
||
|
||
if (!empty($smarty->cache_handler_func)) {
|
||
// use cache_handler function
|
||
call_user_func_array($smarty->cache_handler_func,
|
||
array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null));
|
||
} else {
|
||
// use local cache file
|
||
|
||
if(!@is_writable($smarty->cache_dir)) {
|
||
// cache_dir not writable, see if it exists
|
||
if(!@is_dir($smarty->cache_dir)) {
|
||
$smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
|
||
return false;
|
||
}
|
||
$smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR);
|
||
return false;
|
||
}
|
||
|
||
$_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
|
||
$_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
|
||
$_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true);
|
||
require_once(SMARTY_CORE_DIR . 'core.write_file.php');
|
||
smarty_core_write_file($_params, $smarty);
|
||
return true;
|
||
}
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.write_compiled_resource.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* write the compiled resource
|
||
*
|
||
* @param string $compile_path
|
||
* @param string $compiled_content
|
||
* @return true
|
||
*/
|
||
function smarty_core_write_compiled_resource($params, &$smarty)
|
||
{
|
||
if(!@is_writable($smarty->compile_dir)) {
|
||
// compile_dir not writable, see if it exists
|
||
if(!@is_dir($smarty->compile_dir)) {
|
||
$smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
|
||
return false;
|
||
}
|
||
$smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR);
|
||
return false;
|
||
}
|
||
|
||
$_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true);
|
||
require_once(SMARTY_CORE_DIR . 'core.write_file.php');
|
||
smarty_core_write_file($_params, $smarty);
|
||
return true;
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.rmdir.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* delete a dir recursively (level=0 -> keep root)
|
||
* WARNING: no tests, it will try to remove what you tell it!
|
||
*
|
||
* @param string $dirname
|
||
* @param integer $level
|
||
* @param integer $exp_time
|
||
* @return boolean
|
||
*/
|
||
|
||
// $dirname, $level = 1, $exp_time = null
|
||
|
||
function smarty_core_rmdir($params, &$smarty)
|
||
{
|
||
if(!isset($params['level'])) { $params['level'] = 1; }
|
||
if(!isset($params['exp_time'])) { $params['exp_time'] = null; }
|
||
|
||
if($_handle = @opendir($params['dirname'])) {
|
||
|
||
while (false !== ($_entry = readdir($_handle))) {
|
||
if ($_entry != '.' && $_entry != '..') {
|
||
if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) {
|
||
$_params = array(
|
||
'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry,
|
||
'level' => $params['level'] + 1,
|
||
'exp_time' => $params['exp_time']
|
||
);
|
||
smarty_core_rmdir($_params, $smarty);
|
||
}
|
||
else {
|
||
$smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']);
|
||
}
|
||
}
|
||
}
|
||
closedir($_handle);
|
||
}
|
||
|
||
if ($params['level']) {
|
||
return @rmdir($params['dirname']);
|
||
}
|
||
return (bool)$_handle;
|
||
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.load_plugins.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* Load requested plugins
|
||
*
|
||
* @param array $plugins
|
||
*/
|
||
|
||
// $plugins
|
||
|
||
function smarty_core_load_plugins($params, &$smarty)
|
||
{
|
||
|
||
foreach ($params['plugins'] as $_plugin_info) {
|
||
list($_type, $_name, $_tpl_file, $_tpl_line, $_delayed_loading) = $_plugin_info;
|
||
$_plugin = &$smarty->_plugins[$_type][$_name];
|
||
|
||
/*
|
||
* We do not load plugin more than once for each instance of Smarty.
|
||
* The following code checks for that. The plugin can also be
|
||
* registered dynamically at runtime, in which case template file
|
||
* and line number will be unknown, so we fill them in.
|
||
*
|
||
* The final element of the info array is a flag that indicates
|
||
* whether the dynamically registered plugin function has been
|
||
* checked for existence yet or not.
|
||
*/
|
||
if (isset($_plugin)) {
|
||
if (empty($_plugin[3])) {
|
||
if (!is_callable($_plugin[0])) {
|
||
$smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
|
||
} else {
|
||
$_plugin[1] = $_tpl_file;
|
||
$_plugin[2] = $_tpl_line;
|
||
$_plugin[3] = true;
|
||
if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */
|
||
}
|
||
}
|
||
continue;
|
||
} else if ($_type == 'insert') {
|
||
/*
|
||
* For backwards compatibility, we check for insert functions in
|
||
* the symbol table before trying to load them as a plugin.
|
||
*/
|
||
$_plugin_func = 'insert_' . $_name;
|
||
if (function_exists($_plugin_func)) {
|
||
$_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false);
|
||
continue;
|
||
}
|
||
}
|
||
|
||
$_plugin_file = $smarty->_get_plugin_filepath($_type, $_name);
|
||
|
||
if (! $_found = ($_plugin_file != false)) {
|
||
$_message = "could not load plugin file '$_type.$_name.php'\n";
|
||
}
|
||
|
||
/*
|
||
* If plugin file is found, it -must- provide the properly named
|
||
* plugin function. In case it doesn't, simply output the error and
|
||
* do not fall back on any other method.
|
||
*/
|
||
if ($_found) {
|
||
include_once $_plugin_file;
|
||
|
||
$_plugin_func = 'smarty_' . $_type . '_' . $_name;
|
||
if (!function_exists($_plugin_func)) {
|
||
$smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
|
||
continue;
|
||
}
|
||
}
|
||
/*
|
||
* In case of insert plugins, their code may be loaded later via
|
||
* 'script' attribute.
|
||
*/
|
||
else if ($_type == 'insert' && $_delayed_loading) {
|
||
$_plugin_func = 'smarty_' . $_type . '_' . $_name;
|
||
$_found = true;
|
||
}
|
||
|
||
/*
|
||
* Plugin specific processing and error checking.
|
||
*/
|
||
if (!$_found) {
|
||
if ($_type == 'modifier') {
|
||
/*
|
||
* In case modifier falls back on using PHP functions
|
||
* directly, we only allow those specified in the security
|
||
* context.
|
||
*/
|
||
if ($smarty->security && !in_array($_name, $smarty->security_settings['MODIFIER_FUNCS'])) {
|
||
$_message = "(secure mode) modifier '$_name' is not allowed";
|
||
} else {
|
||
if (!function_exists($_name)) {
|
||
$_message = "modifier '$_name' is not implemented";
|
||
} else {
|
||
$_plugin_func = $_name;
|
||
$_found = true;
|
||
}
|
||
}
|
||
} else if ($_type == 'function') {
|
||
/*
|
||
* This is a catch-all situation.
|
||
*/
|
||
$_message = "unknown tag - '$_name'";
|
||
}
|
||
}
|
||
|
||
if ($_found) {
|
||
$smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true);
|
||
} else {
|
||
// output error
|
||
$smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__);
|
||
}
|
||
}
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.create_dir_structure.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* create full directory structure
|
||
*
|
||
* @param string $dir
|
||
*/
|
||
|
||
// $dir
|
||
|
||
function smarty_core_create_dir_structure($params, &$smarty)
|
||
{
|
||
if (!file_exists($params['dir'])) {
|
||
$_open_basedir_ini = ini_get('open_basedir');
|
||
|
||
if (DIRECTORY_SEPARATOR=='/') {
|
||
/* unix-style paths */
|
||
$_dir = $params['dir'];
|
||
$_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
|
||
$_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/';
|
||
if($_use_open_basedir = !empty($_open_basedir_ini)) {
|
||
$_open_basedirs = explode(':', $_open_basedir_ini);
|
||
}
|
||
|
||
} else {
|
||
/* other-style paths */
|
||
$_dir = str_replace('\\','/', $params['dir']);
|
||
$_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
|
||
if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) {
|
||
/* leading "//" for network volume, or "[letter]:/" for full path */
|
||
$_new_dir = $_root_dir[1];
|
||
/* remove drive-letter from _dir_parts */
|
||
if (isset($_root_dir[3])) array_shift($_dir_parts);
|
||
|
||
} else {
|
||
$_new_dir = str_replace('\\', '/', getcwd()).'/';
|
||
|
||
}
|
||
|
||
if($_use_open_basedir = !empty($_open_basedir_ini)) {
|
||
$_open_basedirs = explode(';', str_replace('\\', '/', $_open_basedir_ini));
|
||
}
|
||
|
||
}
|
||
|
||
/* all paths use "/" only from here */
|
||
foreach ($_dir_parts as $_dir_part) {
|
||
$_new_dir .= $_dir_part;
|
||
|
||
if ($_use_open_basedir) {
|
||
// do not attempt to test or make directories outside of open_basedir
|
||
$_make_new_dir = false;
|
||
foreach ($_open_basedirs as $_open_basedir) {
|
||
if (substr($_new_dir, 0, strlen($_open_basedir)) == $_open_basedir) {
|
||
$_make_new_dir = true;
|
||
break;
|
||
}
|
||
}
|
||
} else {
|
||
$_make_new_dir = true;
|
||
}
|
||
|
||
if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) {
|
||
$smarty->trigger_error("problem creating directory '" . $_new_dir . "'");
|
||
return false;
|
||
}
|
||
$_new_dir .= '/';
|
||
}
|
||
}
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.is_secure.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* determines if a resource is secure or not.
|
||
*
|
||
* @param string $resource_type
|
||
* @param string $resource_name
|
||
* @return boolean
|
||
*/
|
||
|
||
// $resource_type, $resource_name
|
||
|
||
function smarty_core_is_secure($params, &$smarty)
|
||
{
|
||
if (!$smarty->security || $smarty->security_settings['INCLUDE_ANY']) {
|
||
return true;
|
||
}
|
||
|
||
if ($params['resource_type'] == 'file') {
|
||
$_rp = realpath($params['resource_name']);
|
||
if (isset($params['resource_base_path'])) {
|
||
foreach ((array)$params['resource_base_path'] as $curr_dir) {
|
||
if ( ($_cd = realpath($curr_dir)) !== false &&
|
||
strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
|
||
substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
if (!empty($smarty->secure_dir)) {
|
||
foreach ((array)$smarty->secure_dir as $curr_dir) {
|
||
if ( ($_cd = realpath($curr_dir)) !== false) {
|
||
if($_cd == $_rp) {
|
||
return true;
|
||
} elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
|
||
substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) {
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
} else {
|
||
// resource is not on local file system
|
||
return call_user_func_array(
|
||
$smarty->_plugins['resource'][$params['resource_type']][0][2],
|
||
array($params['resource_name'], &$smarty));
|
||
}
|
||
|
||
return false;
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.assemble_plugin_filepath.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* assemble filepath of requested plugin
|
||
*
|
||
* @param string $type
|
||
* @param string $name
|
||
* @return string|false
|
||
*/
|
||
function smarty_core_assemble_plugin_filepath($params, &$smarty)
|
||
{
|
||
static $_filepaths_cache = array();
|
||
|
||
$_plugin_filename = $params['type'] . '.' . $params['name'] . '.php';
|
||
if (isset($_filepaths_cache[$_plugin_filename])) {
|
||
return $_filepaths_cache[$_plugin_filename];
|
||
}
|
||
$_return = false;
|
||
|
||
foreach ((array)$smarty->plugins_dir as $_plugin_dir) {
|
||
|
||
$_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
|
||
|
||
// see if path is relative
|
||
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
|
||
$_relative_paths[] = $_plugin_dir;
|
||
// relative path, see if it is in the SMARTY_DIR
|
||
if (@is_readable(SMARTY_DIR . $_plugin_filepath)) {
|
||
$_return = SMARTY_DIR . $_plugin_filepath;
|
||
break;
|
||
}
|
||
}
|
||
// try relative to cwd (or absolute)
|
||
if (@is_readable($_plugin_filepath)) {
|
||
$_return = $_plugin_filepath;
|
||
break;
|
||
}
|
||
}
|
||
|
||
if($_return === false) {
|
||
// still not found, try PHP include_path
|
||
if(isset($_relative_paths)) {
|
||
foreach ((array)$_relative_paths as $_plugin_dir) {
|
||
|
||
$_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
|
||
|
||
$_params = array('file_path' => $_plugin_filepath);
|
||
require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
|
||
if(smarty_core_get_include_path($_params, $smarty)) {
|
||
$_return = $_params['new_file_path'];
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
$_filepaths_cache[$_plugin_filename] = $_return;
|
||
return $_return;
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.run_insert_handler.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* Handle insert tags
|
||
*
|
||
* @param array $args
|
||
* @return string
|
||
*/
|
||
function smarty_core_run_insert_handler($params, &$smarty)
|
||
{
|
||
|
||
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
|
||
if ($smarty->debugging) {
|
||
$_params = array();
|
||
$_debug_start_time = smarty_core_get_microtime($_params, $smarty);
|
||
}
|
||
|
||
if ($smarty->caching) {
|
||
$_arg_string = serialize($params['args']);
|
||
$_name = $params['args']['name'];
|
||
if (!isset($smarty->_cache_info['insert_tags'][$_name])) {
|
||
$smarty->_cache_info['insert_tags'][$_name] = array('insert',
|
||
$_name,
|
||
$smarty->_plugins['insert'][$_name][1],
|
||
$smarty->_plugins['insert'][$_name][2],
|
||
!empty($params['args']['script']) ? true : false);
|
||
}
|
||
return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5;
|
||
} else {
|
||
if (isset($params['args']['script'])) {
|
||
$_params = array('resource_name' => $smarty->_dequote($params['args']['script']));
|
||
require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
|
||
if(!smarty_core_get_php_resource($_params, $smarty)) {
|
||
return false;
|
||
}
|
||
|
||
if ($_params['resource_type'] == 'file') {
|
||
$smarty->_include($_params['php_resource'], true);
|
||
} else {
|
||
$smarty->_eval($_params['php_resource']);
|
||
}
|
||
unset($params['args']['script']);
|
||
}
|
||
|
||
$_funcname = $smarty->_plugins['insert'][$params['args']['name']][0];
|
||
$_content = $_funcname($params['args'], $smarty);
|
||
if ($smarty->debugging) {
|
||
$_params = array();
|
||
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
|
||
$smarty->_smarty_debug_info[] = array('type' => 'insert',
|
||
'filename' => 'insert_'.$params['args']['name'],
|
||
'depth' => $smarty->_inclusion_depth,
|
||
'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
|
||
}
|
||
|
||
if (!empty($params['args']["assign"])) {
|
||
$smarty->assign($params['args']["assign"], $_content);
|
||
} else {
|
||
return $_content;
|
||
}
|
||
}
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.is_trusted.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* determines if a resource is trusted or not
|
||
*
|
||
* @param string $resource_type
|
||
* @param string $resource_name
|
||
* @return boolean
|
||
*/
|
||
|
||
// $resource_type, $resource_name
|
||
|
||
function smarty_core_is_trusted($params, &$smarty)
|
||
{
|
||
$_smarty_trusted = false;
|
||
if ($params['resource_type'] == 'file') {
|
||
if (!empty($smarty->trusted_dir)) {
|
||
$_rp = realpath($params['resource_name']);
|
||
foreach ((array)$smarty->trusted_dir as $curr_dir) {
|
||
if (!empty($curr_dir) && is_readable ($curr_dir)) {
|
||
$_cd = realpath($curr_dir);
|
||
if (strncmp($_rp, $_cd, strlen($_cd)) == 0
|
||
&& substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
|
||
$_smarty_trusted = true;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
} else {
|
||
// resource is not on local file system
|
||
$_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3],
|
||
array($params['resource_name'], $smarty));
|
||
}
|
||
|
||
return $_smarty_trusted;
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.get_microtime.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* Get seconds and microseconds
|
||
* @return double
|
||
*/
|
||
function smarty_core_get_microtime($params, &$smarty)
|
||
{
|
||
$mtime = microtime();
|
||
$mtime = explode(" ", $mtime);
|
||
$mtime = (double)($mtime[1]) + (double)($mtime[0]);
|
||
return ($mtime);
|
||
}
|
||
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.smarty_include_php.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* called for included php files within templates
|
||
*
|
||
* @param string $smarty_file
|
||
* @param string $smarty_assign variable to assign the included template's
|
||
* output into
|
||
* @param boolean $smarty_once uses include_once if this is true
|
||
* @param array $smarty_include_vars associative array of vars from
|
||
* {include file="blah" var=$var}
|
||
*/
|
||
|
||
// $file, $assign, $once, $_smarty_include_vars
|
||
|
||
function smarty_core_smarty_include_php($params, &$smarty)
|
||
{
|
||
$_params = array('resource_name' => $params['smarty_file']);
|
||
require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
|
||
smarty_core_get_php_resource($_params, $smarty);
|
||
$_smarty_resource_type = $_params['resource_type'];
|
||
$_smarty_php_resource = $_params['php_resource'];
|
||
|
||
if (!empty($params['smarty_assign'])) {
|
||
ob_start();
|
||
if ($_smarty_resource_type == 'file') {
|
||
$smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
|
||
} else {
|
||
$smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
|
||
}
|
||
$smarty->assign($params['smarty_assign'], ob_get_contents());
|
||
ob_end_clean();
|
||
} else {
|
||
if ($_smarty_resource_type == 'file') {
|
||
$smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
|
||
} else {
|
||
$smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.write_file.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* write out a file to disk
|
||
*
|
||
* @param string $filename
|
||
* @param string $contents
|
||
* @param boolean $create_dirs
|
||
* @return boolean
|
||
*/
|
||
function smarty_core_write_file($params, &$smarty)
|
||
{
|
||
$_dirname = dirname($params['filename']);
|
||
|
||
if ($params['create_dirs']) {
|
||
$_params = array('dir' => $_dirname);
|
||
require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php');
|
||
smarty_core_create_dir_structure($_params, $smarty);
|
||
}
|
||
|
||
// write to tmp file, then rename it to avoid
|
||
// file locking race condition
|
||
$_tmp_file = tempnam($_dirname, 'wrt');
|
||
|
||
if (!($fd = @fopen($_tmp_file, 'wb'))) {
|
||
$_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt');
|
||
if (!($fd = @fopen($_tmp_file, 'wb'))) {
|
||
$smarty->trigger_error("problem writing temporary file '$_tmp_file'");
|
||
return false;
|
||
}
|
||
}
|
||
|
||
fwrite($fd, $params['contents']);
|
||
fclose($fd);
|
||
|
||
// Delete the file if it allready exists (this is needed on Win,
|
||
// because it cannot overwrite files with rename()
|
||
if (file_exists($params['filename'])) {
|
||
@unlink($params['filename']);
|
||
}
|
||
@rename($_tmp_file, $params['filename']);
|
||
@chmod($params['filename'], $smarty->_file_perms);
|
||
|
||
return true;
|
||
}
|
||
|
||
/* vim: set expandtab: */
|
||
|
||
?>
|
freenetis/trunk/kohana/application/vendors/phpgacl/admin/smarty/libs/internals/core.read_cache_file.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Smarty plugin
|
||
* @package Smarty
|
||
* @subpackage plugins
|
||
*/
|
||
|
||
/**
|
||
* read a cache file, determine if it needs to be
|
||
* regenerated or not
|
||
*
|
||
* @param string $tpl_file
|
||
* @param string $cache_id
|
||
* @param string $compile_id
|
||
* @param string $results
|
||
* @return boolean
|
Také k dispozici: Unified diff