Update of /cvsroot/phpslash/phpslash-dev/include/modules/block
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31286/phpslash-dev/include/modules/block
Modified Files:
Block.class Block_admin.class Block_i.class
Log Message:
block plugins operational
Index: Block.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/block/Block.class,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Block.class 18 Oct 2004 17:11:23 -0000 1.11
--- Block.class 5 Nov 2004 16:32:40 -0000 1.12
***************
*** 220,229 ****
for( $i=0 ; $i < count($block_array['optionname']) ; $i++) {
if( $optionname_ary[$i] != "") {
! $optname = $optionname_ary[$i];
! $optval = $optionval_ary[$i];
! $block_options_ary[$optname] = $optval;
! }
!
}
// move the section id's from the array value to the array key
if(array_key_exists('section_id_ary', $block_array) &&
--- 220,272 ----
for( $i=0 ; $i < count($block_array['optionname']) ; $i++) {
if( $optionname_ary[$i] != "") {
! $optname = $optionname_ary[$i];
! $optval = $optionval_ary[$i];
! $block_options_ary[$optname] = $optval;
! }
}
+
+ $block_array['block_options'] = $block_options_ary;
+ if (is_array($block_options_ary)) {
+ // while( list( $key, $val) = @each( $block_array['block_options'] )) {
+ $i = 0;
+ foreach( $block_options_ary as $key => $val) {
+ switch($key) {
+
+ /* Stub for future needs.
+ case "example":
+ $block_array['block_options'][$key] = '';
+ break;
+ */
+
+ default:
+ $this->block_plugin['type'] = $block_array['block_options'][$i][$key];
+ $requestedHook = 'input';
+ $optionHook = $this->psl['default_block_options'][$i]['hook'];
+ // only process input plugins
+ if($optionHook == $requestedHook) {
+ // attempt to handle the requested plugin
+ // and if not there procee
+ // yes - one equal sign
+ if($parsed = $this->doPluginParse($val,$block_array)) {
+ $block_array = $this->parsedPluginData;
+ } else {
+ // pluggable user defined function
+ if ($this->psl['block_options_udf'] != '') {
+ $block_array = $this->psl['block_options_udf']($key,$block_arrat['block_options'][$key] , $block_array);
+ }
+ }
+ }
+
+ $block_array['block_options'][$i][$key] = '';
+ // what is left over?
+ // debug("block_options[$key]", $val);
+ break;
+
+ }
+ $i++;
+ }
+ }
+
+
// move the section id's from the array value to the array key
if(array_key_exists('section_id_ary', $block_array) &&
***************
*** 377,381 ****
logwrite("Block Addition", "Added block " . $block_array['block_id']);
// $this->message .= $this->doBlock($block_array["block_id"]);
! $this->message .= $block_array["block_id"] . pslgettext(" block added");
} else {
$this->message .= pslgetText("Error adding block. Query returned multiple results.");
--- 420,424 ----
logwrite("Block Addition", "Added block " . $block_array['block_id']);
// $this->message .= $this->doBlock($block_array["block_id"]);
! $this->message .= $block_array["block_id"] . pslgettext(" block added");
} else {
$this->message .= pslgetText("Error adding block. Query returned multiple results.");
***************
*** 826,830 ****
return true;
} else {
! return false;
}
}
--- 869,873 ----
return true;
} else {
! return false;
}
}
Index: Block_admin.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/block/Block_admin.class,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Block_admin.class 4 Nov 2004 20:17:03 -0000 1.7
--- Block_admin.class 5 Nov 2004 16:32:40 -0000 1.8
***************
*** 271,275 ****
'TITLE' => $this->db->f("title"),
'URL' => $this->db->f("location"),
! 'SOURCE_URL' => $this->db->f("source_url"),
'ORDERNUM' => $this->db->f("ordernum"),
'COLUMN' => $block_options['column'],
--- 271,275 ----
'TITLE' => $this->db->f("title"),
'URL' => $this->db->f("location"),
! 'SOURCE_URL' => substr($this->db->f("source_url"),0,32),
'ORDERNUM' => $this->db->f("ordernum"),
'COLUMN' => $block_options['column'],
Index: Block_i.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/block/Block_i.class,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Block_i.class 19 Oct 2004 21:47:19 -0000 1.5
--- Block_i.class 5 Nov 2004 16:32:41 -0000 1.6
***************
*** 129,136 ****
if (is_array($ary['block_options'])) {
! // remove column from array
! unset($ary["block_options"]["column"]);
foreach( $ary["block_options"] as $key => $val) {
! // while( list( $key, $val) = @each( $ary["block_options"] )) {
switch($key) {
--- 129,137 ----
if (is_array($ary['block_options'])) {
! // remove column from array
! unset($ary["block_options"]["column"]);
! unset($ary["block_options"]["tpl"]);
foreach( $ary["block_options"] as $key => $val) {
! // while( list( $key, $val) = @each( $ary["block_options"] )) {
switch($key) {
***************
*** 138,142 ****
case "width":
// pass width to getFancyBox
! $width = $ary["block_options"]["width"];
// remove width from array
$ary["block_options"]["width"] = '';
--- 139,143 ----
case "width":
// pass width to getFancyBox
! $width = $ary["block_options"]["width"];
// remove width from array
$ary["block_options"]["width"] = '';
***************
*** 150,159 ****
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"] = '';
--- 151,160 ----
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"] = '';
***************
*** 161,183 ****
default:
!
! // attempt to handle any plugins and if not there proceed
! // yes - one equal sign
! if($parsed = $this->doPluginParse($val,$ary)) {
! $ary = $this->parsedPluginData;
! } else {
! // pluggable user defined function
! if (!empty($this->psl['block_options_udf'])) {
! $ary = $this->psl['block_options_udf']($key, $value, $ary);
! }
! // 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;
}
--- 162,183 ----
default:
! // attempt to handle any plugins and if not there proceed
! // yes - one equal sign
! if($parsed = $this->doPluginParse($val,$ary)) {
! $ary = $this->parsedPluginData;
! } else {
! // pluggable user defined function
! if (!empty($this->psl['block_options_udf'])) {
! $ary = $this->psl['block_options_udf']($key, $value, $ary);
! }
! // 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;
}
|