コード例 #1
0
ファイル: Map.php プロジェクト: romaninsh/atkSchool
 function init()
 {
     parent::init();
     $this->set('Problem Loading Google Map');
     $url = 'http://maps.google.com/maps?file=api&v=2&key=' . $this->api->getConfig('map/google/key', 'ABQIAAAA1dw0K5D0tpWLBbZ-SCh2YBS8lnDegradZ_LGHIBXZSRvdsbN5BQJtPnF1vFmNBWgvU-R-TiiESQV2g');
     $this->api->template->append('js_include', '<script type="text/javascript" src="' . $url . '"></script>' . "\n");
 }
コード例 #2
0
ファイル: Alex.php プロジェクト: vikash124/atk4-web
 function init()
 {
     parent::init();
     $this->setElement('img');
     $this->setAttr('src', $this->api->locateURL('template', 'images/PinkElephant.jpg'));
     $this->set('');
 }
コード例 #3
0
ファイル: Map.php プロジェクト: xavoctechnocratspvtltd/svc
 function init()
 {
     parent::init();
     $this->set('Problem Loading Google Map');
     $url = 'http://maps.googleapis.com/maps/api/js?key=' . $this->api->getConfig('map/google/key', '') . '&sensor=true';
     $this->api->template->appendHTML('js_include', '<script type="text/javascript" src="' . $url . '"></script>' . "\n");
     $this->js(true, ' var map = new google.maps.Map(document.getElementById("' . $this->name . '"),{zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP});');
 }
コード例 #4
0
ファイル: UpgradeChecker.php プロジェクト: respond/atk4
 function init()
 {
     parent::init();
     if (!$this->api->template->is_set('js_include')) {
         return;
     }
     // no support in templtae
     $this->set($v = $this->api->getVersion());
     if ($v[0] != 4) {
         return;
     }
     // probably not ATK version
     if (isset($_COOKIE[$this->name . '_' . str_replace('.', '_', $v)])) {
         return;
     }
     $this->api->template->append('js_include', '<script aync="true" onload="try{ atk4_version_check(\'' . $this->name . '\'); } catch(e){ }" type="text/javascript" src="http://agiletoolkit.org/upgrade_check/' . $this->api->getVersion() . '.js"></script>' . "\n");
 }
コード例 #5
0
ファイル: Hangman.php プロジェクト: vikash124/atk4-web
 function init()
 {
     parent::init();
     $this->add('H4')->set('The Hangman Game');
     if (!$_GET[$this->name]) {
         $this->add('P')->set('Select Difficulty');
         $f = $this->add('Form');
         $f->addField('radio', 'difficulty')->setValueList(array(10 => 'Easy', 5 => 'Medium', 3 => 'Hard'));
         $f->addSubmit('Start Game');
         if ($f->isSubmitted()) {
             $this->memorize('word', 'back');
             $this->memorize('tries', $f->get('difficulty'));
             $this->memorize('letters', range('a', 'z'));
             $this->js()->reload(array($this->name => 1))->execute();
         }
         return;
     }
     $letter = $_GET[$this->name];
     $word = $this->recall('word');
     $tries = $this->recall('tries');
     $letters = $this->recall('letters');
     $this->api->stickyGET($this->name);
     if ($letter != 1) {
         unset($letters[array_search($letter, $letters)]);
         if (strpos($word, $letter) === false) {
             $tries--;
         }
         $this->memorize('tries', $tries);
         $this->memorize('letters', $letters);
     }
     $word = str_replace($letters, '-', $word);
     if ($tries < 0) {
         $this->add('P')->set('Game Over');
         return;
     }
     if (strpos($word, '-') === false) {
         $this->add('P')->set('You won!');
         return;
     }
     $this->add('P')->set('Mistakes remaining: ' . $tries);
     foreach ($letters as $i) {
         $l = $this->add('HtmlElement')->setElement('a')->setAttr('href', '#')->set(strtoupper($i))->js('click', $this->js()->reload(array($this->name => $i)));
     }
     $this->add('P')->set('Word: ' . $word);
 }
コード例 #6
0
 function init()
 {
     parent::init();
     $this->set($this->default_text);
     $this->addClass('password-checker');
     $field = $this->owner;
     if (!$field instanceof Form_Field) {
         throw $this->exception('You should use StrengthChecker by inserting it into password field');
     }
     $field->js('change')->univ()->ajaxec(array($this->api->url(), $this->name => $field->js()->val()));
     $field->js(true)->univ()->autoChange(1000);
     if (isset($_GET[$this->name]) || isset($_POST[$this->name])) {
         $p = $_POST[$this->name] ? $_POST[$this->name] : $_GET[$this->name];
         // Check
         if ($p) {
             $out = $this->checkByCrackLib($_GET[$this->name]);
         } else {
             $out = '';
         }
         $this->setResponse($p, $out);
     }
 }
コード例 #7
0
ファイル: H3.php プロジェクト: respond/atk4
 function init()
 {
     parent::init();
     $this->setElement('H3');
 }
コード例 #8
0
ファイル: ButtonSet.php プロジェクト: samratcis/atk4
 function init()
 {
     parent::init();
     $this->addClass('atk-buttonset atk-inline');
 }
コード例 #9
0
ファイル: Plain.php プロジェクト: atk4/atk4
 public function init()
 {
     parent::init();
     $this->setElement('form');
 }
コード例 #10
0
ファイル: HR.php プロジェクト: respond/atk4
 function init()
 {
     parent::init();
     $this->setElement('div')->addClass('hr')->set('');
 }
コード例 #11
0
ファイル: HR.php プロジェクト: atk4/atk4
 public function init()
 {
     parent::init();
     $this->setElement('hr')->set('');
 }
コード例 #12
0
 protected function init()
 {
     parent::init();
     list($y, $m, $d) = explode('-', date('Y-m-d'));
     $this->setYear($y);
     $this->setMonth($m);
     $this->setDay($d);
     if (null == $this->maxDate) {
         $this->maxDate = intval(date('Y')) + 50 . date('-m-d');
     }
     if (null == $this->minDate) {
         $this->minDate = intval(date('Y')) - 50 . date('-m-d');
     }
 }
コード例 #13
0
ファイル: box.php プロジェクト: vikash124/atk4-web
 function init()
 {
     parent::init();
     $this->add('Icon')->set($this->icon)->setColor('nobg');
 }