Exemplo n.º 1
0
function _a_required_assets()
{
    $response = sfContext::getInstance()->getResponse();
    sfContext::getInstance()->getConfiguration()->loadHelpers(array("Url", "jQuery", "I18N", 'PkDialog'));
    jq_add_plugins_by_name(array("ui"));
    if (sfConfig::get('app_a_use_bundled_stylesheet', true)) {
        // $response->addStylesheet('/apostrophePlugin/css/aToolkit.css', 'first'); // Merged into a.css 2/3/2010
        $response->addStylesheet('/apostrophePlugin/css/a.css', 'first');
    }
    $response->addJavascript('/apostrophePlugin/js/aUI.js');
    $response->addJavascript('/apostrophePlugin/js/aControls.js');
    $response->addJavascript('/apostrophePlugin/js/plugins/jquery.autogrow.js');
    // Autogrowing Textareas
    $response->addJavascript('/apostrophePlugin/js/plugins/jquery.keycodes-0.2.js');
    // keycodes
    $response->addJavascript('/apostrophePlugin/js/plugins/jquery.timer-1.2.js');
    $webDir = sfConfig::get('sf_a_web_dir', '/apostrophePlugin');
    $response->addJavascript("{$webDir}/js/a.js");
}
Exemplo n.º 2
0
function _a_required_assets()
{
    $response = sfContext::getInstance()->getResponse();
    sfContext::getInstance()->getConfiguration()->loadHelpers(array("Url", "jQuery", "I18N", 'PkDialog'));
    jq_add_plugins_by_name(array("ui"));
    if (sfConfig::get('app_a_use_bundled_stylesheet', true)) {
        // $response->addStylesheet('/apostrophePlugin/css/aToolkit.css', 'first'); // Merged into a.css 2/3/2010
        $response->addStylesheet('/apostrophePlugin/css/a.css', 'first');
    }
    $response->addJavascript('/apostrophePlugin/js/aUI.js');
    $response->addJavascript('/apostrophePlugin/js/aControls.js');
    // $response->addJavascript('/apostrophePlugin/js/jquery.hotkeys-0.7.9.min.js'); // this is plugin for hotkey toggle for cms UI // I turned this off because we aren't using it right now 1-8-2010 JB
    $response->addJavascript('/apostrophePlugin/js/jquery.autogrow.js');
    // Autogrowing Textareas
    // $response->addJavascript('/apostrophePlugin/js/jquery.pulse.js'); // Ajax update highlight a color  // I turned this off because we aren't using it right now 1-8-2010 JB
    $response->addJavascript('/apostrophePlugin/js/jquery.keycodes-0.2.js');
    // keycodes
    $response->addJavascript('/apostrophePlugin/js/jquery.timer-1.2.js');
    $webDir = sfConfig::get('sf_a_web_dir', '/apostrophePlugin');
    $response->addJavascript("{$webDir}/js/a.js");
}
 /**
  * Use jQuery in your project
  *
  * @param array $plugins Optional array of jQuery plugins to load
  * @return void
  */
 public static function useJQuery($plugins = array())
 {
     self::loadHelpers('jQuery');
     jq_add_plugins_by_name($plugins);
 }
<?php

slot('title', 'Expertisebank');
use_helper('jQuery');
use_javascript('jqueryui/effects.core.min.js');
use_javascript('jqueryui/effects.highlight.min.js');
use_stylesheet('JqueryAutocomplete');
use_stylesheet('ui-lightness/jquery-ui-1.7.2.custom.css');
jq_add_plugins_by_name(array('autocomplete'));
if ($sf_user->hasCredential('expertbank')) {
    include_component('user', 'adminBar', array('actions' => array(array('id' => 'list', 'link' => url_for('@backend.expert_expertbank')))));
}
?>

<div class="infobox">
	<div class="content">
		<h1>Expertisebank</h1>
		<p>De expertisebank is bedoelt als plaats waar leerlingen, leraren en ouders hun expertise kenbaar kunnen maken aan de rest van leergemeenschap. Zo kunnen leerlingen of de school beroep doen op de kennis en expertise van mensen.</p>
	</div>
</div>

<ul class="expertbank">
	<?php 
foreach ($expert_list as $expert) {
    ?>
	<li class="clickable">
		<p class="right">
			<img src="/images/icons/email.png" alt="toevoegen" />
			<?php 
    echo link_to('Kom in contact &raquo;', sprintf('@expertbank_show?id=%s&name_slug=%s&profession_slug=%s', $expert->getId(), $expert->getNameSlug(), $expert->getProfessionSlug()));
    ?>
Exemplo n.º 5
0
/**
 * Makes the element with the DOM ID specified by '$element_id' receive
 * dropped draggable elements (created by 'draggable_element()') and make an AJAX call.
 * By default, the action called gets the DOM ID of the element as parameter.
 *
 * Example:
 *   <?php drop_receiving_element('my_cart', array(
 *      'url' => 'cart/add',
 *   )) ?>
 *
 * You can change the behaviour with various options, see
 * http://script.aculo.us for more documentation.
 */
function jq_drop_receiving_element($selector, $options = array())
{
    jq_add_plugins_by_name(array("ui"));
    if (!isset($options['with'])) {
        $options['with'] = "'id=' + encodeURIComponent(element.id)";
    }
    if (!isset($options['drop'])) {
        $options['drop'] = "function(element){" . jq_remote_function($options) . "}";
    }
    // For backwards compatibility with prototype
    if (isset($options['hoverclass'])) {
        $options['hoverClass'] = $options['hoverclass'];
    }
    $options['hoverClass'] = json_encode('hoverclass');
    foreach (jq_get_ajax_options() as $key) {
        unset($options[$key]);
    }
    if (isset($options['accept'])) {
        $options['accept'] = json_encode($options['accept']);
    }
    $options = jq_options_for_javascript($options);
    $selector = json_encode($selector);
    return javascript_tag("jQuery({$selector}).droppable({$options});");
}