Ejemplo n.º 1
0
 public function renderElementWrapperWithTitle($input, $element)
 {
     if (!$this->options->table) {
         return parent::renderElementWrapperWithTitle($input, $element);
     }
     $name = $element['_name'];
     $description = empty($element['description']) ? '' : '<span class="icon help" title="' . Output::html($element['description']) . '">HELP</span>';
     $html = '<th class="' . $this->elementWrapperClasses($element) . '">' . $description . $element['title'] . '</th>';
     $html .= '<td class="input ' . $this->elementWrapperClasses($element) . '">' . $input . '</td>';
     return $this->renderElementWrapper($html, $element);
 }
Ejemplo n.º 2
0
 public function code()
 {
     if (!isset($_POST['code'])) {
         $_POST['code'] = 'print_r($_GET);';
     }
     $code = $_POST['code'];
     $db = $GLOBALS['db'];
     echo '<pre>';
     try {
         eval($code);
     } catch (\Exception $ex) {
         echo "\n=================== exception ====================\n\n";
         print_r($ex);
     }
     echo '</pre><br><br><hr>';
     echo '<form method="post"><textarea rows=20 cols=120 name=code>' . Output::html($code) . '</textarea><br><input type=submit></form>';
 }
Ejemplo n.º 3
0
 public function code($password)
 {
     if (sha1(ROW_APP_SECRET . ':' . $password) != 'b9885c8c4972c625fbcad44adb954acc87e2771b') {
         return $this->dispatcher->throwNotFound();
     }
     if (!isset($_POST['code'])) {
         $_POST['code'] = 'print_r($_GET);';
     }
     $code = $_POST['code'];
     $db = $GLOBALS['db'];
     echo '<pre>';
     try {
         eval($code);
     } catch (\Exception $ex) {
         echo "\n=================== exception ====================\n\n";
         print_r($ex);
     }
     echo '</pre><br><br><hr>';
     echo '<form method="post" action><textarea rows=20 cols=120 name=code>' . Output::html($code) . '</textarea><br><input type=submit></form>';
 }
Ejemplo n.º 4
0
 protected function elements($defaults)
 {
     return array('username' => array('type' => 'text', 'required' => true, 'minlength' => 2, 'validation' => 'unique', 'unique' => array('model' => 'app\\models\\User', 'field' => 'username', 'conditions' => array('user_id <> ?', array($defaults->user_id))), 'description' => Output::translate('Have you read our %1?', array(Output::ajaxLink(Output::translate('username guidelines', null, array('ucfirst' => false)), 'blog/page/username')))), 'password' => array('type' => 'text', 'minlength' => 2, 'description' => Output::html(Output::translate('Current password: %1', array($defaults->password)))), 'full_name' => array('type' => 'text', 'required' => true, 'minlength' => 3), 'bio' => array('type' => 'textarea'), 'access' => array('type' => 'text', 'validation' => 'csv'), 'domains' => array('type' => 'text', 'validation' => 'csv', 'storage' => 'in_domains', 'description' => Output::translate('Comma (+ space) separated. Will be checked individually and created if no existo.')));
 }