本文整理汇总了PHP中CRM_Core_Resources::addStyleFile方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Resources::addStyleFile方法的具体用法?PHP CRM_Core_Resources::addStyleFile怎么用?PHP CRM_Core_Resources::addStyleFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Resources
的用法示例。
在下文中一共展示了CRM_Core_Resources::addStyleFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddStyleFile
public function testAddStyleFile()
{
$this->res->addStyleFile('com.example.ext', 'foo%20bar.css', 0, 'testAddStyleFile')->addStyleFile('com.example.ext', 'foo%20bar.css', 0, 'testAddStyleFile')->addStyleFile('civicrm', 'foo%20bar.css', 0, 'testAddStyleFile');
$smarty = CRM_Core_Smarty::singleton();
$actual = $smarty->fetch('string:{crmRegion name=testAddStyleFile}{/crmRegion}');
$expected = "" . "<link href=\"http://core-app/foo%20bar.css?r=resTest\" rel=\"stylesheet\" type=\"text/css\"/>\n" . "<link href=\"http://ext-dir/com.example.ext/foo%20bar.css?r=resTest\" rel=\"stylesheet\" type=\"text/css\"/>\n";
$this->assertEquals($expected, $actual);
}
示例2: registerResources
/**
* @param CRM_Core_Resources $res
*/
public function registerResources(CRM_Core_Resources $res)
{
$weight = self::DEFAULT_MODULE_WEIGHT;
$res->addSettingsFactory(function () {
// inorder to use ext resource url in JS - e.g CRM.resourceUrls
$jsvar = array('resourceUrls' => CRM_Extension_System::singleton()->getMapper()->getActiveModuleUrls());
return $jsvar;
});
$res->addStyleFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/mosaico-material.min.css', $weight++, 'html-header', TRUE);
$res->addStyleFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/notoregular/stylesheet.css', $weight++, 'html-header', TRUE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/knockout.js', $weight++, 'html-header', TRUE);
// civi already has jquery.min
//$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/jquery.min.js', $weight++, 'html-header', TRUE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'js/index.js', $weight++, 'html-header', FALSE);
$res->addStyleFile('uk.co.vedaconsulting.mosaico', 'css/index.css', $weight++, 'html-header', TRUE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'js/index2.js', $weight++, 'html-header', TRUE);
}
示例3: registerResources
/**
* @param CRM_Core_Resources $res
*/
public function registerResources(CRM_Core_Resources $res)
{
$weight = self::DEFAULT_MODULE_WEIGHT;
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/knockout.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/jquery.min.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/jquery-ui.min.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/jquery.ui.touch-punch.min.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/load-image.all.min.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/canvas-to-blob.min.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/jquery.iframe-transport.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/jquery.fileupload.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/jquery.fileupload-process.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/jquery.fileupload-image.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/jquery.fileupload-validate.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/knockout-jqueryui.min.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/evol.colorpicker.min.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/tinymce.min.js', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/mosaico.min.js?v=0.11', $weight++, 'html-header', FALSE);
$res->addScriptFile('uk.co.vedaconsulting.mosaico', 'js/editor.js', $weight++, 'html-header', FALSE);
$res->addStyleFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/mosaico-material.min.css?v=0.10', $weight++, 'html-header', TRUE);
$res->addStyleFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/notoregular/stylesheet.css', $weight++, 'html-header', TRUE);
$res->addStyleFile('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/vendor/evol.colorpicker.min.css', $weight++, 'html-header', TRUE);
}
示例4: registerResources
/**
* @param CRM_Core_Resources $res
*/
public function registerResources(CRM_Core_Resources $res)
{
$modules = self::getAngularModules();
$res->addSettingsFactory(function () use(&$modules) {
// TODO optimization; client-side caching
return array('resourceUrls' => CRM_Extension_System::singleton()->getMapper()->getActiveModuleUrls(), 'angular' => array('modules' => array_merge(array('ngRoute'), array_keys($modules))));
});
$res->addScriptFile('civicrm', 'packages/bower_components/angular/angular.min.js', 100, 'html-header', FALSE);
$res->addScriptFile('civicrm', 'packages/bower_components/angular-route/angular-route.min.js', 110, 'html-header', FALSE);
foreach ($modules as $module) {
if (!empty($module['css'])) {
foreach ($module['css'] as $file) {
$res->addStyleFile($module['ext'], $file, self::DEFAULT_MODULE_WEIGHT, 'html-header', TRUE);
}
}
if (!empty($module['js'])) {
foreach ($module['js'] as $file) {
$res->addScriptFile($module['ext'], $file, self::DEFAULT_MODULE_WEIGHT, 'html-header', TRUE);
}
}
}
}