Merge branch 'dev' into 28-update-bootstrap
This commit is contained in:
commit
04dcc61a85
3 changed files with 6 additions and 66 deletions
|
|
@ -105,10 +105,10 @@ class UserController extends ControllerBase
|
||||||
|
|
||||||
$paginator = ActivityLog::getPaginationList($user->getId(), $page);
|
$paginator = ActivityLog::getPaginationList($user->getId(), $page);
|
||||||
|
|
||||||
$this->view->page = $paginator->pageinate();
|
$this->view->page = $paginator->paginate();
|
||||||
$this->view->pagination_url = '/user/activity/';
|
$this->view->pagination_url = '/user/activity/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function oauthDisconnectAction($provider, $last_unlink_confirmed = false)
|
public function oauthDisconnectAction($provider, $last_unlink_confirmed = false)
|
||||||
{
|
{
|
||||||
$user = $this->_getAuth()->getUser();
|
$user = $this->_getAuth()->getUser();
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,9 @@ namespace App\Form;
|
||||||
use App\Model\Data\User as UserModel;
|
use App\Model\Data\User as UserModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Phalcon Form
|
* Form
|
||||||
*/
|
*/
|
||||||
use Phalcon\Forms\Form as FormBase,
|
use Httpcb\Form as FormBase;
|
||||||
Phalcon\Forms\Element\AbstractElement;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Element types
|
* Element types
|
||||||
|
|
@ -173,63 +172,4 @@ class UserSettings extends FormBase
|
||||||
'with' => 'passwordNew',
|
'with' => 'passwordNew',
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderDecorated($name, $opt = [])
|
|
||||||
{
|
|
||||||
$options = [
|
|
||||||
'label-class' => 'control-label',
|
|
||||||
'class' => 'col-sm-10',
|
|
||||||
'message' => ''
|
|
||||||
];
|
|
||||||
|
|
||||||
$ele = $this->get($name);
|
|
||||||
|
|
||||||
if (isset($opt['label-length'])) {
|
|
||||||
$length = (int) $opt['label-length'];
|
|
||||||
} else {
|
|
||||||
$length = 2;
|
|
||||||
}
|
|
||||||
$options['label-class'] .= ' col-sm-' . $length;
|
|
||||||
|
|
||||||
if (isset($opt['length'])) {
|
|
||||||
|
|
||||||
$len = $opt['length'];
|
|
||||||
|
|
||||||
if ($len === 'full') {
|
|
||||||
$options['class'] = '';
|
|
||||||
} else {
|
|
||||||
$options['class'] = 'col-sm-' . $opt['length'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($ele->hasMessages()) {
|
|
||||||
$options['class'] .= ' has-error';
|
|
||||||
$options['message'] = $ele->getMessages()->current();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->_render($ele, $options);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function _render(AbstractElement $ele, $opt)
|
|
||||||
{
|
|
||||||
$xhtml = '';
|
|
||||||
|
|
||||||
if (strlen($ele->getLabel()) > 0) {
|
|
||||||
|
|
||||||
$xhtml .= sprintf(
|
|
||||||
'<label class="%s" for="%s">%s</label>',
|
|
||||||
$opt['label-class'], $ele->getName(), $ele->getLabel());
|
|
||||||
}
|
|
||||||
|
|
||||||
$xhtml .= '<div class="' . $opt['class'] . '">'
|
|
||||||
. $ele->render();
|
|
||||||
|
|
||||||
if (strlen($opt['message']) > 0) {
|
|
||||||
$xhtml .= '<span class="help-block">' . $opt['message'] . '</span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$xhtml .= '</div>';
|
|
||||||
|
|
||||||
return $xhtml;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
namespace Httpcb;
|
namespace Httpcb;
|
||||||
|
|
||||||
use Phalcon\Forms\Form as FormBase,
|
use Phalcon\Forms\Form as FormBase,
|
||||||
Phalcon\Forms\Element as FormElement;
|
Phalcon\Forms\Element\AbstractElement;
|
||||||
|
|
||||||
class Form extends FormBase
|
class Form extends FormBase
|
||||||
{
|
{
|
||||||
|
|
@ -45,7 +45,7 @@ class Form extends FormBase
|
||||||
return $this->_render($ele, $options);
|
return $this->_render($ele, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function _render(FormElement $ele, $opt)
|
protected function _render(AbstractElement $ele, $opt)
|
||||||
{
|
{
|
||||||
$xhtml = '';
|
$xhtml = '';
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue