Beispiel #1
0
/**
 * wrapper for script.aculo.us/prototype Ajax.InPlaceEditor.
 * @param string name id of field that can be edited
 * @param string url of module/action to be called when ok is clicked
 * @param array editor tag options. (rows, cols, highlightcolor, highlightendcolor, etc...)
 *
 * @return string javascript to manipulate the id field to allow click and edit functionality
 */
function input_in_place_editor_tag($name, $url, $editor_options = array())
{
    $response = sfContext::getInstance()->getResponse();
    $response->addJavascript(sfConfig::get('sf_prototype_web_dir') . '/js/prototype');
    $response->addJavascript(sfConfig::get('sf_prototype_web_dir') . '/js/effects');
    $response->addJavascript(sfConfig::get('sf_prototype_web_dir') . '/js/controls');
    $editor_options = _convert_options($editor_options);
    $default_options = array('tag' => 'span', 'id' => '\'' . $name . '_in_place_editor', 'class' => 'in_place_editor_field');
    return _in_place_editor($name, $url, array_merge($default_options, $editor_options));
}
/**
 * wrapper for script.aculo.us/prototype Ajax.InPlaceEditor.
 * @param string name id of field that can be edited
 * @param string url of module/action to be called when ok is clicked
 * @param array editor tag options. (rows, cols, highlightcolor, highlightendcolor, etc...)
 *
 * @return string javascript to manipulate the id field to allow click and edit functionality
 */
function input_in_place_editor_tag($name, $url, $editor_options = array())
{
    $response = sfContext::getInstance()->getResponse();
    $response->addJavascript(sfConfig::get('sf_prototype_web_dir') . '/js/prototype');
    $response->addJavascript(sfConfig::get('sf_prototype_web_dir') . '/js/effects');
    $response->addJavascript(sfConfig::get('sf_prototype_web_dir') . '/js/controls');
    $editor_options = _convert_options($editor_options);
    return _in_place_editor($name, $url, $editor_options);
}
function input_in_place_editor_tag($name, $url, $editor_options = array())
{
    $obj =& get_instance();
    $obj->response->enqueue_js(array('prototype', 'controls', 'effects'));
    $editor_options = _convert_options($editor_options);
    $default_options = array('tag' => 'span', 'id' => '\'' . $name . '_in_place_editor', 'class' => 'in_place_editor_field');
    return _in_place_editor($name, $url, array_merge($default_options, $editor_options));
}