本文整理汇总了PHP中Requirements::themedCSS方法的典型用法代码示例。如果您正苦于以下问题:PHP Requirements::themedCSS方法的具体用法?PHP Requirements::themedCSS怎么用?PHP Requirements::themedCSS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Requirements
的用法示例。
在下文中一共展示了Requirements::themedCSS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
Requirements::themedCSS('reset');
Requirements::themedCSS('layout');
Requirements::themedCSS('form');
Requirements::themedCSS('typography');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::css('mysite/css/demo.css');
Requirements::css('mysite/css/moduleSupport.css');
Requirements::customScript(<<<JS
(function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-84547-17', 'auto', { 'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', [
\t'www.silverstripe.com',
\t'www.silverstripe.org',
\t'addons.silverstripe.org',
\t'api.silverstripe.org',
\t'docs.silverstripe.org',
\t'userhelp.silverstripe.org',
\t'demo.silverstripe.org'
]);
ga('send', 'pageview');
JS
);
}
示例2: onAfterInit
/**
* Standard SS method.
* Runs after the Page::init method is called.
*/
function onAfterInit()
{
Requirements::javascript(EcommerceConfig::get("EcommerceConfigAjax", "cart_js_file_location"));
Requirements::javascript(EcommerceConfig::get("EcommerceConfigAjax", "dialogue_js_file_location"));
Requirements::themedCSS("Cart");
Requirements::themedCSS("jquery.colorbox");
}
示例3: init
function init()
{
parent::init();
Requirements::themedCSS("YouTubeGalleryHolderPage");
Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery.js");
Requirements::javascript("youtubegallery/javascript/YouTubeGalleryHolderPage.js");
}
示例4: init
public function init()
{
parent::init();
// Note: you should use SS template require tags inside your templates
// instead of putting Requirements calls here. However these are
// included so that our older themes still work
Requirements::themedCSS('layout');
Requirements::themedCSS('comments');
Requirements::themedCSS('typography');
Requirements::themedCSS('form');
Requirements::themedCSS('slick');
if (!Cookie::get($StoryModeCookie)) {
Cookie::set($StoryModeCookie, 'Normal');
}
if (!Cookie::get($StorySizeCookie)) {
Cookie::set($StorySizeCookie, 'Normal');
}
// Increment page view counter
$pagecounter = DataObject::get_one("PageCounter", "PageID='{$this->ID}'");
if (!$pagecounter) {
$pagecounter = new PageCounter();
$pagecounter->PageID = $this->ID;
}
$pagecounter->Counter = $pagecounter->Counter + 1;
$pagecounter->write();
}
示例5: init
public function init()
{
parent::init();
Requirements::clear();
Requirements::insertHeadTags('<meta http-equiv="Content-language" content="' . i18n::get_locale() . '" />');
Requirements::themedCSS('sendfriend', 'screen');
}
示例6: init
public function init()
{
parent::init();
Requirements::themedCSS('reset');
Requirements::themedCSS('layout');
Requirements::themedCSS('form');
Requirements::themedCSS('typography');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::css('mysite/css/demo.css');
Requirements::css('mysite/css/moduleSupport.css');
Requirements::customScript(<<<JS
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-84547-11']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
JS
);
}
示例7: onAfterInit
public function onAfterInit() {
$cssTemplate = Object::get_static('GalleristPageDecorator', 'css_template');
if ((bool)$cssTemplate && $this->owner->hasMethod('data')) {
Requirements::customCSS($this->owner->data()->renderWith($cssTemplate));
}
Requirements::themedCSS('gallerist');
}
示例8: RSSLink
/**
* Return an absolute URL based on the BlogHolder
* that this widget is located on.
*
* @return string
*/
function RSSLink() {
Requirements::themedCSS('subscribersswidget');
$blogHolder = $this->getBlogHolder();
if($blogHolder) {
return $blogHolder->Link() . 'rss';
}
}
示例9: init
function init() {
parent::init();
Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}
示例10: Field
function Field($properties = array())
{
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-form/jquery.form.js');
Requirements::javascript('pagerater/javascript/jquery.rating.pack.js');
Requirements::javascript('pagerater/javascript/PageRater.js');
if ($this->Config()->get("extra_form_selector")) {
Requirements::customScript("PageRater.set_extra_form_selector('" . $this->Config()->get("extra_form_selector") . "');");
}
Requirements::themedCSS('jquery.rating', "pagerater");
$html = "";
$name = $this->getName();
$id = $this->id();
for ($i = 1; $i < $this->starOptions + 1; $i++) {
if ($i == $this->Value()) {
$html .= "<input name='{$id}' class='{$id}' type='radio' checked='checked' value='{$i}' />";
} else {
$html .= "<input name='{$id}' class='{$id}' type='radio' value='{$i}' />";
}
}
$html .= "<input name='{$name}' type='hidden' id='{$id}' />";
Requirements::customScript(<<<JS
\t\t\tjQuery('.{$id}').rating({
\t\t\t\trequired: true,
\t\t\t\tcallback: function(value, link) {
\t\t\t\t\tjQuery('#{$id}').val(value);
\t\t\t\t}
\t\t\t});
JS
);
return $html;
}
示例11: Dates
function Dates()
{
Requirements::themedCSS('archivewidget');
$results = new DataObjectSet();
$container = BlogTree::current();
$ids = $container->BlogHolderIDs();
$stage = Versioned::current_stage();
$suffix = !$stage || $stage == 'Stage' ? "" : "_{$stage}";
$monthclause = method_exists(DB::getConn(), 'formattedDatetimeClause') ? DB::getConn()->formattedDatetimeClause('"Date"', '%m') : 'MONTH("Date")';
$yearclause = method_exists(DB::getConn(), 'formattedDatetimeClause') ? DB::getConn()->formattedDatetimeClause('"Date"', '%Y') : 'YEAR("Date")';
$sqlResults = DB::query("\n\t\t\tSELECT DISTINCT CAST({$monthclause} AS " . DB::getConn()->dbDataType('unsigned integer') . ") AS \"Month\", {$yearclause} AS \"Year\"\n\t\t\tFROM \"SiteTree{$suffix}\" INNER JOIN \"BlogEntry{$suffix}\" ON \"SiteTree{$suffix}\".\"ID\" = \"BlogEntry{$suffix}\".\"ID\"\n\t\t\tWHERE \"ParentID\" IN (" . implode(', ', $ids) . ")\n\t\t\tORDER BY \"Year\" DESC, \"Month\" DESC;");
if ($this->ShowLastYears == 0) {
$cutOffYear = 0;
} else {
$cutOffYear = (int) date("Y") - $this->ShowLastYears;
}
$years = array();
if (Director::get_current_page()->ClassName == 'BlogHolder') {
$urlParams = Director::urlParams();
$yearParam = $urlParams['ID'];
$monthParam = $urlParams['OtherID'];
} else {
$date = new DateTime(Director::get_current_page()->Date);
$yearParam = $date->format("Y");
$monthParam = $date->format("m");
}
if ($sqlResults) {
foreach ($sqlResults as $sqlResult) {
$isMonthDisplay = true;
$year = $sqlResult['Year'] ? (int) $sqlResult['Year'] : date('Y');
$isMonthDisplay = $year > $cutOffYear;
// $dateFormat = 'Month'; else $dateFormat = 'Year';
$monthVal = isset($sqlResult['Month']) ? (int) $sqlResult['Month'] : 1;
$month = $isMonthDisplay ? $monthVal : 1;
$date = DBField::create('Date', array('Day' => 1, 'Month' => $month, 'Year' => $year));
if ($isMonthDisplay) {
$link = $container->Link('date') . '/' . $sqlResult['Year'] . '/' . sprintf("%'02d", $monthVal);
} else {
$link = $container->Link('date') . '/' . $sqlResult['Year'];
}
if ($isMonthDisplay || !$isMonthDisplay && !in_array($year, $years)) {
$years[] = $year;
$current = false;
$children = new DataObjectSet();
$LinkingMode = "link";
if ($isMonthDisplay && $yearParam == $year && $monthParam == $month || !$isMonthDisplay && $yearParam == $year) {
$LinkingMode = "current";
$current = true;
if ($this->ShowChildren && $isMonthDisplay) {
$filter = $yearclause . ' = ' . $year . ' AND ' . $monthclause . ' = ' . $month;
$children = DataObject::get('BlogEntry', $filter, "Date DESC");
}
}
$results->push(new ArrayData(array('Date' => $date, 'Year' => $year, 'Link' => $link, 'NoMonth' => !$isMonthDisplay, 'LinkingMode' => $LinkingMode, 'Children' => $children)));
unset($children);
}
}
}
return $results;
}
示例12: init
function init()
{
parent::init();
Requirements::themedCSS('editor');
Requirements::javascript('mysite/js/signup-now.js');
SSViewer::setOption('rewriteHashlinks', false);
}
示例13: Dates
function Dates()
{
Requirements::themedCSS('archivewidget');
$results = new DataObjectSet();
$container = BlogTree::current();
$ids = $container->BlogHolderIDs();
$stage = Versioned::current_stage();
$suffix = !$stage || $stage == 'Stage' ? "" : "_{$stage}";
$monthclause = method_exists(DB::getConn(), 'formattedDatetimeClause') ? DB::getConn()->formattedDatetimeClause('"Date"', '%m') : 'MONTH("Date")';
$yearclause = method_exists(DB::getConn(), 'formattedDatetimeClause') ? DB::getConn()->formattedDatetimeClause('"Date"', '%Y') : 'YEAR("Date")';
if ($this->DisplayMode == 'month') {
$sqlResults = DB::query("\n\t\t\t\tSELECT DISTINCT CAST({$monthclause} AS " . DB::getConn()->dbDataType('unsigned integer') . ") AS \"Month\", {$yearclause} AS \"Year\"\n\t\t\t\tFROM \"SiteTree{$suffix}\" INNER JOIN \"BlogEntry{$suffix}\" ON \"SiteTree{$suffix}\".\"ID\" = \"BlogEntry{$suffix}\".\"ID\"\n\t\t\t\tWHERE \"ParentID\" IN (" . implode(', ', $ids) . ")\n\t\t\t\tORDER BY \"Year\" DESC, \"Month\" DESC;");
} else {
$sqlResults = DB::query("\n\t\t\t\tSELECT DISTINCT {$yearclause} AS \"Year\" \n\t\t\t\tFROM \"SiteTree{$suffix}\" INNER JOIN \"BlogEntry{$suffix}\" ON \"SiteTree{$suffix}\".\"ID\" = \"BlogEntry{$suffix}\".\"ID\"\n\t\t\t\tWHERE \"ParentID\" IN (" . implode(', ', $ids) . ")\n\t\t\t\tORDER BY \"Year\" DESC");
}
if ($sqlResults) {
foreach ($sqlResults as $sqlResult) {
$isMonthDisplay = $this->DisplayMode == 'month';
$monthVal = isset($sqlResult['Month']) ? (int) $sqlResult['Month'] : 1;
$month = $isMonthDisplay ? $monthVal : 1;
$year = $sqlResult['Year'] ? (int) $sqlResult['Year'] : date('Y');
$date = DBField::create('Date', array('Day' => 1, 'Month' => $month, 'Year' => $year));
if ($isMonthDisplay) {
$link = $container->Link('date') . '/' . $sqlResult['Year'] . '/' . sprintf("%'02d", $monthVal);
} else {
$link = $container->Link('date') . '/' . $sqlResult['Year'];
}
$results->push(new ArrayData(array('Date' => $date, 'Link' => $link)));
}
}
return $results;
}
示例14: __construct
/**
* Constructor
*
* @param Controller $controller The parent controller, necessary to
* create the appropriate form action tag.
* @param string $name The method on the controller that will return this
* form object.
* @param FieldSet|FormField $fields All of the fields in the form - a
* {@link FieldSet} of {@link FormField}
* objects.
* @param FieldSet|FormAction $actions All of the action buttons in the
* form - a {@link FieldSet} of
* {@link FormAction} objects
* @param bool $checkCurrentUser If set to TRUE, it will be checked if a
* the user is currently logged in, and if
* so, only a logout button will be rendered
*/
function __construct($controller, $name, $fields = null, $actions = null, $checkCurrentUser = true)
{
$this->authenticator_class = 'OpenIDAuthenticator';
Requirements::themedCSS('openid_login');
if (isset($_REQUEST['BackURL'])) {
$backURL = $_REQUEST['BackURL'];
} else {
$backURL = Session::get('BackURL');
}
if ($checkCurrentUser && Member::currentUserID()) {
$fields = new FieldSet();
$actions = new FieldSet(new FormAction("logout", _t('Member.BUTTONLOGINOTHER')));
} else {
if (!$fields) {
$fields = new FieldSet(new LiteralField("OpenIDDescription", _t('OpenIDLoginForm.DESC', '<div id="OpenIDDescription"><p>OpenID is an Internet-wide identity system
that allows you to sign in to many websites with a single account.
For more information visit <a href="http://openid.net">openid.net</a>.</p></div>
')), new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this), new TextField("OpenIDURL", _t('OpenIDLoginForm.URL', "OpenID URL"), Session::get('SessionForms.OpenIDLoginForm.OpenIDURL'), null, $this), new CheckboxField("Remember", _t('Member.REMEMBERME'), Session::get('SessionForms.OpenIDLoginForm.Remember'), $this));
}
if (!$actions) {
$actions = new FieldSet(new FormAction("dologin", _t('Member.BUTTONLOGIN')));
}
}
if (isset($backURL)) {
$fields->push(new HiddenField('BackURL', 'BackURL', $backURL));
}
parent::__construct($controller, $name, $fields, $actions);
}
示例15: contentcontrollerInit
function contentcontrollerInit()
{
Requirements::themedCSS("colorbox");
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript("colorbox/javascript/jquery.colorbox-min.js");
Requirements::javascript("colorbox/javascript/colorbox.js");
}