Update of /cvsroot/phpslash/phpslash-dev/include/modules/block/blocktypes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29826/phpslash-dev/include/modules/block/blocktypes
Modified Files:
Block_render_html.class Block_render_page.class
Block_render_template.class
Log Message:
html blocks accept template tags, index page accepts view argument like backend.php
Index: Block_render_html.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/block/blocktypes/Block_render_html.class,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Block_render_html.class 26 Nov 2003 17:26:53 -0000 1.2
--- Block_render_html.class 4 Nov 2004 20:17:04 -0000 1.3
***************
*** 18,37 ****
$this->output = $block_info["cache_data"];
- return 1;
! /*
! $sl_q = pslNew("slashDB");
! $query = "SELECT cache_data
! FROM psl_block
! WHERE id = " . $block_info["id"];
! $sl_q->query($query);
! if ($sl_q->next_record()) {
! $this->output = $sl_q->f("cache_data");
! return 1;
! } else {
! return 0;
}
! unset($db);
! */
}
--- 18,49 ----
$this->output = $block_info["cache_data"];
! if(strpos($block_info["cache_data"], '{')){
! if(array_key_exists('template', $GLOBALS) && is_object($GLOBALS['template'])) {
! $template = $GLOBALS['template'];
! } else {
! $template = pslNew("slashTemplate");
! }
! $template->debug = 0;
! $template->set_var('template', $block_info["cache_data"]);
!
! $template->set_var(array(
! 'SKIN' => $this->psl['skin'],
! 'PHP_SELF' => $this->psl['phpself'],
! 'ROOTDIR' => $this->psl['rooturl'],
! 'IMAGEDIR' => $this->psl['imageurl'],
! 'ROOTURL' => $this->psl['rooturl'],
! 'IMAGEURL' => $this->psl['imageurl'],
! 'QUERY_STRING' => $_SERVER['QUERY_STRING']
! ));
!
! foreach( $block_info["block_options"] as $key => $val) {
! $template->set_var(strtoupper($key), $block_info['block_options'][$key]);
! }
!
! $this->output = $template->parse('OUT','template');
}
! return true;
!
}
Index: Block_render_page.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/block/blocktypes/Block_render_page.class,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Block_render_page.class 18 Oct 2004 17:14:00 -0000 1.6
--- Block_render_page.class 4 Nov 2004 20:17:04 -0000 1.7
***************
*** 59,65 ****
$bottomblocks = $block->getBlocks($ary, "bottom");
if (empty($leftblocks)) {
if (empty($rightblocks)) {
- // $centerblocks = $block->getBlocks($ary);
$tplfile = "index1col.tpl";
} else {
--- 59,69 ----
$bottomblocks = $block->getBlocks($ary, "bottom");
+ // If the view is let module control page
+ if(array_key_exists('view', $GLOBALS['ary'])) {
+ $this->output = $centerblocks;
+ return true;
+ }
if (empty($leftblocks)) {
if (empty($rightblocks)) {
$tplfile = "index1col.tpl";
} else {
***************
*** 94,97 ****
--- 98,103 ----
'ROOTDIR' => $this->psl['rooturl'],
'IMAGEDIR' => $this->psl['imageurl'],
+ 'ROOTURL' => $this->psl['rooturl'],
+ 'IMAGEURL' => $this->psl['imageurl'],
'BREADCRUMB' => $breadcrumb,
// 'STORY_COLUMN' => $allstories,
Index: Block_render_template.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/block/blocktypes/Block_render_template.class,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Block_render_template.class 4 Jun 2003 20:02:45 -0000 1.2
--- Block_render_template.class 4 Nov 2004 20:17:04 -0000 1.3
***************
*** 37,44 ****
$template->set_var(array(
'SKIN' => $this->psl['skin'],
'ROOTDIR' => $this->psl['rooturl'],
! 'IMAGEDIR' => $this->psl['imageurl']
));
$this->output = $template->parse('OUT','template');
return true;
--- 37,52 ----
$template->set_var(array(
'SKIN' => $this->psl['skin'],
+ 'PHP_SELF' => $this->psl['phpself'],
'ROOTDIR' => $this->psl['rooturl'],
! 'IMAGEDIR' => $this->psl['imageurl'],
! 'ROOTURL' => $this->psl['rooturl'],
! 'IMAGEURL' => $this->psl['imageurl'],
! 'QUERY_STRING' => $_SERVER['QUERY_STRING']
));
+ foreach( $block_info["block_options"] as $key => $val) {
+ $template->set_var(strtoupper($key), $block_info['block_options'][$key]);
+ }
+
$this->output = $template->parse('OUT','template');
return true;
|