Exemplo n.º 1
0
 public function __toString()
 {
     $user = site()->user();
     if ($user->hasRole('admin')) {
         return parent::__toString();
     }
     return "";
 }
Exemplo n.º 2
0
 public function __toString()
 {
     $languages = c::get('languages');
     $lang = $currentLang = strtoupper(site()->language()->code());
     foreach ($languages as $l) {
         if (isset($l['default']) && $l['default']) {
             $lang = strtoupper($l['code']);
         }
     }
     if ($currentLang == $lang) {
         return parent::__toString();
     }
     return "";
 }
Exemplo n.º 3
0
 private function _createUrlForm()
 {
     $form = new Form('url');
     $form->add(UrlField::name("url"));
     $form->setSubmitText("Go!");
     $form->action = "/upload";
     return $form;
 }
Exemplo n.º 4
0
 public function testUrlFieldValidationError()
 {
     $this->setExpectedException('Stato\\Webflow\\Forms\\ValidationError', 'Enter a valid URL.');
     $f = new UrlField();
     $f->clean('http:/stato-framework.org');
 }