3a4,10 > /** > * @file > * > * swfaddress module is a good way to integrate flash to drupal > * > */ > 8c15 < * Implementation of hook_init() --- > * Implementation of hook_init(). 18c25 < $path = substr($path, strpos($path, '&') + 1); --- > $path = drupal_substr($path, strpos($path, '&') + 1); 39c46,47 < } else { --- > } > else { 43a52,73 > > //not may_cache comes here > if (variable_get('swfaddress_replacement_enabled', FALSE) > && variable_get('clean_url', 0) == 1 > && _swfaddress_path_permitted()) { > // It is vitally important that swfobject.js be included before SWFAddress! > drupal_add_js(drupal_get_path('module', 'swfaddress') .'/swfobject/swfobject.js', 'module'); > drupal_add_js(drupal_get_path('module', 'swfaddress') .'/swfaddress-2.1/js/swfaddress.js', 'module'); > drupal_add_js(drupal_get_path('module', 'swfaddress') . _swfaddress_optimizer('/swfaddress-2.1/js/swfaddress-optimizer.js?'), 'module'); > > drupal_add_js(theme('swfaddress_swfobject', > variable_get('swfaddress_swf_address', ''), > variable_get('swfaddress_flash_tag_id', 'swf-embed'), > variable_get('swfaddress_flash_width', 550), > variable_get('swfaddress_flash_height', 400), > variable_get('swfaddress_flash_version', '9.0.0'), > variable_get('swfaddress_flash_background', 'FFFFFF'), > variable_get('swfaddress_flash_replace_id', 'swf-replace') > ), 'inline', 'header'); > } > > 47c77 < * Implementation of hook_requirements() --- > * Implementation of hook_requirements(). 84c114 < function swfaddress_help($section='') { --- > function swfaddress_help($path="", $arg=array()) { 87c117 < switch ($section) { --- > switch ($path) { 107a138,145 > function swfaddress_theme() { > return array( > 'swfaddress_swfobject' => array( > 'arguments' => array('swf_address' => NULL, 'flash_tag_id' => NULL, 'flash_width' => NULL, 'flash_height' => NULL, 'flash_version' => NULL, 'flash_background' => NULL, 'flash_replace_id' => NULL) > ), > ); > } > 111c149 < function swfaddress_menu($may_cache) { --- > function swfaddress_menu() { 113,141c151,158 < if ($may_cache) { < $items[] = array('path' => 'admin/settings/swfaddress', < 'title' => t('SWFAddress Settings'), < 'description' => t('Configure SWFAddress settings.'), < 'access' => user_access('administer swfaddress'), < 'callback' => 'drupal_get_form', < 'callback arguments' => 'swfaddress_admin_form', < 'type' => MENU_NORMAL_ITEM); < } < else { < if (variable_get('swfaddress_replacement_enabled', FALSE) < && variable_get('clean_url', 0) == 1 < && _swfaddress_path_permitted()) { < // It is vitally important that swfobject.js be included before SWFAddress! < drupal_add_js(drupal_get_path('module', 'swfaddress') .'/swfobject/swfobject.js', 'module'); < drupal_add_js(drupal_get_path('module', 'swfaddress') .'/swfaddress-2.1/js/swfaddress.js', 'module'); < drupal_add_js(drupal_get_path('module', 'swfaddress') . _swfaddress_optimizer('/swfaddress-2.1/js/swfaddress-optimizer.js?'), 'module'); < < drupal_add_js(theme('swfaddress_swfobject', < variable_get('swfaddress_swf_address', ''), < variable_get('swfaddress_flash_tag_id', 'swf-embed'), < variable_get('swfaddress_flash_width', 550), < variable_get('swfaddress_flash_height', 400), < variable_get('swfaddress_flash_version', '9.0.0'), < variable_get('swfaddress_flash_background', 'FFFFFF'), < variable_get('swfaddress_flash_replace_id', 'swf-replace') < ), 'inline', 'header'); < } < } --- > $items['admin/settings/swfaddress'] = array( > 'title' => 'SWFAddress Settings', > 'description' => 'Configure SWFAddress settings.', > 'access arguments' => array('administer swfaddress'), > 'page callback' => 'drupal_get_form', > 'page arguments' => array('swfaddress_admin_form'), > 'type' => MENU_NORMAL_ITEM); > 303c320 < '#field_prefix' => url(NULL, NULL, NULL, TRUE) . (variable_get('clean_url', 0) ? '' : '?q=') --- > '#field_prefix' => url("", array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=') 330,331c347,349 < function swfaddress_admin_form_validate($form_id, $form_values) { < if (preg_match('/^([0-9]{1,5}[%]?)$/', $form_values['swfaddress_flash_width']) === 0) { --- > function swfaddress_admin_form_validate($form, &$form_state) { > print_r($form_state); > if (preg_match('/^([0-9]{1,5}[%]?)$/', $form_state['swfaddress_flash_width'])) { 335c353 < if (preg_match('/^([0-9]{1,5}[%]?)$/', $form_values['swfaddress_flash_height']) === 0) { --- > if (preg_match('/^([0-9]{1,5}[%]?)$/', $form_state['swfaddress_flash_height'])) { 339c357 < if (preg_match('/^([a-fA-F0-9]){6}$/', $form_values['swfaddress_flash_background']) === 0) { --- > if (preg_match('/^([a-fA-F0-9]){6}$/', $form_state['swfaddress_flash_background'])) { 343c361 < if (preg_match('/[^a-zA-Z0-9]+/', $form_values['swfaddress_flash_tag_id']) !== 0) { --- > if (preg_match('/[^a-zA-Z0-9]+/', $form_state['swfaddress_flash_tag_id']) !== 0) { 355c373 < return $resource . (strstr($resource, '?') ? '' : '?') . 'swfaddress=' . urlencode($path) . '&base=' . urlencode($base) . '&flash=' . variable_get('swfaddress_flash_version', '9.0.0'); --- > return $resource . (strstr($resource, '?') ? '' : '?') . 'swfaddress=' . urlencode($path) . '&base=' . urlencode($base) . '&flash=' . variable_get('swfaddress_flash_version', '9.0.0'); 364c382,384 < swfobject.embedSWF('%s%s', '%s', '%s', '%s', '%s', false, {}, {bgcolor: '#%s'}, {id: '%s'}); --- > $(document).ready(function(){ > swfobject.embedSWF("%s%s", "%s", "%s", "%s", "%s", false, {}, {bgcolor: "#%s"}, {id: "%s"}); > }); 369a390,391 > > ?>