Exemplo n.º 1
0
 /**
  * Enter description here...
  *
  * @param Openid_Context $record
  * @param string $op
  */
 function _showForm(&$record, $op)
 {
     $auth = $record->get('auth');
     require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $title = constant('_AD_OPENID_LANG_FILTER_' . $auth);
     $form = new XoopsThemeForm($title, 'openid_filter', $this->_url, 'post', true);
     $form->addElement(new XoopsFormHidden('controller', 'filter'));
     $form->addElement(new XoopsFormHidden('op', $op));
     $form->addElement(new XoopsFormHidden('auth', $auth));
     if ($op == 'save') {
         $form->addElement(new XoopsFormHidden('id', $record->get4Show('id')));
         $form->addElement(new XoopsFormLabel(_AD_OPENID_LANG_PATTERN, $record->get4Show('pattern')));
     } else {
         $form->addElement(new XoopsFormText(_AD_OPENID_LANG_PATTERN, 'pattern', 100, 255, $record->get4Show('pattern')));
     }
     if ($auth) {
         $member_handler =& xoops_gethandler('member');
         $groups = $member_handler->getGroupList();
         $groups = array(_AD_OPENID_LANG_FILTER_DEFAULT) + $groups;
         if ($groupid = $record->get4show('groupid')) {
             $value = explode('|', $groupid);
         } else {
             $value = array(0);
         }
         $element = new XoopsFormSelect(_AD_OPENID_LANG_GROUP, 'groupid', $value, count($groups), true);
         $element->addOptionArray($groups);
         $form->addElement($element);
     }
     $form->addElement(new XoopsFormButton('', 'submit', 'OK', 'submit'));
     echo $form->render();
 }