Esempio n. 1
0
 /**
  * Widget's initialization method
  */
 public function init()
 {
     parent::init();
     if (empty($this->data)) {
         throw new CException(Yii::t('zii', '"data" attribute cannot be blank'));
     }
 }
Esempio n. 2
0
 public function init()
 {
     parent::init();
     $session = \Yii::$app->session;
     $flashes = $session->getAllFlashes();
     $appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : '';
     foreach ($flashes as $type => $data) {
         if (isset($this->alertTypes[$type])) {
             $data = (array) $data;
             foreach ($data as $i => $message) {
                 /* initialize css class for each alert box */
                 $this->options['class'] = $this->alertTypes[$type] . $appendCss;
                 /* assign unique id to each alert box */
                 $this->options['id'] = $this->getId() . '-' . $type . '-' . $i;
                 $this->renderHtml($message, $this->options['class']);
                 //                    echo \yii\bootstrap\Alert::widget([
                 //                        'body' => $message,
                 //                        'closeButton' => $this->closeButton,
                 //                        'options' => $this->options,
                 //                    ]);
             }
             $session->removeFlash($type);
         }
     }
 }
Esempio n. 3
0
 public function render(Register $parameters, XMLDocument &$document)
 {
     Widget::init($this->document);
     $this->appendHead($this->document->documentElement);
     $this->appendBody($this->document->documentElement);
     return $this->document->saveHTML();
 }
Esempio n. 4
0
 public function init()
 {
     parent::init();
     if (!$this->model instanceof ActiveRecord) {
         throw new CException("Параметр model Должен быть объектом класса ActiveRecord");
     }
 }
Esempio n. 5
0
 public function init()
 {
     parent::init();
     if ($this->model === null) {
         throw new CException("Параметр model является обязательным");
     }
 }
Esempio n. 6
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     if ($this->defaultClass) {
         Html::addCssClass($this->options, $this->defaultClass);
     }
 }
Esempio n. 7
0
 /**
  * Container Initializer
  *
  * @access private
  */
 function init()
 {
     $this->_items = array();
     $this->_packable = true;
     $this->_useTitles = false;
     $this->_familyWidget = 'container';
     parent::init();
 }
Esempio n. 8
0
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, ['weui_grid']);
     if (!isset($this->options['href'])) {
         $this->options['href'] = "javascript:;";
     }
 }
Esempio n. 9
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->initOptions();
     echo $this->renderToggleButton() . "\n";
     echo Html::beginTag('div', $this->options) . "\n";
     echo Html::beginTag('div', ['class' => 'modal-content']) . "\n";
 }
Esempio n. 10
0
 public function __construct()
 {
     parent::__construct();
     self::$Headers = new DocumentHeaders();
     self::$Document = new XMLDocument();
     self::$Document->appendChild(self::$Document->createElement('data'));
     Widget::init(self::$Document);
 }
Esempio n. 11
0
 public function init()
 {
     parent::init();
     if (!isset($this->appendToParent)) {
         $this->appendToParent = isset(self::$appendToParents[$this->plugin]) ? self::$appendToParents[$this->plugin] : 'appendDivToParent';
     }
     $this->{$this->appendToParent}();
 }
Esempio n. 12
0
 /**
  * @inheritdoc
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     $this->view = 'disqus-comments';
     $this->params['credits'] = $this->credits;
     $this->params['noScript'] = $this->noScript;
     parent::init();
     if (!empty($this->language)) {
         $this->params['variables'] .= "\n\tvar disqus_config = function(){\n\t\tthis.language = '{$this->language}';\n\t};";
     }
 }
Esempio n. 13
0
 public function init()
 {
     parent::init();
     if (null === $this->maskId) {
         $this->maskId = $this->getId() . '_mask';
     }
     if (null === $this->actionsheetId) {
         $this->actionsheetId = $this->getId() . '_actionsheet';
     }
 }
Esempio n. 14
0
 /**
  * Initializes objects and properties common to all SymphonyView
  * objects
  */
 public function initialize()
 {
     // Initialize headers
     $this->headers = new DocumentHeaders();
     $this->setHeaders();
     // Initialize context
     $this->context = new Register();
     // Initialize XML
     $this->document = new XMLDocument();
     $this->document->appendChild($this->document->createElement('data'));
     //Initialize XSLT
     $this->stylesheet = new XMLDocument();
     Widget::init($this->document);
 }
Esempio n. 15
0
 public function init()
 {
     parent::init();
     $this->registerScripts();
 }
 function view()
 {
     Widget::init($this);
     /*
     			$emergency = false;
     			if(isset($this->_context[0]) && in_array(strlen($this->_context[0]), array(6, 8))){
     				$emergency = $this->__loginFromToken($this->_context[0]);
     			}
     
     			if(!$emergency && Administration::instance()->isLoggedIn()) redirect(ADMIN_URL . '/');
     */
     $fieldset = $this->createElement('fieldset');
     /*
     			if($this->_context[0] == 'retrieve-password'):
     
     				if(isset($this->_email_sent) && $this->_email_sent){
     					$fieldset->appendChild($this->createElement('p', __('An email containing a customised login link has been sent. It will expire in 2 hours.')));
     					$this->Form->appendChild($fieldset);
     				}
     
     				else{
     
     					$fieldset->appendChild($this->createElement('p', __('Enter your email address to be sent a remote login link with further instructions for logging in.')));
     
     					$label = Widget::Label(__('Email Address'));
     					$label->appendChild(Widget::Input('email', $_POST['email']));
     
     					$this->Body->setAttribute('onload', 'document.forms[0].elements.email.focus()');
     
     					if(isset($this->_email_sent) && !$this->_email_sent){
     						$div = $this->createElement('div', $label, array('class' => 'invalid'));
     						$div->appendChild($this->createElement('p', __('There was a problem locating your account. Please check that you are using the correct email address.')));
     						$fieldset->appendChild($div);
     					}
     
     					else $fieldset->appendChild($label);
     
     					$this->Form->appendChild($fieldset);
     
     					$div = $this->createElement('div', NULL, array('class' => 'actions'));
     					$div->appendChild(Widget::Input('action[reset]', __('Send Email'), 'submit'));
     					$this->Form->appendChild($div);
     
     				}
     
     			elseif($emergency):
     
     				$fieldset->appendChild($this->createElement('legend', __('New Password')));
     
     				$label = Widget::Label(__('New Password'));
     				$label->appendChild(Widget::Input('password', NULL, 'password'));
     				$fieldset->appendChild($label);
     
     				$label = Widget::Label(__('Confirm New Password'));
     				$label->appendChild(Widget::Input('password-confirmation', NULL, 'password'));
     				$fieldset->appendChild($label);
     				$this->Form->appendChild($fieldset);
     				
     				if($this->_mismatchedPassword){
     					$div = $this->createElement('div', NULL, array('class' => 'invalid'));
     					$div->appendChild($this->createElement('p', __('The supplied password was rejected. Make sure it is not empty and that password matches password confirmation.')));
     					$this->Form->appendChild($div);
     				}
     
     				$div = $this->createElement('div', NULL, array('class' => 'actions'));
     				$div->appendChild(Widget::Input('action[change]', __('Save Changes'), 'submit'));
     				if(!preg_match('@\/symphony\/login\/@i', $_SERVER['REQUEST_URI'])) $div->appendChild(Widget::Input('redirect', $_SERVER['REQUEST_URI'], 'hidden'));
     				$this->Form->appendChild($div);
     
     			else:*/
     $label = Widget::Label(__('Username'));
     $label->appendChild(Widget::Input('username'));
     $fieldset->appendChild($label);
     $this->Body->setAttribute('onload', 'document.forms[0].elements.username.focus()');
     $label = Widget::Label(__('Password'));
     $label->appendChild(Widget::Input('password', NULL, 'password'));
     $fieldset->appendChild($label);
     $this->Form->appendChild($fieldset);
     $p = $this->createElement('p', NULL);
     $p->appendChild(Widget::Anchor(__('Forgot your password?'), ADMIN_URL . '/login/retrieve-password/'));
     $fieldset->appendChild($p);
     if ($this->invalid_credentials) {
         $div = $this->createElement('div', NULL, array('class' => 'invalid'));
         if ($this->missing_username == true) {
             $p = $this->createElement('p', __('Username is required and cannot be left blank. '));
         } elseif ($this->missing_password == true) {
             $p = $this->createElement('p', __('Password is required and cannot be left blank. '));
         } else {
             $p = $this->createElement('p', __('The username and password combination you provided is incorrect. '));
         }
         $p->appendChild(Widget::Anchor(__('Retrieve password?'), ADMIN_URL . '/login/retrieve-password/'));
         $div->appendChild($p);
         $this->Form->appendChild($div);
     }
     $div = $this->createElement('div', NULL, array('class' => 'actions'));
     $div->appendChild(Widget::Input('action[login]', __('Login'), 'submit'));
     if (!preg_match('@\\/symphony\\/login\\/@i', $_SERVER['REQUEST_URI'])) {
         $div->appendChild(Widget::Input('redirect', $_SERVER['REQUEST_URI'], 'hidden'));
     }
     $this->Form->appendChild($div);
     //endif;
 }
Esempio n. 17
0
 public function init()
 {
     parent::init();
     $this->label = $this->model->getAttributeLabel($this->attr);
     $this->options = ['placeholder' => "คลิกเลือก {$this->label}"];
 }
Esempio n. 18
0
                $db->insert('tbl_users', array('username' => $settings['user']['username'], 'password' => md5($settings['user']['password']), 'first_name' => $settings['user']['first-name'], 'last_name' => $settings['user']['last-name'], 'email' => $settings['user']['email-address'], 'default_section' => 'articles', 'auth_token_active' => 'no', 'language' => 'en'));
            } catch (Exception $e) {
                $errors->append('database', $e->getMessage());
            }
        }
        if ($errors->length() == 0) {
            redirect(URL . '/symphony');
        }
    }
}
$Document = new HTMLDocument('1.0', 'utf-8', 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"');
$Document->Headers->append('Expires', 'Mon, 12 Dec 1982 06:14:00 GMT');
$Document->Headers->append('Last-Modified', gmdate('r'));
$Document->Headers->append('Cache-Control', 'no-cache, must-revalidate, max-age=0');
$Document->Headers->append('Pragma', 'no-cache');
Widget::init($Document);
$Document->insertNodeIntoHead($Document->createElement('title', 'Symphony Installation'));
$meta = $Document->createElement('meta');
$meta->setAttribute('http-equiv', 'Content-Type');
$meta->setAttribute('content', 'text/html; charset=UTF-8');
$Document->insertNodeIntoHead($meta);
$Document->insertNodeIntoHead($Document->createStylesheetElement('assets/styles.css'));
$form = $Document->createElement('form');
$form->setAttribute('method', 'POST');
$form->setAttribute('action', '');
$Document->appendChild($form);
$layout = $Document->createElement('div');
$layout->setAttribute('id', 'layout');
$form->appendChild($layout);
// About panel ---------------------------------------------------------------------------------------------------
$div = $Document->createElement('div');
Esempio n. 19
0
 /**
  * @inheritdoc
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     $this->view = 'hc-comments';
     parent::init();
 }
Esempio n. 20
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     Html::addCssClass($this->options, ['widget' => 'btn']);
 }
Esempio n. 21
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     $this->addCssClass($this->options, 'btn-group');
 }
Esempio n. 22
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     $this->addCssClass($this->options, 'btn');
 }
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, [self::CLASS_CELL]);
 }
Esempio n. 24
0
 public function init()
 {
     $this->assetsPath = dirname(__FILE__) . '/assets';
     parent::init();
 }
Esempio n. 25
0
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, 'card');
 }
Esempio n. 26
0
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, ['weui_grids']);
 }
Esempio n. 27
0
 public function display($page)
 {
     // Default headers. Can be overwritten later
     //self::$Headers->append('HTTP/1.0 200 OK');
     self::$Headers->append('Content-Type', 'text/html;charset=utf-8');
     self::$Headers->append('Expires', 'Mon, 12 Dec 1982 06:14:00 GMT');
     self::$Headers->append('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT');
     self::$Headers->append('Cache-Control', 'no-cache, must-revalidate, max-age=0');
     self::$Headers->append('Pragma', 'no-cache');
     $this->isLoggedIn();
     if (empty($page)) {
         if (!$this->isLoggedIn()) {
             $page = '/login';
         } else {
             $section_handle = $this->User->default_section;
             // Make sure section exists:
             try {
                 $section = Section::loadFromHandle($section_handle);
                 redirect(ADMIN_URL . "/publish/{$section_handle}/");
             } catch (Exception $e) {
                 redirect(ADMIN_URL . '/blueprints/sections/');
             }
         }
     }
     if (!($this->_callback = $this->getPageCallback($page))) {
         throw new AdministrationPageNotFoundException($page);
     }
     include_once (isset($this->_callback['driverlocation']) ? $this->_callback['driverlocation'] : CONTENT) . '/content.' . $this->_callback['driver'] . '.php';
     $this->Page = new $this->_callback['classname']();
     // Widget class needs a document in order to create elements
     Widget::init($this->Page);
     ####
     # Delegate: AdminPagePreBuild
     # Description: Immediately before building the admin page. Provided with the page and callback
     # Global: Yes
     Extension::notify('AdminPagePreBuild', '/administration/', array('page' => &$this->Page, 'callback' => &$this->_callback));
     if (!$this->isLoggedIn() && $this->_callback['driver'] != 'login') {
         if (is_callable(array($this->Page, 'handleFailedAuthorisation'))) {
             $this->Page->handleFailedAuthorisation();
         } else {
             include_once CONTENT . '/content.login.php';
             $this->Page = new contentLogin();
             $this->Page->build();
         }
     } else {
         $this->Page->build($this->_callback['context']);
     }
     ####
     # Delegate: AdminPagePreGenerate
     # Description: Immediately before generating the admin page. Provided with the page object
     # Global: Yes
     Extension::notify('AdminPagePreGenerate', '/administration/', array('page' => &$this->Page));
     $output = (string) $this->Page;
     ####
     # Delegate: AdminPagePostGenerate
     # Description: Immediately after generating the admin page. Provided with string containing page source
     # Global: Yes
     Extension::notify('AdminPagePostGenerate', '/administration/', array('output' => &$output));
     self::Headers()->render();
     return $output;
 }
Esempio n. 28
0
 public function init_v2()
 {
     parent::init();
 }
Esempio n. 29
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->view = 'disqus-comments-count';
     parent::init();
 }
Esempio n. 30
0
 public function init()
 {
     parent::init();
     $assets = Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.components.formElements.Chosen.assets'));
     Yii::app()->clientScript->registerScriptFile($assets . '/chosen.jquery.js')->registerCssFile($assets . '/chosen.css');
 }