Exemplo n.º 1
0
 /**
  * @covers Xoops\Core\Request::getVar
  */
 public function testGetVar()
 {
     $varname = 'RequestTest';
     $value = 'testing';
     $_REQUEST[$varname] = $value;
     $this->assertEquals($value, Request::getVar($varname));
     $this->assertNull(Request::getVar($varname . 'no-such-key'));
 }
Exemplo n.º 2
0
 * @license      GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package      debugbar
 * @since
 * @author       XOOPS Development Team
 */
use Xoops\Core\Request;
use Xmf\Module\Helper;
use Xmf\Module\Permission;
include_once __DIR__ . '/admin_header.php';
$moduleAdmin = new \Xoops\Module\Admin();
$moduleAdmin->displayNavigation('permissions.php');
$helper = Helper::getHelper('monolog');
$permHelper = new Permission();
if ($permHelper) {
    // this is the name and item we are going to work with
    $gperm_name = 'use_monolog';
    $gperm_itemid = 0;
    // if this is a post operation get our variables
    if ('POST' === Request::getMethod()) {
        $name = $permHelper->defaultFieldName($gperm_name, $gperm_itemid);
        $groups = Request::getVar($name, array(), 'POST');
        $permHelper->savePermissionForItem($gperm_name, $gperm_itemid, $groups);
        echo $xoops->alert('success', _MA_MONOLOG_FORM_PROCESSED, _MA_MONOLOG_PERMISSION_FORM);
    }
    $form = new \Xoops\Form\ThemeForm(_MA_MONOLOG_PERMISSION_FORM, 'form', '', 'POST');
    $permElement = $permHelper->getGroupSelectFormForItem($gperm_name, $gperm_itemid, _MA_MONOLOG_PERMISSION_GROUPS, null, true);
    $form->addElement($permElement);
    $form->addElement(new \Xoops\Form\Button('', 'submit', _MA_MONOLOG_FORM_SUBMIT, 'submit'));
    echo $form->render();
}
include_once __DIR__ . '/admin_footer.php';
Exemplo n.º 3
0
if ($sessionHelper) {
    $var = $sessionHelper->get('test_dir');
    if ($var) {
        $test_dir = $var;
    }
}
// if this is a post operation get our test_dir, save it and redirect to app
if ('GET' == Request::getMethod()) {
    $var = Request::getVar('test_dir', '', $hash = 'GET');
    if (!empty($var)) {
        launchApp($var);
    }
}
// if this is a post operation get our test_dir, save it and redirect to app
if ('POST' == Request::getMethod()) {
    $test_dir = Request::getVar('test_dir', '', $hash = 'POST');
    if (empty($test_dir)) {
        $test_dir = $config_test_dir;
    }
    if ($sessionHelper) {
        $sessionHelper->set('test_dir', $test_dir);
    }
    launchApp($test_dir);
}
$form = new \Xoops\Form\ThemeForm('', 'form', '', 'POST');
$form->addElement(new \Xoops\Form\Text('Unit Test Directory', 'test_dir', 5, 512, $test_dir));
$form->addElement(new \Xoops\Form\Button('', 'submit', 'Launch', 'submit'));
echo $form->render();
echo '<br \\><a href="?test_dir=' . $xoops->path('modules/' . $dir . '/app/tests') . '">Examples</a>';
$xoops->footer();
/**