Ejemplo n.º 1
0
This program 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.
*/
use Xoops\Core\Request;
/**
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author          trabis <*****@*****.**>
 * @version         $Id$
 */
include dirname(dirname(__DIR__)) . '/mainfile.php';
$xoops = Xoops::getInstance();
if (Request::getBool('pdf', false)) {
    $content = \Xoops\Utils::dumpVar($xoops->getConfigs(), false);
    $tpl = new XoopsTpl();
    $tpl->assign('dummy_content', $content);
    $content2 = $tpl->fetch('module:system/system_dummy.tpl');
    if ($xoops->service('htmltopdf')->isAvailable()) {
        $xoops->service('htmltopdf')->addHtml($content2);
        $xoops->service('htmltopdf')->outputPdfInline('codex_example.pdf');
    } else {
        $xoops->header();
        echo 'Please install an HtmlToPdf provider!';
        \Xoops\Utils::dumpFile(__FILE__);
        $xoops->footer();
    }
} else {
    $xoops->header();
    echo '<a href="?pdf=1">Make Pdf</a>';
Ejemplo n.º 2
0
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.

This program 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.
*/
/**
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author          trabis <*****@*****.**>
 * @version         $Id$
 */
include dirname(dirname(__DIR__)) . '/mainfile.php';
$xoops = Xoops::getInstance();
$xoops->header();
/* @var $helper Userconfigs */
if ($xoops->isUser() && ($helper = $xoops->getModuleHelper('userconfigs'))) {
    $config_handler = $helper->getHandlerConfig();
    $configs = $config_handler->getConfigsByUser($xoops->user->getVar('uid'), $xoops->module->getVar('mid'));
    \Xoops\Utils::dumpVar($configs);
    $url = $xoops->url('modules/userconfigs');
    echo '<a href="' . $url . '">Change your settings</a>';
} else {
    echo 'Please login and install userconfigs module';
}
\Xoops\Utils::dumpFile(__FILE__);
$xoops->footer();
Ejemplo n.º 3
0
\Xoops\Utils::dumpVar(Request::get());
$result['id'] = Request::getInt('id', 13);
$result['string'] = Request::getString('string', 'defaultValueHere');
$result['bool'] = Request::getBool('bool', false);
$result['order'] = Request::getString('order', 'ASC');
$result['url'] = $request->getUrl();
$result['uri'] = $request->getUri();
$result['referer'] = $request->getReferer();
$result['phpsessid_cookie'] = Request::getString('PHPSESSID', '', 'cookie');
$result['ip'] = $request->getClientIp();
$result['isget'] = 'GET' === Request::getMethod();
$result['ispost'] = 'POST' === Request::getMethod();
$result['ismobile'] = $request->is('mobile');
$result['isrobot'] = $request->is('robot');
$result['files'] = Request::getArray('file_identifier', array(), 'files');
\Xoops\Utils::dumpVar($result);
echo '<a href="?id=12&string=I love you&bool=everythingsistrue&order=DESC">Good uri</a>';
echo ' - <a href="?id=test&order=DESCENDING">Bad uri</a>';
// Form
$form = new Xoops\Form\SimpleForm('', 'form_id', 'request.php?id=666', true);
$form->setExtra('enctype="multipart/form-data"');
$code = new Xoops\Form\Text('String', 'string', 2, 25, '', 'string...');
$code->setDescription('Description text');
$code->setPattern('^.{3,}$', 'You need at least 3 characters');
$code->setDatalist(array('list 1', 'list 2', 'list 3'));
$form->addElement($code, true);
$select = new Xoops\Form\Select('Select', 'id', '', 1, false);
$select->addOption(1, 'Select 1');
$select->addOption(2, 'Select 2');
$select->addOption('somebad id here', 'Select with bad id');
$select->setDescription('Description Select');
Ejemplo n.º 4
0
 */
if ($xoops->isActiveModule('search')) {
    $config = $xoops->getModuleConfig('keyword_min', 'search');
    $xoops->loadLanguage('main', 'search');
    $url = $xoops->url('modules/search/index.php');
    $obj = $xoops->getModuleByDirname('search');
    //etc
}
/**
 * Using the Helper
 */
if ($helper = Xoops\Module\Helper::getHelper('search')) {
    $config = $helper->getConfig('keyword_min');
    $helper->loadLanguage('main');
    $url = $helper->url('index.php');
    $obj = $helper->getModule();
    //etc
}
//Some examples
if ($helper = Xoops\Module\Helper::getHelper('codex')) {
    \Xoops\Utils::dumpVar($helper->getModule()->getVar('name'));
    \Xoops\Utils::dumpVar($helper->url('index.php'));
}
if ($helper = Xoops\Module\Helper::getHelper('search')) {
    \Xoops\Utils::dumpVar($helper->getConfigs());
}
if ($helper = Xoops\Module\Helper::getHelper('nosuchmodule')) {
    \Xoops\Utils::dumpVar($helper->getModule()->getVar('name'));
}
\Xoops\Utils::dumpFile(__FILE__);
$xoops->footer();