Development

Changeset 1464

You must first sign up to be able to contribute.

Changeset 1464

Show
Ignore:
Timestamp:
06/16/06 16:30:25 (2 years ago)
Author:
slickrick
Message:

* Updating branch to trunk at r1463

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/slickrick/data/tasks/sfPakeGenerator.php

    r1450 r1464  
    106106  $sf_root_dir = sfConfig::get('sf_root_dir'); 
    107107 
     108  if (is_readable(sfConfig::get('sf_data_dir').'/skeleton/module')) 
     109  { 
     110    $sf_skeleton_dir = sfConfig::get('sf_data_dir').'/skeleton/module'; 
     111  } 
     112  else 
     113  { 
     114    $sf_skeleton_dir = sfConfig::get('sf_symfony_data_dir').'/skeleton/module'; 
     115  } 
     116 
    108117  // create basic application structure 
    109118  $finder = pakeFinder::type('any')->prune('.svn')->discard('.svn', '.sf'); 
    110   pake_mirror($finder, sfConfig::get('sf_symfony_data_dir').'/skeleton/module/module/', $sf_root_dir.'/'.sfConfig::get('sf_apps_dir_name').'/'.$app.'/'.sfConfig::get('sf_app_module_dir_name').'/'.$module); 
     119  pake_mirror($finder, $sf_skeleton_dir.'/module/', $sf_root_dir.'/'.sfConfig::get('sf_apps_dir_name').'/'.$app.'/'.sfConfig::get('sf_app_module_dir_name').'/'.$module); 
    111120 
    112121  // create basic test 
    113   pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/module/test/actionsTest.php', $sf_root_dir.'/test/'.$app.'/'.$module.'ActionsTest.php'); 
     122  pake_copy($sf_skeleton_dir.'/test/actionsTest.php', $sf_root_dir.'/test/'.$app.'/'.$module.'ActionsTest.php'); 
    114123 
    115124  // customize test file 
  • branches/slickrick/data/web/sf/js/calendar/lang/calendar-no.js

    r500 r1464  
    4343 "Lør", 
    4444 "Søn"); 
     45 
     46// First day of the week. "0" means display Sunday first, "1" means display 
     47// Monday first, etc. 
     48Calendar._FD = 0; 
    4549 
    4650// full month names 
     
    104108Calendar._TT["MON_FIRST"] = "Vis mandag først"; 
    105109Calendar._TT["SUN_FIRST"] = "Vis søndag først"; 
     110 
     111// the following is to inform that "%s" is to be the first day of week 
     112// %s will be replaced with the day name. 
     113Calendar._TT["DAY_FIRST"] = "Vis %s først"; 
     114 
     115// This may be locale-dependent.  It specifies the week-end days, as an array 
     116// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1 
     117// means Monday, etc. 
     118Calendar._TT["WEEKEND"] = "0"; 
     119 
    106120Calendar._TT["CLOSE"] = "Lukk"; 
    107121Calendar._TT["TODAY"] = "Idag"; 
     
    113127 
    114128Calendar._TT["WK"] = "uke"; 
     129Calendar._TT["TIME"] = "Tid:"; 
  • branches/slickrick/lib/config/sfViewConfigHandler.class.php

    r1450 r1464  
    226226    foreach ($this->mergeConfigValue('http_metas', $viewName) as $httpequiv => $content) 
    227227    { 
    228       $data[] = sprintf("    \$response->addHttpMeta('%s', '%s', false);", $httpequiv, $content); 
     228      $data[] = sprintf("    \$response->addHttpMeta('%s', '%s', false);", $httpequiv, str_replace('\'', '\\\'', $content)); 
    229229    } 
    230230 
    231231    foreach ($this->mergeConfigValue('metas', $viewName) as $name => $content) 
    232232    { 
    233       $data[] = sprintf("    \$response->addMeta('%s', '%s', false);", $name, $content); 
     233      $data[] = sprintf("    \$response->addMeta('%s', '%s', false);", $name, str_replace('\'', '\\\'', $content)); 
    234234    } 
    235235 
     
    243243    $delete = array(); 
    244244    $delete_all = false; 
    245      
     245 
    246246    // Populate $stylesheets with the values from ONLY the current view 
    247247    $stylesheets = $this->getConfigValue('stylesheets', $viewName); 
    248      
     248 
    249249    // If we find results from the view, check to see if there is a '-*' 
    250250    // This indicates that we will remove ALL stylesheets EXCEPT for those passed in the current view 
    251   if (is_array($stylesheets) AND in_array('-*', $stylesheets)) 
    252   { 
    253     $delete_all = true; 
    254     foreach ($stylesheets as $stylesheet) 
    255     { 
    256       $key = is_array($stylesheet) ? key($stylesheet) : $stylesheet; 
    257        
    258       if ($key != '-*') 
    259       { 
    260         $omit[] = $key; 
    261       } 
    262     } 
    263   } 
    264    
    265   // If '-*' is not found and there are items in the current view's stylesheet array 
    266   // loop through each one and see if there are any values that start with '-'. 
    267   // If so, we add store the actual stylesheet name to the $delete array to be used below 
    268   else 
    269   { 
    270     foreach ($stylesheets as $stylesheet) 
    271     { 
    272       if (!is_array($stylesheet)) 
    273       { 
    274         if (substr($stylesheet, 0, 1) == '-') 
    275         { 
    276         $delete[] = substr($stylesheet, 1); 
    277         } 
    278       } 
    279     } 
    280   } 
     251    if (is_array($stylesheets) AND in_array('-*', $stylesheets)) 
     252    { 
     253      $delete_all = true; 
     254      foreach ($stylesheets as $stylesheet) 
     255      { 
     256        $key = is_array($stylesheet) ? key($stylesheet) : $stylesheet; 
     257 
     258        if ($key != '-*') 
     259        { 
     260          $omit[] = $key; 
     261        } 
     262      } 
     263    } 
     264    else 
     265    { 
     266      // If '-*' is not found and there are items in the current view's stylesheet array 
     267      // loop through each one and see if there are any values that start with '-'. 
     268      // If so, we add store the actual stylesheet name to the $delete array to be used below 
     269      foreach ($stylesheets as $stylesheet) 
     270      { 
     271        if (!is_array($stylesheet)) 
     272        { 
     273          if (substr($stylesheet, 0, 1) == '-') 
     274          { 
     275          $delete[] = substr($stylesheet, 1); 
     276          } 
     277        } 
     278      } 
     279    } 
    281280 
    282281    // Merge the current view's stylesheets with the app's default stylesheets 
    283282    $stylesheets = $this->mergeConfigValue('stylesheets', $viewName); 
    284283    if (is_array($stylesheets)) 
    285     {       
    286       // Loop through each stylesheet in the merged array      
     284    { 
     285      // Loop through each stylesheet in the merged array 
    287286      foreach ($stylesheets as $index => $stylesheet) 
    288287      { 
    289288        $key = is_array($stylesheet) ? key($stylesheet) : $stylesheet; 
    290          
     289 
    291290        // If $delete_all is true, a '-*' was found above. 
    292291        // We remove all stylesheets from the array EXCEPT those specified in the $omit array 
    293292        if ($delete_all == true) 
    294293        { 
    295            if (!in_array($key, $omit)) 
    296            { 
    297              unset($stylesheets[$index]); 
    298            } 
     294          if (!in_array($key, $omit)) 
     295          { 
     296            unset($stylesheets[$index]); 
     297          } 
    299298        } 
    300299        else 
     
    306305            if ($key == $value OR substr($key, 1) == $value) 
    307306            { 
    308             unset($stylesheets[$index]); 
     307              unset($stylesheets[$index]); 
    309308            } 
    310309          } 
     
    338337    } 
    339338 
    340      
    341339    $omit = array(); 
    342340    $delete_all = false; 
    343      
     341 
    344342    // Populate $javascripts with the values from ONLY the current view 
    345343    $javascripts = $this->getConfigValue('javascripts', $viewName); 
    346      
     344 
    347345    // If we find results from the view, check to see if there is a '-*' 
    348346    // This indicates that we will remove ALL javascripts EXCEPT for those passed in the current view 
    349  if (is_array($javascripts) AND in_array('-*', $javascripts)) 
    350 
    351    $delete_all = true; 
    352    foreach ($javascripts as $javascript) 
    353     {      
    354      if (substr($javascript, 0, 1) != '-') 
    355      { 
    356        $omit[] = $javascript; 
    357      } 
    358    } 
    359   }     
    360      
     347    if (is_array($javascripts) AND in_array('-*', $javascripts)) 
     348   
     349      $delete_all = true; 
     350      foreach ($javascripts as $javascript) 
     351      {      
     352        if (substr($javascript, 0, 1) != '-') 
     353        { 
     354          $omit[] = $javascript; 
     355        } 
     356      } 
     357    } 
     358 
    361359    $javascripts = $this->mergeConfigValue('javascripts', $viewName); 
    362360    if (is_array($javascripts)) 
     
    365363      // We exclude any javascripts that were omitted above 
    366364      $delete = array(); 
    367        
     365 
    368366      foreach ($javascripts as $javascript) 
    369367      { 
  • branches/slickrick/lib/debug/sfWebDebug.class.php

    r1450 r1464  
    236236    { 
    237237      $self_url = $_SERVER['PHP_SELF'].((strpos($_SERVER['PHP_SELF'], 'sf_ignore_cache') === false) ? '?sf_ignore_cache=1' : ''); 
    238       $cacheLink = '<a href="'.$self_url.'" title="reload and ignore cache"><img src="'.$this->base_image_path.'/reload.png" /></a>'; 
     238      $cacheLink = '<a href="'.$self_url.'" title="reload and ignore cache"><img src="'.$this->base_image_path.'/reload.png" alt=""/></a>'; 
    239239    } 
    240240 
     
    243243    if (sfConfig::get('sf_logging_active')) 
    244244    { 
    245       $logLink = '<li><a href="#" onclick="document.getElementById(\'sfWebDebugConfig\').style.display=\'none\';document.getElementById(\'sfWebDebugDatabaseDetails\').style.display=\'none\';sfWebDebugToggle(\'sfWebDebugLog\'); return false;"><img src="'.$this->base_image_path.'/comment.png" /> logs &amp; msgs</a></li>'; 
     245      $logLink = '<li><a href="#" onclick="document.getElementById(\'sfWebDebugConfig\').style.display=\'none\';document.getElementById(\'sfWebDebugDatabaseDetails\').style.display=\'none\';sfWebDebugToggle(\'sfWebDebugLog\'); return false;"><img src="'.$this->base_image_path.'/comment.png" alt=""/> logs &amp; msgs</a></li>'; 
    246246    } 
    247247 
     
    251251    if (null !== ($nb = $this->getDatabaseRequestNumber())) 
    252252    { 
    253       $dbInfo = '<li><a href="#" onclick="document.getElementById(\'sfWebDebugConfig\').style.display=\'none\';document.getElementById(\'sfWebDebugLog\').style.display=\'none\';sfWebDebugToggle(\'sfWebDebugDatabaseDetails\'); return false;"><img src="'.$this->base_image_path.'/database.png" /> '.$nb.'</a></li>'; 
     253      $dbInfo = '<li><a href="#" onclick="document.getElementById(\'sfWebDebugConfig\').style.display=\'none\';document.getElementById(\'sfWebDebugLog\').style.display=\'none\';sfWebDebugToggle(\'sfWebDebugDatabaseDetails\'); return false;"><img src="'.$this->base_image_path.'/database.png" alt=""/> '.$nb.'</a></li>'; 
    254254 
    255255      $dbInfoDetails = ' 
     
    265265    { 
    266266      $total_memory = sprintf('%.1f', (memory_get_usage() / 1024)); 
    267       $memoryInfo = '<li><img src="'.$this->base_image_path.'/memory.png" /> '.$total_memory.' KB</li>'; 
     267      $memoryInfo = '<li><img src="'.$this->base_image_path.'/memory.png" alt=""/> '.$total_memory.' KB</li>'; 
    268268    } 
    269269 
     
    274274      $total_time = (microtime(true) - sfConfig::get('sf_timer_start')) * 1000; 
    275275      $total_time = sprintf(($total_time <= 1) ? '%.2f' : '%.0f', $total_time); 
    276       $timeInfo = '<li class="last"><img src="'.$this->base_image_path.'/time.png" /> '.$total_time.' ms</li>'; 
     276      $timeInfo = '<li class="last"><img src="'.$this->base_image_path.'/time.png" alt="" /> '.$total_time.' ms</li>'; 
    277277    } 
    278278 
     
    292292          <li><a href="#" onclick="sfWebDebugToggleAllLogLines(true, \'sfWebDebugLogLine\'); return false;">[all]</a></li> 
    293293          <li><a href="#" onclick="sfWebDebugToggleAllLogLines(false, \'sfWebDebugLogLine\'); return false;">[none]</a></li> 
    294           <li><a href="#" onclick="sfWebDebugShowOnlyLogLines(\'info\'); return false;"><img src="'.$this->base_image_path.'/info.png" /></a></li> 
    295           <li><a href="#" onclick="sfWebDebugShowOnlyLogLines(\'warning\'); return false;"><img src="'.$this->base_image_path.'/warning.png" /></a></li> 
    296           <li><a href="#" onclick="sfWebDebugShowOnlyLogLines(\'error\'); return false;"><img src="'.$this->base_image_path.'/error.png" /></a></li> 
     294          <li><a href="#" onclick="sfWebDebugShowOnlyLogLines(\'info\'); return false;"><img src="'.$this->base_image_path.'/info.png" alt="" /></a></li> 
     295          <li><a href="#" onclick="sfWebDebugShowOnlyLogLines(\'warning\'); return false;"><img src="'.$this->base_image_path.'/warning.png" alt="" /></a></li> 
     296          <li><a href="#" onclick="sfWebDebugShowOnlyLogLines(\'error\'); return false;"><img src="'.$this->base_image_path.'/error.png" alt="" /></a></li> 
    297297          <li>'.implode("</li>\n<li>", $types).'</li> 
    298298        </ul> 
     
    304304    <div id="sfWebDebug"> 
    305305      <div id="sfWebDebugBar" class="sfWebDebug'.ucfirst($max_priority).'"> 
    306         <a href="#" onclick="sfWebDebugToggleMenu(); return false;"><img src="'.$this->base_image_path.'/sf.png" /></a> 
     306        <a href="#" onclick="sfWebDebugToggleMenu(); return false;"><img src="'.$this->base_image_path.'/sf.png" alt="" /></a> 
    307307        <ul id="sfWebDebugDetails" class="menu"> 
    308           <li><a href="#" onclick="document.getElementById(\'sfWebDebugLog\').style.display=\'none\';document.getElementById(\'sfWebDebugDatabaseDetails\').style.display=\'none\';sfWebDebugToggle(\'sfWebDebugConfig\'); return false;"><img src="'.$this->base_image_path.'/config.png" /> vars &amp; config</a></li> 
     308          <li><a href="#" onclick="document.getElementById(\'sfWebDebugLog\').style.display=\'none\';document.getElementById(\'sfWebDebugDatabaseDetails\').style.display=\'none\';sfWebDebugToggle(\'sfWebDebugConfig\'); return false;"><img src="'.$this->base_image_path.'/config.png" alt="" /> vars &amp; config</a></li> 
    309309          '.$cacheLink.' 
    310310          '.$logLink.' 
     
    313313          '.$timeInfo.' 
    314314        </ul> 
    315         <a href="#" onclick="document.getElementById(\'sfWebDebug\').style.display=\'none\'; return false;"><img src="'.$this->base_image_path.'/close.png" /></a> 
     315        <a href="#" onclick="document.getElementById(\'sfWebDebug\').style.display=\'none\'; return false;"><img src="'.$this->base_image_path.'/close.png" alt="" /></a> 
    316316      </div> 
    317317 
     
    372372    $id = ucfirst(strtolower($id)); 
    373373    $content = ' 
    374     <h2>'.$id.' <a href="#" onclick="sfWebDebugToggle(\'sfWebDebug'.$id.'\'); return false;"><img src="'.$this->base_image_path.'/toggle.gif" /></a></h2> 
    375     <div id="sfWebDebug'.$id.'" style="display: none"><pre>'.@sfYaml::Dump($values).'</pre></div> 
     374    <h2>'.$id.' <a href="#" onclick="sfWebDebugToggle(\'sfWebDebug'.$id.'\'); return false;"><img src="'.$this->base_image_path.'/toggle.gif" alt="" /></a></h2> 
     375    <div id="sfWebDebug'.$id.'" style="display: none"><pre>'.htmlentities(@sfYaml::Dump($values)).'</pre></div> 
    376376    '; 
    377377 
  • branches/slickrick/lib/filter/sfExecutionFilter.class.php

    r1450 r1464  
    7878        $validated = true; 
    7979 
     80        // get the current action validation configuration 
     81        $validationConfig = $moduleName.'/'.sfConfig::get('sf_app_module_validate_dir_name').'/'.$actionName.'.yml'; 
     82        if (is_readable(sfConfig::get('sf_app_module_dir').'/'.$validationConfig)) 
     83        { 
     84          // load validation configuration 
     85          // do NOT use require_once 
     86          require(sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name').'/'.$validationConfig)); 
     87        } 
     88 
     89        // manually load validators 
     90        $actionInstance->registerValidators($validatorManager); 
     91 
     92        // process validators 
     93        $validated = $validatorManager->execute(); 
     94 
    8095        // process manual validation 
    8196        $validateToRun = 'validate'.ucfirst($actionName); 
    82         $validated = method_exists($actionInstance, $validateToRun) ? $actionInstance->$validateToRun() : $actionInstance->validate(); 
    83  
    84         if ($validated) 
    85         { 
    86           // get the current action validation configuration 
    87           $validationConfig = $moduleName.'/'.sfConfig::get('sf_app_module_validate_dir_name').'/'.$actionName.'.yml'; 
    88           if (is_readable(sfConfig::get('sf_app_module_dir').'/'.$validationConfig)) 
    89           { 
    90             // load validation configuration 
    91             // do NOT use require_once 
    92             require(sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name').'/'.$validationConfig)); 
    93           } 
    94  
    95           // manually load validators 
    96           $actionInstance->registerValidators($validatorManager); 
    97  
    98           // process validators 
    99           $validated = $validatorManager->execute(); 
    100         } 
     97        $manualValidated = method_exists($actionInstance, $validateToRun) ? $actionInstance->$validateToRun() : $actionInstance->validate(); 
     98 
     99        // action is validated only if both validators returned true 
     100        $validated = !$context->getRequest()->hasErrors(); 
    101101 
    102102        $sf_logging_active = sfConfig::get('sf_logging_active'); 
  • branches/slickrick/lib/filter/sfWebDebugFilter.class.php

    r1450 r1464  
    5656      if ( 
    5757          $this->getContext()->getRequest()->isXmlHttpRequest() ||  
    58           strpos($response->getContentType(), 'text/html') === false || 
     58          strpos($response->getContentType(), 'html') === false || 
    5959          $response->getStatusCode() == 304 
    6060      ) 
  • branches/slickrick/lib/generator/sfGenerator.class.php

    r1450 r1464  
    5656    { 
    5757      // eval template file 
    58       $template_template = $template_dir.'/templates/'.$template.'.php'
     58      $template_template = $template_dir.'/templates/'.$template
    5959      if (!is_readable($template_template)) 
    6060      { 
    61         $template_template = $default_template_dir.'/templates/'.$template.'.php'
     61        $template_template = $default_template_dir.'/templates/'.$template
    6262        if (!is_readable($template_template)) 
    6363        { 
     
    6969 
    7070      // save actions class 
    71       $this->getGeneratorManager()->getCache()->set($template.'.php', $generatedModuleName.DIRECTORY_SEPARATOR.'templates', $retval); 
     71      $this->getGeneratorManager()->getCache()->set($template, $generatedModuleName.DIRECTORY_SEPARATOR.'templates', $retval); 
    7272    } 
    7373  } 
  • branches/slickrick/lib/generator/sfPropelAdminGenerator.class.php

    r1450 r1464  
    7272    // theme exists? 
    7373    $theme = isset($this->params['theme']) ? $this->params['theme'] : 'default'; 
    74     if (!is_dir(sfConfig::get('sf_symfony_data_dir').'/generator/sfPropelAdmin/'.$theme.'/template')) 
     74    $themeDir = sfConfig::get('sf_symfony_data_dir').'/generator/sfPropelAdmin/'.$theme.'/template'; 
     75    if (!is_dir($themeDir)) 
    7576    { 
    7677      $error = 'The theme "%s" does not exist.'; 
     
    8081 
    8182    $this->setTheme($theme); 
    82     $templateFiles = array( 
    83       'listSuccess', 'editSuccess', '_filters',  
    84       '_list_th_'.$this->getParameterValue('list.layout', 'tabular'), '_list_td_'.$this->getParameterValue('list.layout', 'tabular'), 
    85       '_list_th_tabular', 
    86       '_list_header', '_edit_header', '_list_footer', '_edit_footer', 
    87       '_list_td_actions', '_list_actions', '_edit_actions', 
    88     ); 
     83 
     84    $templateFiles = sfFinder::type('file')->name('*.php')->relative()->in($themeDir.'/templates'); 
    8985    $this->generatePhpFiles($this->generatedModuleName, $templateFiles); 
    9086 
  • branches/slickrick/lib/generator/sfPropelCrudGenerator.class.php

    r1450 r1464  
    8383 
    8484    $this->setTheme($theme); 
    85     $this->generatePhpFiles($this->generatedModuleName, array('listSuccess', 'editSuccess', 'showSuccess')); 
     85    $this->generatePhpFiles($this->generatedModuleName, array('listSuccess.php', 'editSuccess.php', 'showSuccess.php')); 
    8686 
    8787    // require generated action class 
  • branches/slickrick/lib/helper/DebugHelper.php

    r1450 r1464  
    1111function log_message($message, $priority = 'info') 
    1212{ 
    13   sfContext::getInstance()->getLogger()->log($message, constant('SF_PEAR_LOG_'.strtoupper($priority))); 
     13  if (sfConfig::get('sf_logging_active')) 
     14  { 
     15    sfContext::getInstance()->getLogger()->log($message, constant('SF_PEAR_LOG_'.strtoupper($priority))); 
     16  } 
    1417} 
  • branches/slickrick/lib/helper/FormHelper.php

    r1449 r1464  
    493493});'; 
    494494 
     495    if (isset($options['tinymce_options'])) 
     496    { 
     497      unset($options['tinymce_options']); 
     498    } 
     499 
    495500    return 
    496501      content_tag('script', javascript_cdata_section($tinymce_js), array('type' => 'text/javascript')). 
  • branches/slickrick/lib/vendor/propel/util/BasePeer.php

    r1344 r1464  
    833833        .($selectModifiers ? implode(" ", $selectModifiers) . " " : "") 
    834834        .implode(", ", $selectClause) 
    835         ." FROM ".(count($fromClause) > 1 ? "(".implode(", ", $fromClause).")" : implode(", ", $fromClause)) 
     835        ." FROM ".((substr(get_class($db), 0, 7) == 'DBMySQL') ? (count($fromClause) > 1 ? "(".implode(", ", $fromClause).")" : implode(", ", $fromClause)) : implode(", ", $fromClause)) 
    836836                .($joinClause ? ' ' . implode(' ', $joinClause) : '') 
    837837        .($whereClause ? " WHERE ".implode(" AND ", $whereClause) : "")