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


PHP sfSympalConfig::getAssetPath方法代码示例

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


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

示例1: loadEditorAssets

 public function loadEditorAssets()
 {
     if (!$this->_editorAssetsLoaded) {
         $this->configuration->loadHelpers('SympalContentSlotEditor');
         sfSympalToolkit::useJQuery(array('ui'));
         $response = sfContext::getInstance()->getResponse();
         // Load jquery tools/plugins that the inline editor requires
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/jQuery.cookie.js'));
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/jQuery.elastic.js'));
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/jquery.Jcrop.min.js'));
         // Load markitup markdown editor
         if (sfSympalConfig::get('enable_markdown_editor')) {
             $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/markitup/jquery.markitup.js'));
             $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/markitup/sets/markdown/set.js'));
             $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalPlugin/markitup/skins/markitup/style.css'));
             $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalPlugin/markitup/sets/markdown/style.css'));
         }
         // Load tinymce
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/tiny_mce/tiny_mce.js'));
         // Load the sympal editor js and css
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/editor.js'));
         $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/css/editor.css'));
         // Fancybox
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/fancybox/jquery.fancybox.js'));
         $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalPlugin/fancybox/jquery.fancybox.css'));
         // Shortcuts
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/shortcuts.js'));
         $this->_editorAssetsLoaded = true;
     }
 }
开发者ID:slemoigne,项目名称:sympal,代码行数:30,代码来源:sfSympalEditorPluginConfiguration.class.php

示例2: convertToHtml

 public static function convertToHtml($markdown)
 {
     if ($markdown) {
         sfContext::getInstance()->getResponse()->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalRenderingPlugin/css/markdown.css'));
         return '<div class="sympal_markdown">' . self::enhanceHtml(Markdown($markdown), $markdown) . '</div>';
     }
 }
开发者ID:slemoigne,项目名称:sympal,代码行数:7,代码来源:sfSympalMarkdownRenderer.class.php

示例3: executeIndex

 public function executeIndex()
 {
     $response = $this->getResponse();
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/shortcuts.js'));
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalAdminPlugin/js/shortcuts.js'));
     if (sfSympalConfig::get('check_for_upgrades_on_dashboard', null, false)) {
         $this->upgrade = new sfSympalUpgradeFromWeb($this->getContext()->getConfiguration(), $this->getContext()->getEventDispatcher(), new sfFormatter());
         $this->hasNewVersion = $this->upgrade->hasNewVersion();
     } else {
         $this->hasNewVersion = false;
     }
     $this->dashboardRight = new sfSympalMenu('Sympal Dashboard Right');
     $numUsers = Doctrine_Core::getTable('sfGuardUser')->count();
     $this->dashboardRight->addChild(sprintf('<label>Users</label> %s', $numUsers), '@sympal_users');
     $numSites = Doctrine_Core::getTable('sfSympalSite')->count();
     $this->dashboardRight->addChild(sprintf('<label>Sites</label> %s', $numSites), '@sympal_sites');
     $numContentTypes = Doctrine_Core::getTable('sfSympalContentType')->count();
     $this->dashboardRight->addChild(sprintf('<label>Content Types</label> %s', $numContentTypes), '@sympal_content_types');
     $contentTypes = Doctrine::getTable('sfSympalContentType')->getAllContentTypes();
     foreach ($contentTypes as $contentType) {
         $numPublishedContent = Doctrine_Core::getTable('sfSympalContent')->createQuery('c')->where('c.date_published < NOW()')->andWhere('c.content_type_id = ?', $contentType->getId())->count();
         $this->dashboardRight->addChild(sprintf('<label>Published %s Content</label> %s', $contentType->getLabel(), $numPublishedContent), '@sympal_content_list_type?type=' . $contentType->getId() . '&published=1');
         $numUnPublishedContent = Doctrine_Core::getTable('sfSympalContent')->createQuery('c')->where('c.date_published >= NOW() OR c.date_published IS NULL')->andWhere('c.content_type_id = ?', $contentType->getId())->count();
         $this->dashboardRight->addChild(sprintf('<label>Un-Published %s Content</label> %s', $contentType->getLabel(), $numUnPublishedContent), '@sympal_content_list_type?type=' . $contentType->getId() . '&published=0');
     }
     sfApplicationConfiguration::getActive()->getEventDispatcher()->notify(new sfEvent($this->dashboardRight, 'sympal.load_dashboard_right'));
 }
开发者ID:slemoigne,项目名称:sympal,代码行数:27,代码来源:Basesympal_dashboardActions.class.php

示例4: loadAdminMenuAssets

 public function loadAdminMenuAssets()
 {
     sfSympalToolkit::useJQuery();
     $response = sfContext::getInstance()->getResponse();
     $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalAdminPlugin/css/menu.css'));
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalAdminPlugin/js/menu.js'));
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/shortcuts.js'));
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalAdminPlugin/js/shortcuts.js'));
     $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalPlugin/fancybox/jquery.fancybox.css'));
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/fancybox/jquery.fancybox.js'));
 }
开发者ID:RafalJachimczyk,项目名称:sympal,代码行数:11,代码来源:sfSympalAdminPluginConfiguration.class.php

示例5: executeIndex

 public function executeIndex()
 {
     $response = $this->getResponse();
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/shortcuts.js'));
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalAdminPlugin/js/shortcuts.js'));
     if (sfSympalConfig::get('check_for_upgrades_on_dashboard', null, false)) {
         $this->upgrade = new sfSympalUpgradeFromWeb($this->getContext()->getConfiguration(), $this->getContext()->getEventDispatcher(), new sfFormatter());
         $this->hasNewVersion = $this->upgrade->hasNewVersion();
     } else {
         $this->hasNewVersion = false;
     }
 }
开发者ID:sympal,项目名称:sympal,代码行数:12,代码来源:Basesympal_dashboardActions.class.php

示例6: render

 /**
  * @param  string $name        The element name
  * @param  string $value       The value displayed in this widget
  * @param  array  $attributes  An array of HTML attributes to be merged with the default HTML attributes
  * @param  array  $errors      An array of errors for the field
  *
  * @return string An HTML tag string
  *
  * @see sfWidgetForm
  */
 public function render($name, $value = null, $attributes = array(), $errors = array())
 {
     $this->context = sfContext::getInstance();
     $attributes = array_merge(array('type' => $this->getOption('type'), 'name' => $name, 'value' => $value), $attributes);
     $attributes = $this->fixFormId($attributes);
     $url = $this->context->getRouting()->generate('sympal_assets_select');
     $tag = $this->renderTag('input', $attributes);
     $tag .= $this->includeView();
     $tag .= $this->includeDelete();
     // add
     if (!isset($attributes['load_javascript']) || $attributes['load_javascript'] !== false) {
         $tag .= $this->loadJavascript(array_merge($attributes, array('url' => $url)));
     }
     if (!isset($attributes['load_stylesheet']) || $attributes['load_stylesheet'] !== false) {
         $this->context->getResponse()->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalAssetsPlugin/css/form_widget.css'));
     }
     $tag = $this->wrapTag($tag);
     return $tag;
 }
开发者ID:slemoigne,项目名称:sympal,代码行数:29,代码来源:sfWidgetFormInputMediaBrowser.class.php

示例7: loadEditorAssets

 public function loadEditorAssets()
 {
     if (!$this->_editorAssetsLoaded) {
         $this->configuration->loadHelpers('SympalContentSlotEditor');
         sfSympalToolkit::useJQuery(array('ui'));
         $response = sfContext::getInstance()->getResponse();
         // Load jquery tools/plugins that the inline editor requires
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/jQuery.cookie.js'));
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/jQuery.elastic.js'));
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/jquery.Jcrop.min.js'));
         // Load in the metadata plugin
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/jquery.metadata.js'));
         // Load tinymce
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/tiny_mce/tiny_mce.js'));
         // Load in the UI blocker
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/jquery.blockUI.js'));
         // Load the sympal editor js and css
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/editor.js'));
         $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/css/editor.css'));
         // Load the js and css for the slot editing
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/slot.js'));
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/slotEditor.js'));
         $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/css/slots.css'));
         // Fancybox
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/fancybox/jquery.fancybox.js'));
         $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalPlugin/fancybox/jquery.fancybox.css'));
         // Ajax form submission
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/jQuery.form.js'));
         // Shortcuts
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/shortcuts.js'));
         // Load the individual slot javsascripts
         // @todo The slot type javascript needs to be brought in dynamically
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/slots/markdown.js'));
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/slots/tinymce.js'));
         // Load the core javascript
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/chooser.js'));
         $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/core.js'));
         $this->_editorAssetsLoaded = true;
     }
 }
开发者ID:RafalJachimczyk,项目名称:sympal,代码行数:40,代码来源:sfSympalEditorPluginConfiguration.class.php

示例8: useJavascript

 /**
  * Use the given javascript
  *
  * @param string $javascript 
  * @param string $position 
  * @return void
  */
 public static function useJavascript($javascript, $position = 'last')
 {
     return sfContext::getInstance()->getResponse()->addJavascript(sfSympalConfig::getAssetPath($javascript), $position);
 }
开发者ID:sympal,项目名称:sympal,代码行数:11,代码来源:sfSympalToolkit.class.php

示例9: filterThemeAssetPaths

 /**
  * Listens to the theme.filter_asset_paths event and rewrites all of
  * the assets from themes before outputting them
  */
 public function filterThemeAssetPaths(sfEvent $event, $assets)
 {
     foreach ($assets as $key => $asset) {
         $assets[$key]['file'] = sfSympalConfig::getAssetPath($asset['file']);
     }
     return $assets;
 }
开发者ID:sympal,项目名称:sympal,代码行数:11,代码来源:sfSympalPluginConfiguration.class.php

示例10: sympal_use_stylesheet

/**
 * Helper method for using a Sympal stylesheet file
 *
 * @param string $path 
 * @param string $position 
 * @return void
 */
function sympal_use_stylesheet($path, $position = 'last')
{
    return use_stylesheet(sfSympalConfig::getAssetPath($path), $position);
}
开发者ID:slemoigne,项目名称:sympal,代码行数:11,代码来源:SympalHelper.php

示例11: _loadAdminMenuAssets

 /**
  * Called when the admin menu is loaded.
  * 
  * Supplies all of the css and js needed for the admin menu
  */
 protected function _loadAdminMenuAssets()
 {
     $response = sfContext::getInstance()->getResponse();
     $response->addJavascript(sfSympalConfig::getAssetPath('jquery.js'));
     $response->addStylesheet(sfSympalConfig::getAssetPath('jquery.fancybox.css'));
     $response->addJavascript(sfSympalConfig::getAssetPath('jquery.fancybox.js'));
     $response->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalAdminPlugin/css/floating_menu.css'));
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalAdminPlugin/js/floating_menu.js'));
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalPlugin/js/shortcuts.js'));
     $response->addJavascript(sfSympalConfig::getAssetPath('/sfSympalAdminPlugin/js/shortcuts.js'));
 }
开发者ID:sympal,项目名称:sympal,代码行数:16,代码来源:sfSympalAdminPluginConfiguration.class.php

示例12: removeJavascripts

 public function removeJavascripts()
 {
     foreach ($this->_configuration->getJavascripts() as $javascript) {
         $this->_response->removeJavascript(sfSympalConfig::getAssetPath($javascript));
     }
 }
开发者ID:bmatychowiak,项目名称:sympal,代码行数:6,代码来源:sfSympalTheme.class.php

示例13: javascript_path

<script type="text/javascript" src="<?php 
echo javascript_path(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/links.js'));
?>
"></script>
<link rel="stylesheet" type="text/css" media="screen" href="<?php 
echo stylesheet_path(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/css/links.css'));
?>
" />

<div id="sympal_links_container">
  <h1><?php 
echo __('Link Browser');
?>
</h1>

  <p>
    <?php 
echo __('Browse your content below and insert links into the currently focused editor by ' . 'just clicking the page you want to link to.');
?>
    <?php 
echo __('You can control where the link is inserted by positioning the cursor in the editor.');
?>
  </p>

  <div id="content_types">
    <h2><?php 
echo __('Content Types');
?>
</h2>
    <ul>
      <?php 
开发者ID:sympal,项目名称:sympal,代码行数:31,代码来源:linksSuccess.php


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