예제 #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.
 *
 * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
 * @license             GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package             profile
 * @since               2.3.0
 * @author              Jan Pedersen
 * @author              Taiwen Jiang <*****@*****.**>
 */
include_once __DIR__ . '/admin_header.php';
xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation(basename(__FILE__));
$op = \Xmf\Request::getCmd('op', 'edit');
$perm_desc = '';
switch ($op) {
    case 'visibility':
        //redirect_header("visibility.php", 0, _PROFILE_AM_PROF_VISIBLE);
        header('Location: visibility.php');
        break;
    case 'edit':
        $title_of_form = _PROFILE_AM_PROF_EDITABLE;
        $perm_name = 'profile_edit';
        $restriction = 'field_edit';
        $anonymous = false;
        break;
    case 'search':
        $title_of_form = _PROFILE_AM_PROF_SEARCH;
        $perm_name = 'profile_search';
예제 #2
0
//$pkg->setDatalist(array('list 1','list 2','list 3'));
$testtray->addElement($pkg);
$ver = new Xoops\Form\Text('Version', 'version', 16, 50, '', 'version');
//$ver->setDescription('Description code');
//$ver->setPattern('^.{3,}$', 'You need at least 3 characters');
//$ver->setDatalist(array('list 1','list 2','list 3'));
$testtray->addElement($ver);
$form->addElement($testtray);
$button = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
$form->addElement($button);
$form->display();
if ($method == 'POST') {
    $secResult = $security->check();
    if ($secResult) {
        $composer = new ComposerUtility();
        $composer_command = Request::getCmd('composer_command', '', 'POST');
        $cmd = empty($commands[$composer_command]) ? array('cmd' => '', 'args' => null, 'name' => 'Dummy') : $commands[$composer_command];
        $package = empty($_POST['package']) ? '' : $_POST['package'];
        $version = empty($_POST['version']) ? '' : $_POST['version'];
        $skipProcess = false;
        switch ($cmd['args']) {
            case 'pkg':
                $args = trim($package);
                if (empty($package)) {
                    echo $xoops->alert('warning', 'Package is required for this command', 'Warning');
                    $skipProcess = true;
                }
                break;
            case 'pkgver':
                $args = trim($package . ' ' . $version);
                if (empty($package) || empty($version)) {