PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/openconstructor/catalog/headline._wc

http://openconstructor.googlecode.com/
Unknown | 93 lines | 93 code | 0 blank | 0 comment | 0 complexity | 6be109b20a68b1ec519dcfd355813e46 MD5 | raw file
 1<?php
 2/**
 3 * Copyright 2003 - 2007 eSector Solutions, LLC
 4 * 
 5 * All rights reserved.
 6 * 
 7 * This file is part of Open Constructor (http://www.openconstructor.org/).
 8 * 
 9 * Open Constructor is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation.
12 * 
13 * Open Constructor is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 * 
18 * The GNU General Public License can be found at
19 * http://www.gnu.org/copyleft/gpl.html
20 * 
21 * $Id: headline._wc,v 1.5 2007/02/27 11:23:25 sanjar Exp $
22 */
23	require_once('../include/headlines._wc');
24	$alldoc = isset($_COOKIE['vd']['alldoc']);
25	if(isset($_COOKIE['vd']['description']))
26		$t = &$tree;
27	else
28		$t = null;
29	if($alldoc) {
30		require_once(LIBDIR.'/hybrid/dshybridfactory._wc');
31		$dsf = new DSHybridFactory();
32		$ids = implode(',', $tmp = $dsf->getChildren($currentDs));
33		$autocast = isset($_COOKIE['vd']['cast']);
34	} else {
35		$ids = $currentDs;
36		$autocast = false;
37	}
38	$pagesize=30;
39	if(intval(@$_COOKIE['pagesize'])>0)
40		$pagesize=$_COOKIE['pagesize'];
41	if(is_object($ds)) {
42		$searchclause = $ds->isIndexable && !isset($_GET['noindex']) ? get_index_clause(@$_GET['search']) : get_clause(@$_GET['search'], 'header');
43		list($items, $hl) = get_filtered_headline($currentDs, $curnode, $t, $alldoc, $autocast, $pagesize, @$_GET['page'], $searchclause);
44	} else {
45		list($items, $hl) = array(0, array());
46	}
47	$icon='hyb';
48	$eWidth=788;$eHeight=520;
49	$editor = WCHOME.'/data/hybrid/edit.php?'.($autocast ? '1' : 'ds_id='.$currentDs);
50	$fields=array(
51		'header'=>HL_HEADER,
52		'description'=>true,
53		'type'=>HL_HYBRIDTYPE,
54		'alldoc'=>true,
55		'cast'=>true,
56		'date'=>HL_DATE
57	);
58	$fieldnames=array(
59		'type'=>array('name' => 'type', 'title' => RP_SHOW_HYBRIDTYPE, 'st' => true),
60		'description'=>array('name' => 'description', 'title' => RP_SHOW_NODES, 'st' => true),
61		'alldoc'=>array('name' => 'alldoc', 'title' => RP_INCLUDE_SUBDOCUMENTS, 'st' => true),
62		'cast'=>array('name' => 'cast', 'title' => RP_AUTOCAST_ON_EDIT, 'st' => true),
63		'date'=>array('name' => 'date', 'title' => RP_SHOW_DATE, 'st' => true)
64	);
65	if(!$alldoc)
66		unset($fieldnames['type'],$fieldnames['cast'],$fields['type']);
67	if(sizeof(@$_COOKIE['vd']))
68		foreach($fieldnames as $key => $value){
69			if(!isset($_COOKIE['vd'][$key]))
70				$fieldnames[$key]['st'] = false;
71	        if (!$fieldnames[$key]['st']) unset($fields[$key]);
72		}
73	require_once(LIBDIR.'/pager._wc');
74	$pager = noSqlPager($items, 'page', $pagesize, 10);
75/*	
76	if(is_array(@$_COOKIE['vd']))
77		foreach($_COOKIE['vd'] as $f=>$st)
78			if($st=='disabled') unset($fields[$f]);
79	echo '<documents server="hybrid/i_hybrid.php"'
80			.' type="'.$icon.'"'
81			.' defaultaction="delete_hybrid"'
82			.' size="'.(intval(@$_COOKIE['pagesize'])>0?$_COOKIE['pagesize']:$pagesize).'"'
83		.'>';
84	echo '<editor href="'.$editor.'" width="'.$w.'" height="'.$h.'"/>';
85	echo '<hidden name="ds_id" value="'.$currentDs.'"/>';
86	echo '<hidden name="dest_ds_id" value="'.$currentDs.'"/>';
87	print_headline($hl);
88	require_once(LIBDIR.'/pager._wc');
89//	pager('page','dshybrid','id','WHERE ds_id IN ('.$ids.')',$pagesize,10,$searchclause);
90	noSqlPager($items, 'page', $pagesize, 10);
91	echo '</documents>';
92*/
93?>