Update of /cvsroot/phpslash/phpslash-ft/class
In directory sc8-pr-cvs1:/tmp/cvs-serv5344/phpslash-ft/class
Modified Files:
Block.class Block_i.class Block_admin.class
Log Message:
Block messages translated
Index: Block.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block.class,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** Block.class 11 Dec 2002 19:39:53 -0000 1.23
--- Block.class 22 Jan 2003 17:28:42 -0000 1.24
***************
*** 12,16 ****
/* Var's to be constructed in constructor */
! var $db, $block_info, $parser, $parsedData, $parser_arr, $block_ary, $_PSL, $perm;
/**
--- 12,16 ----
/* Var's to be constructed in constructor */
! var $db, $block_info, $parser, $parsedData, $parser_arr, $block_ary, $_PSL, $perm, $message;
/**
***************
*** 85,93 ****
$this->db->query("INSERT INTO psl_block_type (id, name) VALUES ('$id','$type')");
if ($this->db->affected_rows != 1) {
! $this->message = "Block Type: $type added with an id of: $id";
! return true;
} else {
! $this->message = "Error entering $type!";
! return false;
}
}
--- 85,93 ----
$this->db->query("INSERT INTO psl_block_type (id, name) VALUES ('$id','$type')");
if ($this->db->affected_rows != 1) {
! $this->message = sprintf(pslgetText("Block Type: %s added with an id of: %s"), $type, $id);
! return true;
} else {
! $this->message = sprintf(pslgetText("Error entering %s!"), $type);
! return false;
}
}
***************
*** 124,129 ****
$go_ahead = false;
$title = $this->db->Record["title"];
! $this->message = "Sorry, this block_type($type_name) is assigned to this block:";
! $this->message .= "<font color=\"red\">'$title'</font><br />\n";
}
--- 124,128 ----
$go_ahead = false;
$title = $this->db->Record["title"];
! $this->message = sprintf(pslgetText("Sorry, this block_type(%s) is assigned to this block: %s"), $type_name, $title);
}
***************
*** 135,139 ****
WHERE name = '$type_name'";
$this->db->query($q);
! $this->message = "<i>Block Type $type_name deleted</i>";
return true;
--- 134,138 ----
WHERE name = '$type_name'";
$this->db->query($q);
! $this->message = sprintf(pslgetText("Block Type %s deleted"), $type_name);
return true;
***************
*** 173,179 ****
if ($this->db->nf() > 1) {
! $this->error_block("Multiple blocks exsist with id: $id. Stoping.");
} elseif ($this->db->nf() < 1) {
! $this->error_block("Block: $id does not exist. Stopping.");
} else {
--- 172,180 ----
if ($this->db->nf() > 1) {
! $this->message = sprintf(pslgetText("Multiple blocks exist with id: %s. Stopping."), $id);
! return false;
} elseif ($this->db->nf() < 1) {
! $this->message = sprintf(pslgetText("Block: %s does not exist. Stopping."), $id);
! return false;
} else {
***************
*** 194,197 ****
--- 195,199 ----
"block_options" => unserialize($this->db->f("block_options"))
);
+ return true;
}
***************
*** 224,228 ****
$serial_opts=addslashes(serialize($block_options_ary));
! debug("Block::putBlock", "Adding slashes to block");
while ( list($key, $val) = each($block_array) ) {
--- 226,230 ----
$serial_opts=addslashes(serialize($block_options_ary));
! // debug("Block::putBlock", "Adding slashes to block");
while ( list($key, $val) = each($block_array) ) {
***************
*** 232,236 ****
if ($block_array["block_id"] != "") {
! $this->message = "Updating Block " . $block_array["block_id"] . "<br>\n";
$section_del = "DELETE FROM psl_section_block_lut
--- 234,238 ----
if ($block_array["block_id"] != "") {
! $this->message = sprintf(pslgetText("Updating Block %s. "), $block_array["block_id"]);
$section_del = "DELETE FROM psl_section_block_lut
***************
*** 239,243 ****
// echo "<H3>SECTION_DEL: $section_del</H3>\n";
$this->db->query($section_del);
! $timestamp = time();
$query = "UPDATE psl_block
--- 241,245 ----
// echo "<H3>SECTION_DEL: $section_del</H3>\n";
$this->db->query($section_del);
! $timestamp = time();
$query = "UPDATE psl_block
***************
*** 260,265 ****
} else {
! $this->message = "Creating new block from submitted info.<br>\n";
! $timestamp = time();
$block_array["block_id"] = generateID("psl_block_seq");
$query = "INSERT INTO psl_block
--- 262,267 ----
} else {
! $this->message = pslgetText("Creating new block from submitted info.");
! $timestamp = time();
$block_array["block_id"] = generateID("psl_block_seq");
$query = "INSERT INTO psl_block
***************
*** 283,292 ****
'$serial_opts')
";
! $this->message .= "Adding the block to the db...<br>\n";
$this->db->query($query);
}
! if(is_array($section_id_ary) ) {
while ( list( $key, $val ) = each( $section_id_ary ) ) {
$lut_id = generateID("psl_section_block_lut_seq");
--- 285,294 ----
'$serial_opts')
";
! $this->message .= pslgetText("Adding the block to the db...");
$this->db->query($query);
}
! if(is_array($section_id_ary) ) {
while ( list( $key, $val ) = each( $section_id_ary ) ) {
$lut_id = generateID("psl_section_block_lut_seq");
***************
*** 300,309 ****
# echo "<H3>LUT_INSERT: $lut_insert</H3>\n";
$this->db->query($lut_insert);
! }
} else {
! $this->message .= "No section chosen. Block will not be displayed on site till a section is chosen for block: <i>$block_array[block_title]</i><br>\n";
}
! $this->message .= "Checking db...<br>\n";
if ($this->db->affected_rows() == 1) {
// $this->message .= "Here's a preview...<br>\n";
--- 302,311 ----
# echo "<H3>LUT_INSERT: $lut_insert</H3>\n";
$this->db->query($lut_insert);
! }
} else {
! $this->message .= sprintf(pslgetText("No section chosen. Block will not be displayed on site till a section is chosen for block: %s"), $block_array[block_title]);
}
! $this->message .= pslgetText("Checking db...");
if ($this->db->affected_rows() == 1) {
// $this->message .= "Here's a preview...<br>\n";
***************
*** 313,322 ****
$this->message .= $this->doBlock($block_array["block_id"]);
} else {
! $this->message .= "Error adding block. Query returned multiple results.<br>";
return false;
}
} else {
! $this->message = "Block::putBlock() received data not in an array.<br>\n";
! return false;
}
return $this->message;
--- 315,324 ----
$this->message .= $this->doBlock($block_array["block_id"]);
} else {
! $this->message .= pslgetText("Error adding block. Query returned multiple results.");
return false;
}
} else {
! $this->message = pslgetText("Block::putBlock() received data not in an array.");
! return false;
}
return $this->message;
***************
*** 423,441 ****
$parserName = "Block_render_" . $mytype;
$parserFile = $parserName . ".class";
! debug("Block::getParser::parserName",$parserName);
static $parser_arr;
if( empty($parser_arr[$mytype])) {
!
! /*
! if( @file_exists($this->psl['classdir'] .'/'. $parserFile)) {
! include($this->psl['classdir'] .'/'. $parserFile);
! $parser_arr[$mytype] = new $parserName;
! } else {
! $parser_arr[$mytype] = false;
! }
! */
! $parser_arr[$mytype] = pslNew($parserName);
}
$this->parser = $parser_arr[$mytype];
--- 425,434 ----
$parserName = "Block_render_" . $mytype;
$parserFile = $parserName . ".class";
! // debug("Block::getParser::parserName",$parserName);
static $parser_arr;
if( empty($parser_arr[$mytype])) {
! $parser_arr[$mytype] = pslNew($parserName);
}
$this->parser = $parser_arr[$mytype];
***************
*** 499,503 ****
WHERE id = '$id'";
}
! debug("Block::storeParsed::Update query:", $query);
$this->db->query($query);
if ($this->db->affected_rows() != 1) {
--- 492,496 ----
WHERE id = '$id'";
}
! // debug("Block::storeParsed::Update query:", $query);
$this->db->query($query);
if ($this->db->affected_rows() != 1) {
Index: Block_i.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_i.class,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** Block_i.class 20 Dec 2002 22:17:29 -0000 1.24
--- Block_i.class 22 Jan 2003 17:28:42 -0000 1.25
***************
*** 93,101 ****
function getBlocks($ary, $column="") {
! debug("Block_i.class::getBlocks::ary", $ary);
if ( $this->argv_ary != $ary) {
$this->argv_ary = $ary;
! $block_ary = $this->extractBlocks( $ary);
}
--- 93,101 ----
function getBlocks($ary, $column="") {
! // debug("Block_i.class::getBlocks::ary", $ary);
if ( $this->argv_ary != $ary) {
$this->argv_ary = $ary;
! $block_ary = $this->extractBlocks( $ary);
}
***************
*** 103,111 ****
for ($i=0; $i < count($this->block_ary); $i++) {
! if( empty($this->block_ary[$i]['block_options']['perms'])) {
$output .= $this->parseBlock($this->block_ary[$i], $column);
! } elseif ($this->perm->have_perm($this->block_ary[$i]['block_options']['perms'])) {
! $output .= $this->parseBlock($this->block_ary[$i], $column);
! }
}
--- 103,111 ----
for ($i=0; $i < count($this->block_ary); $i++) {
! if( empty($this->block_ary[$i]['block_options']['perms'])) {
$output .= $this->parseBlock($this->block_ary[$i], $column);
! } elseif ($this->perm->have_perm($this->block_ary[$i]['block_options']['perms'])) {
! $output .= $this->parseBlock($this->block_ary[$i], $column);
! }
}
***************
*** 150,188 ****
}
! $var_ary = "";
if (is_array($ary['block_options'])) {
! // remove column from array
! unset($ary["block_options"]["column"]);
! while( list( $key, $val) = @each( $ary["block_options"] )) {
switch($key) {
! case "width":
! // pass width to getFancyBox
$width = $ary["block_options"]["width"];
! // remove width from array
! $ary["block_options"]["width"] = '';
! break;
! case "box_type":
! // pass box_type to getFancyBox
! $box_type = $ary["block_options"]["box_type"];
! // remove box_type from array
! $ary["block_options"]["box_type"] = '';
! break;
! case "perms":
! // remove perms from array
! $ary["block_options"]["perms"] = '';
! break;
! case "cache_data":
! // remove cache_data from array
! $ary["block_options"]["cache_data"] = '';
! break;
! default:
! // pluggable user defined function
if (!empty($this->psl['block_options_udf'])) {
$ary = $this->psl['block_options_udf']($key, $value, $ary);
--- 150,188 ----
}
! $var_ary = "";
if (is_array($ary['block_options'])) {
! // remove column from array
! unset($ary["block_options"]["column"]);
! while( list( $key, $val) = @each( $ary["block_options"] )) {
switch($key) {
! case "width":
! // pass width to getFancyBox
$width = $ary["block_options"]["width"];
! // remove width from array
! $ary["block_options"]["width"] = '';
! break;
! case "box_type":
! // pass box_type to getFancyBox
! $box_type = $ary["block_options"]["box_type"];
! // remove box_type from array
! $ary["block_options"]["box_type"] = '';
! break;
! case "perms":
! // remove perms from array
! $ary["block_options"]["perms"] = '';
! break;
! case "cache_data":
! // remove cache_data from array
! $ary["block_options"]["cache_data"] = '';
! break;
! default:
! // pluggable user defined function
if (!empty($this->psl['block_options_udf'])) {
$ary = $this->psl['block_options_udf']($key, $value, $ary);
***************
*** 190,203 ****
// let the fancybox template parse any block options left over.
$var_ary = array(strtoupper($key) => $ary['block_options'][$key]);
! $ary['block_options'][$key] = '';
// what is left over?
// debug("block_options[$key]", $val);
break;
! }
! }
}
! debug("Block_i.class::parseBlock::ary", $ary);
return getFancyBox($width, $temptitle, $ary["cache_data"],$link, $box_type, $var_ary);
--- 190,203 ----
// let the fancybox template parse any block options left over.
$var_ary = array(strtoupper($key) => $ary['block_options'][$key]);
! $ary['block_options'][$key] = '';
// what is left over?
// debug("block_options[$key]", $val);
break;
! }
! }
}
! // debug("Block_i.class::parseBlock::ary", $ary);
return getFancyBox($width, $temptitle, $ary["cache_data"],$link, $box_type, $var_ary);
Index: Block_admin.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_admin.class,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Block_admin.class 20 Dec 2002 22:17:29 -0000 1.6
--- Block_admin.class 22 Jan 2003 17:28:42 -0000 1.7
***************
*** 238,242 ****
$this->templ->set_var(array(
! 'TITLEBAR' => getTitlebar("100%", "Update the Current Blocks"),
'MODIFYURL' => $modifyurl,
'DELURL' => $delurl,
--- 238,242 ----
$this->templ->set_var(array(
! 'TITLEBAR' => getTitlebar("100%", pslgetText("Update the Current Blocks")),
'MODIFYURL' => $modifyurl,
'DELURL' => $delurl,
***************
*** 248,256 ****
));
if ($i%2 == 0) {
! $this->templ->parse("rows","row","true");
! } else {
$this->templ->parse("rows","row2","true");
! }
! $i++;
}
--- 248,256 ----
));
if ($i%2 == 0) {
! $this->templ->parse("rows","row","true");
! } else {
$this->templ->parse("rows","row2","true");
! }
! $i++;
}
***************
*** 276,285 ****
));
! $output = getTitlebar("100%","Manage Block Types");
if( $option == "all") {
$fulldirlist = dir($this->psl['classdir']);
! $i=1;
while( $eachfile = $fulldirlist->read()) {
$each = $this->psl['classdir'] . "/" . $eachfile;
--- 276,285 ----
));
! $output = getTitlebar("100%",pslgetText("Manage Block Types"));
if( $option == "all") {
$fulldirlist = dir($this->psl['classdir']);
! $i=1;
while( $eachfile = $fulldirlist->read()) {
$each = $this->psl['classdir'] . "/" . $eachfile;
***************
*** 288,294 ****
$eachtype = str_replace("Block_render_", "", $eachfile);
! $eachtype = str_replace(".class", "", $eachtype);
! $avail_ary[$eachtype] = $i;
! $i++;
}
}
--- 288,294 ----
$eachtype = str_replace("Block_render_", "", $eachfile);
! $eachtype = str_replace(".class", "", $eachtype);
! $avail_ary[$eachtype] = $i;
! $i++;
}
}
***************
*** 296,314 ****
$current_types = $this->getTypes();
! $this->templ->set_block("listblocktypes", "removerow", "removerows");
while( list($key, $val) = each($current_types) ) {
! $current_type = $val;
$this->templ->set_var(array(
REMOVENAME => $current_type,
! REMOVEURL => $this->psl['phpself'] ."?option=delete". $this->psl['amp'] ."name=". $current_type
! ));
$this->templ->parse("removerows","removerow",true);
! if( isset($avail_ary[$current_type])) {
unset($avail_ary[$current_type]);
! }
! }
$this->templ->set_block("listblocktypes","addrow","rows");
while( list($key, $val) = each($avail_ary) ) {
--- 296,314 ----
$current_types = $this->getTypes();
! $this->templ->set_block("listblocktypes", "removerow", "removerows");
while( list($key, $val) = each($current_types) ) {
! $current_type = $val;
$this->templ->set_var(array(
REMOVENAME => $current_type,
! REMOVEURL => $this->psl['phpself'] ."?option=delete". $this->psl['amp'] ."name=". $current_type
! ));
$this->templ->parse("removerows","removerow",true);
! if( isset($avail_ary[$current_type])) {
unset($avail_ary[$current_type]);
! }
! }
$this->templ->set_block("listblocktypes","addrow","rows");
while( list($key, $val) = each($avail_ary) ) {
***************
*** 316,321 ****
$this->templ->set_var(array(
'ADDNAME' => $key,
! 'ADDURL' => $this->psl[phpself] ."?option=add". $this->psl[amp] ."name=". $key
! ));
$this->templ->parse("rows","addrow",true);
--- 316,321 ----
$this->templ->set_var(array(
'ADDNAME' => $key,
! 'ADDURL' => $this->psl[phpself] ."?option=add". $this->psl[amp] ."name=". $key
! ));
$this->templ->parse("rows","addrow",true);
***************
*** 326,335 ****
} elseif ($option == "add") {
$this->putType($name);
! $this->listBlockTypes("all");
} elseif ($option == "delete") {
$this->deleteType($name);
! $this->listBlockTypes("all");
} else {
! $output .= "<A HREF=" . $this->psl['phpself'] . "?submit=display" . $this->psl['amp'] . "option=all>[Add or Remove Block Types]</A>";
}
return $output;
--- 326,335 ----
} elseif ($option == "add") {
$this->putType($name);
! $this->listBlockTypes("all");
} elseif ($option == "delete") {
$this->deleteType($name);
! $this->listBlockTypes("all");
} else {
! $output .= "<A HREF=" . $this->psl['phpself'] . "?submit=display" . $this->psl['amp'] . "option=all>".pslgetText("[Add or Remove Block Types]")."</A>";
}
return $output;
|