/openconstructor/catalog/headline._wc
http://openconstructor.googlecode.com/ · Unknown · 93 lines · 93 code · 0 blank · 0 comment · 0 complexity · 6be109b20a68b1ec519dcfd355813e46 MD5 · raw file
- <?php
- /**
- * Copyright 2003 - 2007 eSector Solutions, LLC
- *
- * All rights reserved.
- *
- * This file is part of Open Constructor (http://www.openconstructor.org/).
- *
- * Open Constructor is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * Open Constructor is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * The GNU General Public License can be found at
- * http://www.gnu.org/copyleft/gpl.html
- *
- * $Id: headline._wc,v 1.5 2007/02/27 11:23:25 sanjar Exp $
- */
- require_once('../include/headlines._wc');
- $alldoc = isset($_COOKIE['vd']['alldoc']);
- if(isset($_COOKIE['vd']['description']))
- $t = &$tree;
- else
- $t = null;
- if($alldoc) {
- require_once(LIBDIR.'/hybrid/dshybridfactory._wc');
- $dsf = new DSHybridFactory();
- $ids = implode(',', $tmp = $dsf->getChildren($currentDs));
- $autocast = isset($_COOKIE['vd']['cast']);
- } else {
- $ids = $currentDs;
- $autocast = false;
- }
- $pagesize=30;
- if(intval(@$_COOKIE['pagesize'])>0)
- $pagesize=$_COOKIE['pagesize'];
- if(is_object($ds)) {
- $searchclause = $ds->isIndexable && !isset($_GET['noindex']) ? get_index_clause(@$_GET['search']) : get_clause(@$_GET['search'], 'header');
- list($items, $hl) = get_filtered_headline($currentDs, $curnode, $t, $alldoc, $autocast, $pagesize, @$_GET['page'], $searchclause);
- } else {
- list($items, $hl) = array(0, array());
- }
- $icon='hyb';
- $eWidth=788;$eHeight=520;
- $editor = WCHOME.'/data/hybrid/edit.php?'.($autocast ? '1' : 'ds_id='.$currentDs);
- $fields=array(
- 'header'=>HL_HEADER,
- 'description'=>true,
- 'type'=>HL_HYBRIDTYPE,
- 'alldoc'=>true,
- 'cast'=>true,
- 'date'=>HL_DATE
- );
- $fieldnames=array(
- 'type'=>array('name' => 'type', 'title' => RP_SHOW_HYBRIDTYPE, 'st' => true),
- 'description'=>array('name' => 'description', 'title' => RP_SHOW_NODES, 'st' => true),
- 'alldoc'=>array('name' => 'alldoc', 'title' => RP_INCLUDE_SUBDOCUMENTS, 'st' => true),
- 'cast'=>array('name' => 'cast', 'title' => RP_AUTOCAST_ON_EDIT, 'st' => true),
- 'date'=>array('name' => 'date', 'title' => RP_SHOW_DATE, 'st' => true)
- );
- if(!$alldoc)
- unset($fieldnames['type'],$fieldnames['cast'],$fields['type']);
- if(sizeof(@$_COOKIE['vd']))
- foreach($fieldnames as $key => $value){
- if(!isset($_COOKIE['vd'][$key]))
- $fieldnames[$key]['st'] = false;
- if (!$fieldnames[$key]['st']) unset($fields[$key]);
- }
- require_once(LIBDIR.'/pager._wc');
- $pager = noSqlPager($items, 'page', $pagesize, 10);
- /*
- if(is_array(@$_COOKIE['vd']))
- foreach($_COOKIE['vd'] as $f=>$st)
- if($st=='disabled') unset($fields[$f]);
- echo '<documents server="hybrid/i_hybrid.php"'
- .' type="'.$icon.'"'
- .' defaultaction="delete_hybrid"'
- .' size="'.(intval(@$_COOKIE['pagesize'])>0?$_COOKIE['pagesize']:$pagesize).'"'
- .'>';
- echo '<editor href="'.$editor.'" width="'.$w.'" height="'.$h.'"/>';
- echo '<hidden name="ds_id" value="'.$currentDs.'"/>';
- echo '<hidden name="dest_ds_id" value="'.$currentDs.'"/>';
- print_headline($hl);
- require_once(LIBDIR.'/pager._wc');
- // pager('page','dshybrid','id','WHERE ds_id IN ('.$ids.')',$pagesize,10,$searchclause);
- noSqlPager($items, 'page', $pagesize, 10);
- echo '</documents>';
- */
- ?>