当前位置: 首页>>代码示例>>PHP>>正文


PHP Requirements::css方法代码示例

本文整理汇总了PHP中Requirements::css方法的典型用法代码示例。如果您正苦于以下问题:PHP Requirements::css方法的具体用法?PHP Requirements::css怎么用?PHP Requirements::css使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Requirements的用法示例。


在下文中一共展示了Requirements::css方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Returns an instance of this class
  *
  * @param Controller $controller
  * @param string $name
  */
 public function __construct($controller, $name)
 {
     $fields = new FieldList(array(new HiddenField('AuthenticationMethod', null, $this->authenticator_class)));
     $actions = new FieldList(array(FormAction::create('redirectToRealMe', _t('RealMeLoginForm.LOGINBUTTON', 'LoginAction'))->setUseButtonTag(true)->setButtonContent('<span class="realme_button_padding">Login or register with RealMe<span class="realme_icon_new_window"></span> <span class="realme_icon_padlock"></span>')->setAttribute('class', 'realme_button')));
     // Taken from MemberLoginForm
     if (isset($_REQUEST['BackURL'])) {
         $backURL = $_REQUEST['BackURL'];
     } elseif (Session::get('BackURL')) {
         $backURL = Session::get('BackURL');
     }
     if (isset($backURL)) {
         // Ensure that $backURL isn't redirecting us back to login form or a RealMe authentication page
         if (strpos($backURL, 'Security/login') === false && strpos($backURL, 'Security/realme') === false) {
             $fields->push(new HiddenField('BackURL', 'BackURL', $backURL));
         }
     }
     // optionally include requirements {@see /realme/_config/config.yml}
     if ($this->config()->include_jquery) {
         Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery.js");
     }
     if ($this->config()->include_javascript) {
         Requirements::javascript(REALME_MODULE_PATH . "/javascript/realme.js");
     }
     if ($this->config()->include_css) {
         Requirements::css(REALME_MODULE_PATH . "/css/realme.css");
     }
     parent::__construct($controller, $name, $fields, $actions);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-realme,代码行数:34,代码来源:RealMeLoginForm.php

示例2: Field

 function Field($properties = array())
 {
     Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
     Requirements::javascript(FRAMEWORK_DIR . '/javascript/ConfirmedPasswordField.js');
     Requirements::css(FRAMEWORK_DIR . '/css/ConfirmedPasswordField.css');
     $content = '';
     if ($this->showOnClick) {
         if ($this->showOnClickTitle) {
             $title = $this->showOnClickTitle;
         } else {
             $title = _t('ConfirmedPasswordField.SHOWONCLICKTITLE', 'Change Password', 'Label of the link which triggers display of the "change password" formfields');
         }
         $content .= "<div class=\"showOnClick\">\n";
         $content .= "<a href=\"#\">{$title}</a>\n";
         $content .= "<div class=\"showOnClickContainer\">";
     }
     foreach ($this->children as $field) {
         $field->setDisabled($this->isDisabled());
         $field->setReadonly($this->isReadonly());
         $content .= $field->FieldHolder();
     }
     if ($this->showOnClick) {
         $content .= "</div>\n";
         $content .= "</div>\n";
     }
     return $content;
 }
开发者ID:prostart,项目名称:cobblestonepath,代码行数:27,代码来源:ConfirmedPasswordField.php

示例3: init

 function init()
 {
     parent::init();
     $this->securityToken = new SecurityToken();
     Requirements::css('news/code/ui/frontend/css/news.css');
     Requirements::css(Director::protocol() . '://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css');
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:7,代码来源:NewsPage_Controller.php

示例4: init

 function init()
 {
     parent::init();
     Requirements::css('newsletter/css/SubscriptionPage.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/jquery.validate.min.js');
 }
开发者ID:tractorcow,项目名称:silverstripe-newsletter,代码行数:7,代码来源:UnsubscribeController.php

示例5: initialize

 public function initialize()
 {
     Requirements::javascript('jsparty/jquery/jquery.js');
     Requirements::javascript('image_gallery/gallery_ui/prettyphoto/javascript/jquery.prettyPhoto.js');
     Requirements::javascript('image_gallery/gallery_ui/prettyphoto/javascript/prettyphoto_init.js');
     Requirements::css('image_gallery/gallery_ui/prettyphoto/css/prettyPhoto.css');
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:7,代码来源:PrettyPhoto.php

示例6: MarketPlaceReviewForm

 public function MarketPlaceReviewForm()
 {
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js");
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js");
     Requirements::combine_files('marketplace_review_form.js', array("themes/openstack/javascript/jquery.validate.custom.methods.js", "marketplace/code/ui/frontend/js/star-rating.min.js", "marketplace/code/ui/frontend/js/marketplace.review.js"));
     $css_files = array("marketplace/code/ui/frontend/css/star-rating.min.css", "marketplace/code/ui/frontend/css/marketplace-review.css");
     foreach ($css_files as $css_file) {
         Requirements::css($css_file);
     }
     $form = new MarketPlaceReviewForm($this, 'MarketPlaceReviewForm');
     $data = Session::get("FormInfo.Form_MarketPlaceReviewForm.data");
     $review = $this->review_repository->getReview($this->company_service_ID, Member::CurrentUserID());
     if (is_array($data)) {
         //get data from cache
         $form->loadDataFrom($data);
     } elseif ($review) {
         // get submitted review
         $form->loadDataFrom($review);
     }
     // Optional spam protection
     if (class_exists('SpamProtectorManager')) {
         SpamProtectorManager::update_form($form);
     }
     return $form;
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:25,代码来源:MarketPlaceDirectoryPage.php

示例7: Field

 public function Field($properties = array())
 {
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
     Requirements::javascript(SORTABLEFILE_DIR . '/javascript/SortableUploadField.js');
     Requirements::css(SORTABLEFILE_DIR . '/css/SortableUploadField.css');
     return parent::Field($properties);
 }
开发者ID:vinstah,项目名称:body,代码行数:7,代码来源:SortableUploadField.php

示例8: Field

    function Field()
    {
        Requirements::javascript("jsparty/calendar/calendar.js");
        Requirements::javascript("jsparty/calendar/lang/calendar-en.js");
        Requirements::javascript("jsparty/calendar/calendar-setup.js");
        Requirements::css("sapphire/css/CalendarDateField.css");
        Requirements::css("jsparty/calendar/calendar-win2k-1.css");
        Requirements::javascript("sapphire/javascript/CalendarDateField.js");
        $field = DateField::Field();
        $id = $this->id();
        $val = $this->attrValue();
        if (preg_match('/^\\d{2}\\/\\d{2}\\/\\d{4}$/', $val)) {
            $dateArray = explode('/', $val);
            $val = $dateArray[2] . '-' . $dateArray[1] . '-' . $dateArray[0];
        }
        $dateArray = explode('-', $val);
        $day = $dateArray[2];
        $month = $dateArray[1];
        $year = $dateArray[0];
        preg_match('/(.*)[(.+)]$/', $this->name, $fieldNameParts);
        $fieldNamePrefix = $fieldNameParts[1];
        $fieldName = $fieldNameParts[2];
        return <<<HTML
\t\t\t<div class="dmycalendardate">
\t\t\t\t<input type="hidden" id="{$id}" name="{$this->name}" value="{$val}" />
\t\t\t\t<input type="text" id="{$id}-day" class="day numeric" name="{$fieldNamePrefix}[{$fieldName}-Day]" value="{$day}" maxlength="2" />/
\t\t\t\t<input type="text" id="{$id}-month" class="month numeric" name="{$fieldNamePrefix}[{$fieldName}-Month]" value="{$month}" maxlength="2" />/
\t\t\t\t<input type="text" id="{$id}-year" class="year numeric" name="{$fieldNamePrefix}[{$fieldName}-Year]" value="{$year}" maxlength="4" />
\t\t\t\t<div class="calendarpopup" id="{$id}-calendar"></div>
\t\t\t</div>
HTML;
    }
开发者ID:ramziammar,项目名称:websites,代码行数:32,代码来源:DMYCalendarDateField.php

示例9: FieldHolder

 /**
  * @param array $properties
  *
  * @return string - HTML
  */
 public function FieldHolder($properties = array())
 {
     $moduleDir = substr(Director::makeRelative(dirname(dirname(dirname(__FILE__)))), 1);
     Requirements::css($moduleDir . '/css/WidgetAreaEditor.css');
     Requirements::javascript($moduleDir . '/javascript/WidgetAreaEditor.js');
     return $this->renderWith("WidgetAreaEditor");
 }
开发者ID:JayDevlin,项目名称:silverstripe-widgets,代码行数:12,代码来源:WidgetAreaEditor.php

示例10: updateCMSFields

 public function updateCMSFields(\FieldList $fields)
 {
     if (!Permission::check('ADMIN')) {
         Requirements::css(HIDE_HISTORY_BASE . '/css/hide-history.css');
     }
     parent::updateCMSFields($fields);
 }
开发者ID:helpfulrobot,项目名称:zirak-hide-history,代码行数:7,代码来源:HideHistory.php

示例11: initialize

 public function initialize()
 {
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript(ASSETS_GALLERY_BASE . '/gallery_ui/colorbox/javascript/jquery.colorbox-min.js');
     Requirements::javascript(ASSETS_GALLERY_BASE . '/gallery_ui/colorbox/javascript/colorbox_init.js');
     Requirements::css(ASSETS_GALLERY_BASE . '/gallery_ui/colorbox/css/colorbox.css');
 }
开发者ID:helpfulrobot,项目名称:exadium-silverstripe-module-assets-gallery,代码行数:7,代码来源:Colorbox.php

示例12: preview

 /**
  * Body for the preview iframe with just the typography styles included
  * @return string html
  */
 public function preview()
 {
     Requirements::clear();
     // Should contain text styles of the page by Silverstripe theme conventions.
     Requirements::css('themes/' . Config::inst()->get('SSViewer', 'theme') . '/css/editor.css');
     return $this->renderWith('PreviewFrame');
 }
开发者ID:robbieaverill,项目名称:silverstripe-markdowntextareafield,代码行数:11,代码来源:MarkdownTextareaField.php

示例13: SSCompactNavigator

 /**
  * SSCompactNavigator first checks if you are allowed to see the navigation bar, and if so, then checks
  * if third party templates have been specified. If so, it loads them, and provides them with the required
  * variables. If not, it loads the defaults instead.
  */
 public function SSCompactNavigator()
 {
     if (Director::isDev() || Permission::check('CMS_ACCESS_CMSMain')) {
         $RenderTemplate = isset(CompactNavigator::$Template) ? CompactNavigator::$Template : $this->class;
         if (isset(CompactNavigator::$CssTheme)) {
             Requirements::css(CompactNavigator::$CssTheme);
         } else {
             Requirements::css('compactnavigator/css/CompactNavigator.css');
         }
         if (isset(CompactNavigator::$JsTheme)) {
             Requirements::javascript(CompactNavigator::$JsTheme);
         } else {
             Requirements::javascript('compactnavigator/scripts/CompactNavigator.js');
         }
         if (class_exists("CMSMain")) {
             $this->owner->cmsLink = Controller::join_links(singleton("CMSMain")->Link("edit"), "show");
         }
         $this->owner->adminLink = self::$adminLink;
         if ($date = Versioned::current_archived_date()) {
             $this->owner->DisplayMode = 'Archived';
             $this->owner->ArDate = Object::create('Datetime', $date, null);
         } else {
             $this->owner->DisplayMode = Versioned::current_stage();
         }
         return $this->owner->renderWith(array($RenderTemplate, 'CompactNavigatior'));
     }
 }
开发者ID:helpfulrobot,项目名称:i-lateral-silverstripe-compactnavigator,代码行数:32,代码来源:CompactNavigator.php

示例14: Field

 /**
  * @param array $properties
  * @throws InvalidArgumentException
  * @return HTMLText
  */
 public function Field($properties = array())
 {
     Requirements::css(COLORPALETTE_DIR . '/css/ColorPaletteField.css');
     $source = $this->getSource();
     $odd = 0;
     $fieldExtraClass = $this->extraClass();
     $groups = array();
     if ($source) {
         foreach ($source as $name => $values) {
             if (is_array($values)) {
                 $options = array();
                 foreach ($values as $value => $color) {
                     $itemID = $this->ID() . '_' . preg_replace('/[^a-zA-Z0-9]/', '', $value);
                     $odd = ($odd + 1) % 2;
                     $extraClass = $odd ? 'odd' : 'even';
                     $extraClass .= ' val' . preg_replace('/[^a-zA-Z0-9\\-\\_]/', '_', $value);
                     $options[] = new ArrayData(array('ID' => $itemID, 'Class' => $extraClass, 'Name' => $this->name, 'Value' => $value, 'Title' => $color, 'isChecked' => $value == $this->value, 'isDisabled' => $this->disabled || in_array($value, $this->disabledItems)));
                 }
                 $groups[] = new ArrayData(array('ID' => $this->ID() . '_' . preg_replace('/[^a-zA-Z0-9]/', '', $name), 'extraClass' => $fieldExtraClass, 'Name' => $name, 'Options' => new ArrayList($options)));
             } else {
                 throw new InvalidArgumentException('To use GroupedColorPaletteField you need to pass in an array of array\'s');
             }
         }
     }
     $properties = array_merge($properties, array('Groups' => new ArrayList($groups)));
     return $this->customise($properties)->renderWith($this->getTemplates());
 }
开发者ID:helpfulrobot,项目名称:heyday-silverstripe-colorpalette,代码行数:32,代码来源:GroupedColorPaletteField.php

示例15: getColumnContent

 /**
  *
  * @param \GridField $gridField
  * @param \DataObject $record
  * @param string $columnName
  * @return string|null - the HTML for the column
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if (!$record instanceof \Payment) {
         return null;
     }
     if (!$record->canRefund()) {
         return null;
     }
     \Requirements::css('omnipay-ui/css/omnipay-ui-cms.css');
     \Requirements::javascript('omnipay-ui/javascript/omnipay-ui-cms.js');
     \Requirements::add_i18n_javascript('omnipay-ui/javascript/lang');
     $infoText = '';
     switch (GatewayInfo::refundMode($record->Gateway)) {
         case GatewayInfo::MULTIPLE:
             $infoText = 'MultiRefundInfo';
             break;
         case GatewayInfo::PARTIAL:
             $infoText = 'SingleRefundInfo';
             break;
         case GatewayInfo::FULL:
             $infoText = 'FullRefundInfo';
             break;
     }
     /** @var \Money $money */
     $money = $record->dbObject('Money');
     /** @var \GridField_FormAction $field */
     $field = \GridField_FormAction::create($gridField, 'RefundPayment' . $record->ID, false, 'refundpayment', array('RecordID' => $record->ID))->addExtraClass('gridfield-button-refund payment-dialog-button')->setAttribute('title', _t('GridFieldRefundAction.Title', 'Refund Payment'))->setAttribute('data-icon', 'button-refund')->setAttribute('data-dialog', json_encode(array('maxAmount' => $money->Nice(), 'maxAmountNum' => $money->getAmount(), 'hasAmountField' => $record->canRefund(null, true), 'infoTextKey' => $infoText, 'buttonTextKey' => 'RefundAmount')))->setDescription(_t('GridFieldRefundAction.Description', 'Refund a captured payment'));
     return $field->Field();
 }
开发者ID:bummzack,项目名称:silverstripe-omnipay-ui,代码行数:36,代码来源:GridFieldRefundAction.php


注:本文中的Requirements::css方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。