Replaced some more class-named constructors (and calls to them).
Removed unused and/or commented code. Replaced calls to deprecated each() with array_shift() (not completely done yet, still some more to fix!). Replaced call to deprecated create_function() with real callback function.
This commit is contained in:
parent
b3f613a5d2
commit
d8de4bfb02
@ -21,7 +21,7 @@
|
||||
//$this->smarty = $GLOBALS['_FP_SMARTY'];
|
||||
|
||||
$this->_directory = CACHE_DIR;
|
||||
parent::fs_filelister();
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function _checkFile($directory, $file) {
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
function __construct() {
|
||||
$this->index = entry_init();
|
||||
parent::fs_filelister();
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function _checkFile($directory, $file) {
|
||||
|
@ -10,7 +10,7 @@
|
||||
if ($theme['version'] > 0.703)
|
||||
$this->actions['style'] = true;
|
||||
|
||||
parent::AdminPanel($smarty);
|
||||
parent::__construct($smarty);
|
||||
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
function __construct() {
|
||||
$this->_directory = THEMES_DIR . THE_THEME;
|
||||
parent::fs_filelister();
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function _checkFile($d, $f) {
|
||||
|
@ -26,7 +26,7 @@
|
||||
$this->thumburl =
|
||||
BLOG_BASEURL .
|
||||
'admin.php?p=uploader&action=thumb&f=';
|
||||
return parent::fs_filelister($d);
|
||||
return parent::__construct($d);
|
||||
}
|
||||
|
||||
function _checkFile($d, $f) {
|
||||
|
@ -721,26 +721,6 @@ class BPlusTree_Node {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* mimics python's map(None, a, b)
|
||||
* returns the list of (a,b) pairs
|
||||
* where a is in list $a and b is in list $b
|
||||
*
|
||||
*
|
||||
|
||||
function _oldpairs($a, $b) {
|
||||
$c = array();
|
||||
reset($a);
|
||||
reset($b);
|
||||
while((list(,$v1) = each($a)) &&
|
||||
(list(,$v2) = each($b))) {
|
||||
$c[] = array($v1, $v2);
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* mimic's python's map(None, a, b);
|
||||
* a, b must be of the same size
|
||||
@ -1383,7 +1363,7 @@ class BPlusTree_Node {
|
||||
echo $indent, "seeks {", implode(", ", $this->indices),"}\n";
|
||||
if (($flag & BPT_FLAG_INTERIOR) == BPT_FLAG_INTERIOR) {
|
||||
reset($this->indices);
|
||||
while(list(,$i) = each($this->indices)) {
|
||||
while($i = array_shift($this->indices)) {
|
||||
if ($i!=BPT_NULLSEEK) {
|
||||
// interior
|
||||
$n =& $this->getclone($i);
|
||||
|
@ -624,7 +624,7 @@
|
||||
if (!$this->hasMore())
|
||||
return false;
|
||||
|
||||
list($k,$id) = each($this->list);
|
||||
$id = array_shift($this->list);
|
||||
|
||||
$comment = comment_parse($this->entryid, $id);
|
||||
$couplet = array(&$id, &$comment);
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
function bdb_entrylister() {
|
||||
$this->_cachefile = CACHE_DIR . 'userlist.php';
|
||||
parent::cache_filelister();
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function _checkFile($directory, $file) {
|
||||
|
@ -175,7 +175,7 @@ if (!function_exists('fnmatch')) {
|
||||
|
||||
$string .= $outerldelim;
|
||||
|
||||
while (list(,$val) = each($array)) {
|
||||
while ($val = array_shift($array)) {
|
||||
|
||||
$string .= $rdelim;
|
||||
if (is_array($val)) {
|
||||
|
@ -45,7 +45,7 @@
|
||||
do {
|
||||
$content = array();
|
||||
|
||||
list(,$id) = each($this->_list[$hor]);
|
||||
$id = array_shift($this->_list[$hor]);
|
||||
|
||||
$newid=$id;# @list($newid, $params) = explode(":", $id);
|
||||
if (@$params) $params = explode(',', $params); else $params = array();
|
||||
|
@ -20,7 +20,6 @@ function smarty_function_list_categories($params) //, &$smarty)
|
||||
'selected' => array()
|
||||
);
|
||||
|
||||
//list($catId) = each($categories);
|
||||
$cat_params = array_merge($cat_params, $params);
|
||||
|
||||
// makese 'selected' an arr
|
||||
@ -106,8 +105,6 @@ function do_print_categories_list(&$lines, &$indentstack, &$result, $params) {
|
||||
|
||||
|
||||
$cat_entry = $params['selected'];
|
||||
//list($catId) = each($categories);
|
||||
|
||||
|
||||
if (isset($params['type']) && ($params['type']=='form' || $params['type']=='check')) {
|
||||
$string = '<label><input name="'.$catname.'cats['.$vid.']" ';
|
||||
|
@ -259,14 +259,9 @@ class Smarty_Compiler extends Smarty {
|
||||
|
||||
preg_match_all($search, $source_content, $match, PREG_SET_ORDER);
|
||||
$this->_folded_blocks = $match;
|
||||
reset($this->_folded_blocks);
|
||||
|
||||
/* replace special blocks by "{php}" */
|
||||
$source_content = preg_replace_callback($search, create_function ('$matches', "return '"
|
||||
. $this->_quote_replace($this->left_delimiter) . 'php'
|
||||
. "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'"
|
||||
. $this->_quote_replace($this->right_delimiter)
|
||||
. "';")
|
||||
$source_content = preg_replace_callback($search, array($this,'_preg_callback')
|
||||
, $source_content);
|
||||
|
||||
/* Gather all template tags. */
|
||||
@ -556,7 +551,7 @@ class Smarty_Compiler extends Smarty {
|
||||
|
||||
case 'php':
|
||||
/* handle folded tags replaced by {php} */
|
||||
list(, $block) = each($this->_folded_blocks);
|
||||
$block = array_shift($this->_folded_blocks);
|
||||
$this->_current_line_no += substr_count($block[0], "\n");
|
||||
/* the number of matched elements in the regexp in _compile_file()
|
||||
determins the type of folded tag that was found */
|
||||
@ -754,7 +749,12 @@ class Smarty_Compiler extends Smarty {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function _preg_callback ($matches) {
|
||||
return $this->_quote_replace($this->left_delimiter)
|
||||
. 'php'
|
||||
. str_repeat("\n", substr_count($matches[1], "\n"))
|
||||
. $this->_quote_replace($this->right_delimiter);
|
||||
}
|
||||
/**
|
||||
* compile custom function tag
|
||||
*
|
||||
|
@ -20,7 +20,6 @@ function smarty_function_list_categories($params) //, &$smarty)
|
||||
'selected' => array()
|
||||
);
|
||||
|
||||
//list($catId) = each($categories);
|
||||
$cat_params = array_merge($cat_params, $params);
|
||||
|
||||
// makese 'selected' an arr
|
||||
@ -106,8 +105,6 @@ function do_print_categories_list(&$lines, &$indentstack, &$result, $params) {
|
||||
|
||||
|
||||
$cat_entry = $params['selected'];
|
||||
//list($catId) = each($categories);
|
||||
|
||||
|
||||
if (isset($params['type']) && ($params['type']=='form' || $params['type']=='check')) {
|
||||
$string = '<label><input name="'.$catname.'cats['.$vid.']" ';
|
||||
|
@ -194,7 +194,7 @@ if (!defined('MOD_INDEX')) {
|
||||
if ($searchjusthese) {
|
||||
$this->_constrained_list = $searchjusthese;
|
||||
}
|
||||
return parent::fs_filelister();
|
||||
return parent::__construct();
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user