1<?php 2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project 3// 4// All Rights Reserved. See copyright.txt for details and a complete list of authors. 5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. 6// $Id$ 7 8//this script may only be included - so its better to die if called directly. 9if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) { 10 header("location: index.php"); 11 exit; 12} 13 14// Param: 'id' or 'label' 15function smarty_function_content($params, $smarty) 16{ 17 $dcslib = TikiLib::lib('dcs'); 18 19 if (isset($params['id'])) { 20 $data = $dcslib->get_actual_content($params['id']); 21 } elseif (isset($params['label'])) { 22 $data = $dcslib->get_actual_content_by_label($params['label']); 23 } else { 24 trigger_error("assign: missing 'id' or 'label' parameter"); 25 return false; 26 } 27 28 return $data; 29} 30