本文整理汇总了PHP中Requirements::javascriptTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP Requirements::javascriptTemplate方法的具体用法?PHP Requirements::javascriptTemplate怎么用?PHP Requirements::javascriptTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Requirements
的用法示例。
在下文中一共展示了Requirements::javascriptTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Field
function Field()
{
if ($this->includeDefaultJS) {
Requirements::javascriptTemplate('sapphire/javascript/InlineFormAction.js', array('ID' => $this->id()));
}
return "<input type=\"submit\" name=\"action_{$this->name}\" value=\"{$this->title}\" id=\"{$this->id()}\" class=\"action{$this->extraClass}\" />";
}
示例2: init
public function init()
{
parent::init();
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
Requirements::javascript("jsparty/tiny_mce_improvements.js");
Requirements::javascript("jsparty/hover.js");
Requirements::javascript("jsparty/scriptaculous/controls.js");
Requirements::javascript("cms/javascript/SecurityAdmin.js");
Requirements::javascript("cms/javascript/LeftAndMain_left.js");
Requirements::javascript("cms/javascript/LeftAndMain_right.js");
Requirements::javascript("cms/javascript/CMSMain_left.js");
Requirements::javascript("cms/javascript/ReportAdmin_left.js");
Requirements::javascript("cms/javascript/ReportAdmin_right.js");
Requirements::css("cms/css/ReportAdmin.css");
// TODO Find a better solution to integrate optional Requirements in a specific order
if (Director::fileExists("ecommerce/css/DataReportCMSMain.css")) {
Requirements::css("ecommerce/css/DataReportCMSMain.css");
}
if (Director::fileExists("ecommerce/css/DataReportCMSMain.css")) {
Requirements::javascript("ecommerce/javascript/DataReport.js");
}
if (Director::fileExists(project() . "/css/DataReportCMSMain.css")) {
Requirements::css(project() . "/css/DataReportCMSMain.css");
}
if (Director::fileExists(project() . "/css/DataReportCMSMain.css")) {
Requirements::javascript(project() . "/javascript/DataReport.js");
}
// We don't want this showing up in every ajax-response, it should always be present in a CMS-environment
if (!Director::is_ajax()) {
Requirements::javascriptTemplate("cms/javascript/tinymce.template.js", array("ContentCSS" => project() . "/css/editor.css", "BaseURL" => Director::absoluteBaseURL(), "Lang" => i18n::get_tinymce_lang()));
}
}
示例3: init
public function init()
{
parent::init();
// We don't want this showing up in every ajax-response, it should always be present in a CMS-environment
if (!Director::is_ajax()) {
Requirements::javascriptTemplate("cms/javascript/tinymce.template.js", array("ContentCSS" => (SSViewer::current_theme() ? "themes/" . SSViewer::current_theme() : project()) . "/css/editor.css", "BaseURL" => Director::absoluteBaseURL(), "Lang" => i18n::get_tinymce_lang()));
}
Requirements::javascript('cms/javascript/CMSMain.js');
Requirements::javascript('cms/javascript/CMSMain_left.js');
Requirements::javascript('cms/javascript/CMSMain_right.js');
Requirements::javascript('sapphire/javascript/UpdateURL.js');
/**
* HACK ALERT: Project-specific requirements
*
* We need a better way of including all of the CSS that *might* be used by this application.
* Perhaps the ajax responses can include some instructions to go get more CSS / JavaScript?
*/
Requirements::css("survey/css/SurveyFilter.css");
Requirements::javascript("survey/javascript/SurveyResponses.js");
Requirements::javascript("survey/javascript/FormResponses.js");
Requirements::javascript("parents/javascript/NotifyMembers.js");
Requirements::css("tourism/css/SurveyCMSMain.css");
Requirements::javascript("tourism/javascript/QuotasReport.js");
Requirements::javascript("sapphire/javascript/ReportField.js");
Requirements::javascript("ptraining/javascript/BookingList.js");
Requirements::javascript("forum/javascript/ForumAccess.js");
Requirements::javascript('gallery/javascript/GalleryPage_CMS.js');
}
示例4: Field
public function Field($properties = array())
{
if ($this->includeDefaultJS) {
Requirements::javascriptTemplate(FRAMEWORK_DIR . '/javascript/InlineFormAction.js', array('ID' => $this->id()));
}
return "<input type=\"submit\" name=\"action_{$this->name}\" value=\"{$this->title}\" id=\"{$this->id()}\"" . " class=\"action{$this->extraClass}\" />";
}
示例5: Field
/**
* @param array $properties
* @return string
*/
public function Field($properties = array())
{
if ($this->includeDefaultJS) {
Requirements::javascriptTemplate(FRAMEWORK_DIR . '/client/dist/js/InlineFormAction.js', array('ID' => $this->ID()));
}
return FormField::create_tag('input', array('type' => 'submit', 'name' => sprintf('action_%s', $this->getName()), 'value' => $this->title, 'id' => $this->ID(), 'class' => sprintf('action%s', $this->extraClass)));
}
示例6: init
public function init()
{
// Check permissions
// if(!Member::currentUser() || !Member::currentUser()->isAdmin()) Security::permissionFailure($this);
parent::init();
/*
if(!$this->can('AdminCMS')) {
$messageSet = array(
'default' => "Please choose an authentication method and enter your credentials to access the CMS.",
'alreadyLoggedIn' => "I'm sorry, but you can't access that part of the CMS. If you want to log in as someone else, do so below",
'logInAgain' => "You have been logged out of the CMS. If you would like to log in again, enter a username and password below.",
);
Security::permissionFailure($this, $messageSet);
return;
}*/
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
Requirements::javascript("jsparty/tiny_mce_improvements.js");
Requirements::javascript("jsparty/hover.js");
Requirements::javascript("jsparty/scriptaculous/controls.js");
Requirements::javascript("cms/javascript/SecurityAdmin.js");
Requirements::javascript("cms/javascript/LeftAndMain_left.js");
Requirements::javascript("cms/javascript/LeftAndMain_right.js");
Requirements::javascript("cms/javascript/CMSMain_left.js");
Requirements::javascript("cms/javascript/NewsletterAdmin_left.js");
Requirements::javascript("cms/javascript/NewsletterAdmin_right.js");
Requirements::javascript("sapphire/javascript/ProgressBar.js");
// We don't want this showing up in every ajax-response, it should always be present in a CMS-environment
if (!Director::is_ajax()) {
Requirements::javascriptTemplate("cms/javascript/tinymce.template.js", array("ContentCSS" => project() . "/css/editor.css", "BaseURL" => Director::absoluteBaseURL(), "Lang" => i18n::get_tinymce_lang()));
}
// needed for MemberTableField (Requirements not determined before Ajax-Call)
Requirements::javascript("cms/javascript/MemberTableField.js");
Requirements::css("cms/css/NewsletterAdmin.css");
}
示例7: Field
function Field()
{
Requirements::javascript("mysite/javascript/jquery-ui-1.8.6.custom.min.js");
Requirements::javascript("http://maps.google.com/maps/api/js?sensor=true");
Requirements::javascriptTemplate("googlemapselectionfield/javascript/GoogleMapSelectionFieldv2.js", array('Name' => $this->name, 'DefaultLat' => $this->startLat, 'DefaultLon' => $this->startLong, 'MapWidth' => $this->mapWidth, 'MapHeight' => $this->mapHeight, 'Zoom' => $this->zoom));
return " \n\t\t\t<div class=\"googleMapField\"> \n <div id=\"map_{$this->name}\" style=\"margin-top: 20px; width: {$this->mapWidth}; height: {$this->mapHeight};\"></div>\n\t\t\t</div>";
}
示例8: parse
/**
* Parses the snippet short code
* @example [snippet id=123]
* @example [snippet id=123 version=456]
*/
public static function parse($arguments, $content = null, $parser = null)
{
//Ensure ID is pressent in the arguments
if (!array_key_exists('id', $arguments)) {
return '<p><b><i>' . _t('CodeBankShortCode.MISSING_ID_ATTRIBUTE', '_Short Code missing the id attribute') . '</i></b></p>';
}
//Fetch Snippet
$snippet = Snippet::get()->byID(intval($arguments['id']));
if (empty($snippet) || $snippet === false || $snippet->ID == 0) {
return '<p><b><i>' . _t('CodeBankShortCode.SNIPPET_NOT_FOUND', '_Snippet not found') . '</i></b></p>';
}
//Fetch Text
$snippetText = $snippet->SnippetText;
//If the version exists fetch it, and replace the text with that of the version
if (array_key_exists('version', $arguments)) {
$version = $snippet->Version(intval($arguments['version']));
if (empty($version) || $version === false || $version->ID == 0) {
$snippetText = $version->Text;
}
}
//Load CSS Requirements
Requirements::css(CB_DIR . '/javascript/external/syntaxhighlighter/themes/shCore.css');
Requirements::css(CB_DIR . '/javascript/external/syntaxhighlighter/themes/shCoreDefault.css');
Requirements::css(CB_DIR . '/javascript/external/syntaxhighlighter/themes/shThemeDefault.css');
//Load JS Requirements
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(CB_DIR . '/javascript/external/syntaxhighlighter/brushes/shCore.js');
Requirements::javascript(CB_DIR . '/javascript/external/syntaxhighlighter/brushes/' . self::getBrushName($snippet->Language()->HighlightCode) . '.js');
Requirements::javascriptTemplate(CB_DIR . '/javascript/CodeBankShortCode.template.js', array('ID' => $snippet->ID), 'snippet-highlightinit-' . $snippet->ID);
//Render the snippet
$obj = new ViewableData();
return $obj->renderWith('CodeBankShortCode', array('ID' => $snippet->ID, 'Title' => $snippet->getField('Title'), 'Description' => $snippet->getField('Description'), 'SnippetText' => DBField::create_field('Text', $snippetText), 'HighlightCode' => strtolower($snippet->Language()->HighlightCode)));
}
示例9: Field
/**
* @param array $properties
* @return HTMLText
*/
public function Field($properties = array())
{
if ($this->includeDefaultJS) {
Requirements::javascriptTemplate(FRAMEWORK_DIR . '/javascript/InlineFormAction.js', array('ID' => $this->id()));
}
return DBField::create_field('HTMLText', FormField::create('input', array('name' => sprintf('action_%s', $this->getName()), 'value' => $this->title, 'id' => $this->ID(), 'class' => sprintf('action%s', $this->extraClass))));
}
示例10: init
/**
* @return void
*/
public function init()
{
parent::init();
$conf = $this->boxes();
$parsed = $this->parseForJS($conf);
Requirements::css(INFOBOXES_DIR . '/css/InfoBoxes.css');
Requirements::javascriptTemplate(INFOBOXES_DIR . '/javascript/InfoBoxes.js', $parsed);
}
示例11: FieldHolder
function FieldHolder()
{
$regions = Region::shipping_regions();
$jsonRegions = json_encode($regions);
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascriptTemplate('swipestripe/javascript/RegionField.js', array("regions" => $jsonRegions, 'defaultValue' => $this->Value()));
return parent::FieldHolder();
}
示例12: Field
function Field()
{
Requirements::javascript("mysite/javascript/jquery-ui-1.8.6.custom.min.js");
Requirements::javascript("http://maps.google.com/maps/api/js?sensor=true");
Requirements::javascriptTemplate("googlemapselectionfield/javascript/GoogleMapSelectionField.js", array('Name' => $this->name, 'DefaultLat' => $this->startLat, 'DefaultLon' => $this->startLong, 'MapWidth' => $this->mapWidth, 'MapHeight' => $this->mapHeight, 'Zoom' => $this->zoom));
return " \n\t\t\t<div class=\"googleMapField\">\n <div class=\"mapdetails\">\n <p class=\"left\"><input type=\"text\" id=\"{$this->id()}\" name=\"{$this->name}\" value=\"" . _t('GoogleMapSelectableField.ENTERADDRESS', 'Enter Address') . "\" class=\"longText\"/></p>\n <p class=\"left\"><input type=\"text\" id=\"{$this->id()}_Lng\" name=\"{$this->name}_Lng\" /></p>\n <p class=\"left\"><input type=\"text\" id=\"{$this->id()}_Lat\" name=\"{$this->name}_Lat\" /></p>\n <p class=\"field checkbox\">\n <input class=\"left\" type=\"checkbox\" id=\"ShowDetails\" name=\"{$this->name}_ShowDetails\" />\n <label class=\"right\" for=\"ShowDetails\" style=\"cursor: pointer\">Add a better description of the location?</label>\n </p>\n <div id=\"LocationDetailsInput\" style=\"float: left; overflow: hidden; height: 0px\"><p class=\"left\"><input type=\"text\" id=\"{$this->id()}\"_Details\" name=\"{$this->name}_Details\" class=\"longText\"//></p></div>\n \n </div>\n <div class=\"clear\"></div>\n <div id=\"map_{$this->name}\" style=\"margin-top: 20px; width: {$this->mapWidth}; height: {$this->mapHeight};\"></div>\n\t\t\t</div>";
//<input type=\"hidden\" id=\"{$this->id()}_MapURL\" name=\"{$this->name}_MapURL\" />
//<input type=\"submit\" value=\"" . _t('EditableFormField.GO', 'Go') . "\" class=\"submit googleMapAddressSubmit\" />
}
示例13: onAfterInit
public function onAfterInit()
{
if ($this->owner->Maps()->exists() && $this->owner->ShowMap && !$this->owner->StaticMap) {
foreach ($this->owner->Maps() as $map) {
$vars = array('MapID' => "google-map-dynamic-{$map->ID}", 'Content' => $map->Content, 'Address' => $map->Address ? str_replace('/n', ',', $map->Address) . ',' . $map->PostCode : 'false', 'Latitude' => $map->Latitude ? $map->Latitude : 'false', 'Longitude' => $map->Longitude ? $map->Longitude : 'false', 'Zoom' => $map->ZoomLevel);
Requirements::javascriptTemplate('googlemaps/javascript/GoogleMap.js', $vars);
}
}
}
示例14: init
public function init()
{
$mode = Config::inst()->get('UserPreviewPreference', 'DefaultMode');
$userMode = Member::currentUser()->DefaultPreviewMode;
if (!empty($userMode)) {
$mode = $userMode;
}
Requirements::javascriptTemplate(CMSPREVIEWPREFERENCE_BASE . '/javascript/preview-mode.template.js', array('PreviewMode' => $mode), 'cms-preview-mode');
}
开发者ID:helpfulrobot,项目名称:webbuilders-group-silverstripe-cmspreviewpreference,代码行数:9,代码来源:CMSPreviewPreference.php
示例15: init
public function init()
{
parent::init();
Requirements::css(DISTRIBUTOR_MAP_DIR . '/css/distributor-map.css');
Requirements::javascript(DISTRIBUTOR_MAP_DIR . "/js/DistributorMap.js");
Requirements::javascript(DISTRIBUTOR_MAP_DIR . "/js/Base64Handler.js");
$aVars = array('Address' => $this->Address, 'Project' => PROJECT, 'Module' => DISTRIBUTOR_MAP_DIR, 'MapIcon' => $this->getMapIcon(), 'Distributors' => $this->DistributorList());
Requirements::javascriptTemplate(DISTRIBUTOR_MAP_DIR . '/js/DistributorGoogleMapCode.js', $aVars, "Distributors-" . $this->ID);
}