示例#1
0
 /**
  * Constructor
  *
  * @param	string	$caption
  * @param	string	$name
  * @param	mixed	$value	Pre-selected value (or array of them).
  * @param	int		$size	Number or rows. "1" makes a drop-down-list
  */
 function __construct($caption, $name, $value = null, $size = 1)
 {
     parent::__construct($caption, $name, $value, $size);
     $this->addOptionArray(Xmf_Lists::getThemesList());
 }
示例#2
0
<?php

//  Author: Trabis
//  URL: http://www.xuups.com
//  E-Mail: lusopoemas@gmail.com
include dirname(dirname(dirname(__FILE__))) . '/mainfile.php';
include dirname(__FILE__) . '/include/common.php';
$xoopsOption['template_main'] = 'xteste_post.html';
include XOOPS_ROOT_PATH . '/header.php';
$files = Xmf_Lists::getFileListAsArray(dirname(__FILE__));
foreach ($files as $file) {
    echo "<a href={$file}>{$file}</a><br/>";
}
//$xoopsTpl->assign( "page", XOOPS_ROOT_PATH . '/modules/xteste/templates/' . $_GET['get'].'.html' );
$id = Xmf_Request::getInt('id', 1);
$helper = Xmf_Module_Helper::getInstance('xteste');
$helper->setDebug(true);
//Echos module name, getModule() gets module object
//echo $helper->getModule()->getVar('name') . '<br>';
//print_r($helper->getHandler('Post')->create());
$count = $helper->getHandler('Post')->getCount();
if ($count < 5) {
    $num = $count + 1;
    $obj = $helper->getHandler('Post')->create();
    $obj->setVar('title', "Post number {$num}");
    $obj->setVar('body', "This is interesting post {$num}");
    $obj->setVar('uid', 1);
    $obj->setVar('published', 1);
    $obj->setVar('created', time());
    $obj->setVar('category_id', 2);
    $helper->getHandler('Post')->insert($obj);