public function createPresenters()
 {
     parent::createPresenters();
     $image = new SimpleImageUpload('Image');
     self::$model = $this->raiseEvent('GetRestModel');
     $image->attachEventHandler('FileUploaded', function ($file, $location) {
         $path = "static/images/usrimgs/";
         if (!dir($path)) {
             mkdir($path, 0777, true);
         }
         if (GalleryAddPresenter::isFileImage($location)) {
             $id = self::$model->UniqueIdentifier;
             if (!$id) {
                 $id = CustomUser::findLast()->UniqueIdentifier++;
             }
             rename($location, $path . $id);
         }
     });
     $this->addPresenters($image, 'Username', 'Forename', 'Surname', 'Email', 'Gender', 'PhoneNumber', 'ShowDetails', new Password('PasswordPlace'));
     foreach ($this->presenters as $presenter) {
         if ($presenter instanceof TextBox || $presenter instanceof DropDown) {
             $presenter->addCssClassName('form-control');
             $presenter->addHtmlAttribute('autocomplete', 'off');
         }
     }
     $this->presenters['Save']->addCssClassName('btn-primary');
     $this->presenters['Save']->setButtonText('Saglabāt');
     $this->presenters['Cancel']->setButtonText('Atcelt');
 }
 public function createPresenters()
 {
     parent::createPresenters();
     $model = $this->raiseEvent('GetRestModel');
     $slideView = new ImageCommentsPanorama(Image::find(new Equals('GalleryID', $model->GalleryID))->addSort('Order'), 'SlideView');
     $this->addPresenters($slideView);
 }
 public function createPresenters()
 {
     parent::createPresenters();
     $this->addPresenters("Title");
     $this->presenters['Save']->addCssClassNames(['btn', 'btn-primary']);
     $this->presenters['Save']->setButtonText('Saglābat');
     $this->presenters['Cancel']->setButtonText('Atcelt');
 }
示例#4
0
    protected function printViewContent()
    {
        parent::printViewContent();
        ?>
        <div class="c-section js-slideUp">
            <a href="/"><img src="/static/images/logo.png" class="c-image" alt="poak logo" title="Home"/></a>
            <div class="c-section__header">
                <ul class="c-list c-list--inline c-list--nav">
                    <li><a href="/a" class="js-fade-out-index">about poak</a></li>
                    <li><a href="/t" class="js-fade-out-index">terms of service</a></li>
                    <li><a href="mailto:hello@poak.io">get in touch</a></li>
                </ul>
            </div>
            <div class="wrap">
                <div class="u-v">
                    <h1 class="c-title c-title--main animated fadeInUp js-title--main">Giving small business a fighting
                        chance online.</h1>

                    <div class="c-section__text animated fadeInUp js-text--main">
                        <p>We feel that every business deserves to leave their mark on the internet. That’s why we’re
                            giving away <span class="u-white u-b">1 FREE</span> bespoke single page website every <span
                                class="u-white u-b">1 Calendar month</span>.</p>

                        <p>Register below for your chance to win.</p>
                    </div>
                    <a href="#" class="c-button c-button--primary animated fadeInUp js-button--register">Register</a>
                </div>
            </div>
            <div class="c-section__form js-input-overlay">
                <a href="#" id="close-form"><img src="/static/images/close.png" alt="close" width="35"/></a>
                <?php 
        print "<label>Name</label>";
        print $this->presenters['Name'];
        print "<label>Email</label>";
        print $this->presenters['Email'];
        print "<label>Website</label>";
        print $this->presenters['Website'];
        print "<label>Company Name</label>";
        print $this->presenters['CompanyName'];
        print $this->presenters['Send'];
        ?>
            </div>
        </div>
        <?php 
    }
 public function createPresenters()
 {
     parent::createPresenters();
     $this->addPresenters($table = new Table(CustomUser::find(new Equals('Enabled', true)), 25, 'UserTable'), $delete = new Button('Dzēst', 'Dzēst', function ($a) {
         try {
             $user = new CustomUser($a);
             $user->Enabled = false;
             $user->save();
         } catch (RecordNotFoundException $ex) {
         }
     }), $edit = new Button('Mainīt', 'Mainīt', function ($a) {
         throw new ForceResponseException(new RedirectResponse('/users/' . $a . '/edit/'));
     }));
     $delete->addCssClassName('btn-danger');
     $delete->setConfirmMessage('Vai jūs tiešam gribat dzēst šo lietotāju?');
     $table->addTableCssClass(['table table-striped table-bordered']);
     $this->presenters['UserTable']->Columns = ['Lietotaja vārds' => 'Username', 'Vārds' => 'Forename', 'Uzvārds' => 'Surname', 'E - pasts' => 'Email', '' => new FixedWidthColumn($edit), ' ' => new FixedWidthColumn($delete)];
 }