Development

Changeset 22786

You must first sign up to be able to contribute.

Changeset 22786

Show
Ignore:
Timestamp:
10/05/09 13:15:27 (4 years ago)
Author:
ornicar2
Message:

[Diem] fixed admin sort interface,
removed all hardcoded context creations : it allows to change the sfContext class,
removed some internal admin modules for performance boost on routing factory,
improved admin interface with titles on each link,
improved admin search design,
added canAccessToModule method to dmAdminUser,
admin list links to another module now check if user can access the module,
improved admin list associations and foreigns,
tweaked admin stylesheets for better usability,
made doctrine page_schema more explicit,
added french translations,
module manager config handler now checks if a module is declared twice,
dmFrontWebController now generates redirection url before firing event : fix page sync bug,
improved performances on doctrine pager by caching results,
added isMarkdownColumn on dmDoctrineTable to check if a column is a markdown text,
removed automatic anchor from form actions,
added unMarkdown helper to convert a markdown text to a simple text,
improved performances in DmLayout? model and DmPage? table,
fixed a bug on page record cache,
made dmStylesheetCompressor fixCssPaths method public to allow actions to use it,
great performance boost on search engine population by optimizing queries,
added more logs to search engine population,
skipped thumbnails creation in a search engine population context,
fixed broken jquery ui style on front edition,
made ui tabs, ui resizable, markdown javascript and stylesheets loaded on demand on front edition to reduce page load time,
fixed bug on widget text view,
improved performances on front link tag page, and disabled current or parent detection on search engine population context,
and many other little improvements and bugfixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/diemPlugin/trunk/dmAdminPlugin/config/dm/modules.yml

    r22551 r22786  
    22  Configuration: 
    33    dmConfigPanel: 
    4       name:         Configuration panel | Configuration panel 
     4      name:         Configuration panel 
    55      credentials:  config_panel 
    66  Translation: 
     
    1515  Logs: 
    1616    dmUserLog: 
    17       name:         User log | User log 
     17      name:         User log 
    1818      credentials:  user_log 
    1919    dmActionLog: 
    20       name:         Action log | Action log 
     20      name:         Action log 
    2121      credentials:  action_log 
    2222  Accessibility: 
     
    3131      name:         Media 
    3232      credentials:  media_library 
     33  "Search engine": 
     34    dmSearchEngine: 
     35      name:         Manage index 
     36      credentials:  search_engine 
    3337   
    3438Seo: 
     
    4246  Sitemap: 
    4347    dmSitemap: 
    44       name:         Generate sitemap|Generate sitemap 
     48      name:         Generate sitemap 
    4549      credentials:  sitemap 
    4650  Metas: 
     
    8589  Dev: 
    8690    dmDiagram: 
    87       name:         "See diagrams | See diagrams" 
     91      name:         See diagrams 
    8892      credentials:  system 
    8993    dmCodeEditor: 
    90       name:         "Code Editor | Code Editor" 
     94      name:         Code Editor 
    9195      credentials:  code_editor 
    9296    dmConsole: 
    93       name:         "Diem Console | Diem Console" 
     97      name:         Diem Console 
    9498      credentials:  system 
    95     dmSearchEngine: 
    96       name:         "Search Engine | Search Engine" 
    97       credentials:  search_engine 
    9899    dmServer: 
    99       name:         "Server | Server" 
     100      name:         Server 
    100101      credentials:  system 
    101 #  Media: 
    102 #    dmMediaFolder: 
    103 #      name:         Folder 
    104 #    dmMedia: 
    105 #      name:         File 
    106   Page: 
    107     dmPage: 
    108       name:         Page 
    109       credentials:  system 
    110     dmPageView: 
    111       name:         Page View 
    112       credentials:  system 
    113     dmLayout: 
    114       name:         Layout 
    115       credentials:  system 
    116     dmArea: 
    117       name:         Area 
    118       credentials:  system 
    119     dmZone: 
    120       name:         Zone 
    121       credentials:  system 
    122     dmWidget: 
    123       name:         Widget 
    124       credentials:  system 
  • plugins/diemPlugin/trunk/dmAdminPlugin/config/dm/project.yml

    r22606 r22786  
    1818  admin: 
    1919    max_per_page:         [ 3, 5, 10, 15, 20, 30, 50, 100, ∞ ]  # admin lists paginators 
    20     list_truncate:        200                                   # truncate big descriptions in admin lists 
     20    list_truncate:        120                                   # truncate big descriptions in admin lists 
    2121     
    2222  console:                                          # emulate a linux shell 
  • plugins/diemPlugin/trunk/dmAdminPlugin/config/dmAdminPluginConfiguration.class.php

    r22680 r22786  
    55    $dependencies = array(), 
    66    $helpers = array('Dm'), 
    7     $externalModules = array('sfGuardUser', 'sfGuardPermission', 'sfGuardGroup', 'sfPixlr'), 
    8     $disabledModules = array('dmPage', 'dmPageView', 'dmLayout', 'dmArea', 'dmZone', 'dmWidget', 'dmMedia', 'dmMediaFolder'); 
     7    $externalModules = array('sfGuardPermission', 'sfGuardGroup', 'sfPixlr'); 
    98 
    109  public function configure() 
     
    3938      $modules[] = basename($dir); 
    4039    } 
    41      
    42     $modules = array_diff(array_merge(self::$externalModules, $modules), self::$disabledModules); 
    4340 
    44     return $modules
     41    return array_merge($modules, self::$externalModules)
    4542  } 
    4643 
  • plugins/diemPlugin/trunk/dmAdminPlugin/data/generator/dmAdminDoctrineModule/dmAdmin/parts/processFormAction.php

    r22539 r22786  
    1414        $this->getUser()->setFlash('notice', $notice.' You can add another one below.'); 
    1515 
    16         $this->redirect('@<?php echo $this->getUrlForAction('new') ?>')
     16        $redirection = '@<?php echo $this->getUrlForAction('new') ?>'
    1717      } 
    1818      elseif ($request->hasParameter('_save_and_list')) 
     
    2020        $this->getUser()->setFlash('notice', $notice); 
    2121 
    22         $this->redirect('@<?php echo $this->getUrlForAction('list') ?>')
     22        $redirection = '@<?php echo $this->getUrlForAction('list') ?>'
    2323      } 
    2424      elseif ($request->hasParameter('_save_and_next')) 
     
    2626        $this->getUser()->setFlash('notice', $notice); 
    2727        $<?php echo $this->getSingularName() ?> = dmArray::get($<?php echo $this->getSingularName() ?>->getPrevNextRecords($this->buildQuery()), 'next', $this->form->getObject()); 
    28         $this->redirect('@<?php echo $this->getUrlForAction('edit') ?>?<?php echo $this->getPrimaryKeyUrlParams() ?>)
     28        $redirection = '@<?php echo $this->getUrlForAction('edit') ?>?<?php echo $this->getPrimaryKeyUrlParams() ?>
    2929      } 
    3030      else 
     
    3232        $this->getUser()->setFlash('notice', $notice); 
    3333 
    34         $this->redirect(array('sf_route' => '<?php echo $this->getUrlForAction('edit') ?>', 'sf_subject' => $<?php echo $this->getSingularName() ?>)); 
     34        $redirection = array('sf_route' => '<?php echo $this->getUrlForAction('edit') ?>', 'sf_subject' => $<?php echo $this->getSingularName() ?>); 
    3535      } 
     36 
     37      $this->redirect($redirection); 
    3638    } 
    3739    else 
  • plugins/diemPlugin/trunk/dmAdminPlugin/data/generator/dmAdminDoctrineModule/dmAdmin/template/lib/helper.php

    r22539 r22786  
    4040  public function linkToDelete($object, $params) 
    4141  { 
     42    $title = __($params['title'], array('%1%' => strtolower($this->getModule()->getName()))); 
    4243    return '<li class="sf_admin_action_delete">'.link_to1(__($params['label']), array( 
    4344    'sf_route' => $this->getUrlForAction('delete'), 
     
    4647    array( 
    4748    'class' => 's16 s16_delete ml10 mr10 dm_delete_link', 
    48     'title' => __($params['title'], array('%1%' => strtolower($this->getModule()->getName())))
     49    'title' => $title
    4950    'method' => 'delete', 
    50     'confirm' => false 
     51    'confirm' => $title.' ?' 
    5152    )).'</li>'; 
    5253  } 
  • plugins/diemPlugin/trunk/dmAdminPlugin/data/generator/dmAdminDoctrineModule/dmAdmin/template/templates/_search.php

    r22551 r22786  
    33    $currentSearch = $sf_user->getAppliedSearchOnModule('<?php echo $this->getModuleName(); ?>'); 
    44    printf('<form action="%s" method="get">', url_for1(array('sf_route' => '<?php echo $this->getModule()->getUnderscore(); ?>'))); 
    5     printf('<input id="dm_module_search_input" type="text" title="%s" value="%s" name="search"/>', 
     5    printf('<input id="dm_module_search_input" class="ui-corner-left" type="text" title="%s" value="%s" name="search"/>', 
    66      __('Search in %1%', array('%1%' => __("<?php echo $this->getModule()->getPlural(); ?>"))), 
    77      $currentSearch 
    88    ); 
     9    printf('<input type="submit" class="dm_submit ui-corner-right" value="%s" />', __('Search')); 
    910    if ($currentSearch) 
    1011    { 
    11       printf('<a href="%s" class="s16 s16_cross" title="%s">&nbsp;</a>', url_for1(array('sf_route' => '<?php echo $this->getModule()->getUnderscore(); ?>')).'?search=', __('Cancel search')); 
     12      printf('<a href="%s" class="s16 s16_cross ml5 mr5" title="%s">&nbsp;</a>', url_for1(array('sf_route' => '<?php echo $this->getModule()->getUnderscore(); ?>')).'?search=', __('Cancel search')); 
    1213    } 
    13     printf('<input type="submit" class="dm_submit" value="%s" />', __('Search')); 
    1414  ?] 
    1515  </form> 
  • plugins/diemPlugin/trunk/dmAdminPlugin/lib/config/dmAdminRoutingConfigHandler.php

    r22408 r22786  
    9191      ); 
    9292    } 
    93      
     93 
    9494    // module routes 
    9595    foreach($moduleManager->getModules() as $module) 
  • plugins/diemPlugin/trunk/dmAdminPlugin/lib/generator/dmAdminDoctrineGenerator.php

    r22539 r22786  
    158158      else 
    159159      { 
    160         $html = '$'.$this->getSingularName()."->get('".$relation->getLocalColumnName()."') ? $".$this->getSingularName()."->get('".$relation->getAlias()."') : '-'"; 
     160        $localModule = dmContext::getInstance()->getModuleManager()->getModuleByModel($relation->getClass()); 
     161         
     162        if ($localModule && $localModule->hasAdmin()) 
     163        { 
     164          $html = "(\$sf_user->canAccessToModule('{$localModule->getUnderscore()}') 
     165? £link(array('sf_route' => '{$localModule->getUnderscore()}_edit', 'sf_subject' => \${$this->getSingularName()}->get('{$relation->getAlias()}'))) 
     166->text(\${$this->getSingularName()}->get('{$relation->getAlias()}')->__toString()) 
     167->title(__('Open')) 
     168->set('.associated_record.s16right.s16_arrow_up_right_medium') 
     169: $".$this->getSingularName()."->get('".$relation->getAlias()."'))"; 
     170        } 
     171        else 
     172        { 
     173          $html = "$".$this->getSingularName()."->get('".$relation->getAlias()."')"; 
     174        } 
     175         
     176        $html = '$'.$this->getSingularName()."->get('".$relation->getLocalColumnName()."') ? ".$html." : '-'"; 
    161177      } 
    162178    } 
     
    185201    { 
    186202      $html = 'htmlentities(dmString::truncate('.$html.', '.$field->getConfig('truncate', sfConfig::get('dm_admin_list_truncate', 120)).'), ENT_QUOTES, \'UTF-8\')'; 
     203       
     204      if ($this->module->getTable()->isMarkdownColumn($fieldName)) 
     205      { 
     206        $html = "str_replace(array('*', '#'), '', ".$html.");"; 
     207      } 
    187208    } 
    188209 
    189210    if ($field->isLink()) 
    190211    { 
    191       $html = sprintf("link_to(%s, '%s', \$%s)", $html, $this->getUrlForAction('edit'), $this->getSingularName()); 
     212      $html = sprintf("£link(\$%s)->text(%s)->title('Open')", $this->getSingularName(), $html); 
    192213    } 
    193214 
    194215    return $html; 
     216  } 
     217   
     218  /** 
     219   * Returns the getter either non-developped: 'getFoo' or developped: '$class->getFoo()'. 
     220   * 
     221   * @param string  $column     The column name 
     222   * @param boolean $developed  true if you want developped method names, false otherwise 
     223   * @param string  $prefix     The prefix value 
     224   * 
     225   * @return string PHP code 
     226   */ 
     227  public function getColumnGetter($column, $developed = false, $prefix = '') 
     228  { 
     229    $getter = 'get(\''.$column.'\')'; 
     230    if ($developed) 
     231    { 
     232      $getter = sprintf('$%s%s->%s', $prefix, $this->getSingularName(), $getter); 
     233    } 
     234 
     235    return $getter; 
     236  } 
     237   
     238  /** 
     239   * Returns PHP code to add to a URL for primary keys. 
     240   * 
     241   * @param string $prefix The prefix value 
     242   * 
     243   * @return string PHP code 
     244   */ 
     245  public function getPrimaryKeyUrlParams($prefix = '', $full = false) 
     246  { 
     247    $params = array(); 
     248    foreach ($this->getPrimaryKeys() as $pk) 
     249    { 
     250      $fieldName = sfInflector::underscore($pk); 
     251 
     252      if ($full) 
     253      { 
     254        $params[] = sprintf("%s='.%s->%s", $fieldName, $prefix, $this->getColumnGetter($fieldName, false)); 
     255      } 
     256      else 
     257      { 
     258        $params[] = sprintf("%s='.%s", $fieldName, $this->getColumnGetter($fieldName, true, $prefix)); 
     259      } 
     260    } 
     261 
     262    return implode(".'&", $params); 
    195263  } 
    196264 
  • plugins/diemPlugin/trunk/dmAdminPlugin/lib/menu/dmAdminMenu.php

    r22680 r22786  
    8080    foreach($space->getModules() as $moduleKey => $module) 
    8181    { 
    82       if (!$module->isProject() && !in_array($moduleKey, sfConfig::get('sf_enabled_modules'))) 
    83       { 
    84         continue; 
    85       } 
    86        
    87       if(!$module->hasAdmin()) 
    88       { 
    89         continue; 
    90       } 
    91        
    92       if ($module->getParam('credentials') && !$this->user->can($module->getParam('credentials'))) 
     82      if (!$this->user->canAccessToModule($module)) 
    9383      { 
    9484        continue; 
  • plugins/diemPlugin/trunk/dmAdminPlugin/lib/user/dmAdminUser.php

    r22128 r22786  
    44{ 
    55  protected 
    6   $theme; 
     6  $theme, 
     7  $availableModules = array(); 
    78 
    89  /* 
     
    5051  } 
    5152 
     53  public function canAccessToModule($moduleKey) 
     54  { 
     55    if ($moduleKey instanceof dmModule) 
     56    { 
     57      $moduleKey = $moduleKey->getKey(); 
     58    } 
     59 
     60    if (isset($this->availableModules[$moduleKey])) 
     61    { 
     62      return $this->availableModules[$moduleKey]; 
     63    } 
     64     
     65    if ($moduleKey instanceof dmModule) 
     66    { 
     67      $module = $moduleKey; 
     68    } 
     69    else 
     70    { 
     71      $module = dmContext::getInstance()->getModuleManager()->getModule($moduleKey); 
     72    } 
     73     
     74    return $this->availableModules[$module->getKey()] = 
     75    $module->hasAdmin() 
     76    && ($module->isProject() || in_array($moduleKey, sfConfig::get('sf_enabled_modules'))) 
     77    && (!$module->getParam('credentials') || $this->can($module->getParam('credentials'))); 
     78  } 
     79   
    5280} 
  • plugins/diemPlugin/trunk/dmAdminPlugin/modules/dmAdminGenerator/templates/_relationAssociation.php

    r22552 r22786  
    1515  { 
    1616    echo £('li', 
    17       dmAdminLinkTag::build(array( 
     17      £link(array( 
    1818        'sf_route' => $associationModule->getUnderscore().'_edit', 
    1919        'sf_subject' => $associationRecord 
    20       ))->text($associationRecord) 
     20      )) 
     21      ->text($associationRecord->__toString()) 
     22      ->title(__('Open')) 
     23      ->set('.associated_record.s16right.s16_arrow_up_right_medium') 
    2124    ); 
    2225  } 
  • plugins/diemPlugin/trunk/dmAdminPlugin/modules/dmAdminGenerator/templates/_relationForeign.php

    r22552 r22786  
    3535          'sf_route' => $foreignModule->getUnderscore().'_edit', 
    3636          'sf_subject' => $foreignRecord 
    37         ))->text($foreignRecord) 
     37        )) 
     38        ->text($foreignRecord->__toString()) 
     39        ->title(__('Open')) 
     40        ->set('.associated_record.s16right.s16_arrow_up_right_medium') 
    3841      ); 
    3942    } 
  • plugins/diemPlugin/trunk/dmAdminPlugin/modules/dmAdminGenerator/templates/_sort.php

    r22552 r22786  
    2121    echo $form->open(); 
    2222   
    23     echo £('div.fleft', £link('@'.$module->getUnderscore())->text('&laquo; '.__('Back to list'))); 
     23    echo £('div.fleft', £link('@'.$form->getModule()->getUnderscore())->text('&laquo; '.__('Back to list'))); 
    2424   
    2525    echo $submit; 
  • plugins/diemPlugin/trunk/dmAdminPlugin/modules/dmInterface/templates/_flash.php

    r22552 r22786  
    22 
    33$html = ''; 
     4 
    45foreach(array('info', 'notice', 'alert', 'error') as $log_type) 
    56{ 
    67  foreach(array('dm_log_', '') as $prefix) 
    78  { 
    8     if (count($messages = (array)$sf_user->getFlash($prefix.$log_type))) 
     9    if (count($messages = (array) $sf_user->getFlash($prefix.$log_type))) 
    910    { 
    1011      $class = $log_type === 'notice' ? 'info' : $log_type; 
     
    2425if ($html) 
    2526{ 
    26   echo £("div#flash", $html); 
     27  echo £('div#flash', array('title' => __('Close')), $html); 
    2728} 
  • plugins/diemPlugin/trunk/dmAdminPlugin/modules/dmLayout/config/generator.yml

    r22552 r22786  
    1414        display: 
    1515          - =name 
    16           - page_views_list 
    17           - areas_list 
    1816          - css_class 
    1917        sort: 
     
    2119          - asc 
    2220        max_per_page: 8 
    23         table_method: joinAll 
     21        table_method: ~ 
    2422        table_count_method: ~ 
    2523      filter: 
  • plugins/diemPlugin/trunk/dmAdminPlugin/web/css/flash.css

    r21423 r22786  
    11#flash { 
    22  margin-bottom: 5px; 
     3  cursor: pointer; 
    34} 
    45 
    5 #flash .flash { 
     6#flash li.flash { 
    67  border: 1px solid; 
    78  padding: 5px; 
     
    1011} 
    1112 
    12 #flash .info { 
     13#flash li.info { 
    1314  background: #DFE9B8 url(../images/flash/green.gif) repeat-x top left; 
    1415  border-color: #CAD3A6; 
    1516} 
    1617 
    17 #flash .alert { 
     18#flash li.alert { 
    1819  background: #F8F2B7 url(../images/flash/yellow.gif) repeat-x top left; 
    1920  border-color: #DBD6A1; 
    2021} 
    2122 
    22 #flash .error { 
     23#flash li.error { 
    2324  background: #F6DCD9 url(../images/flash/red.gif) repeat-x top left; 
    2425  border-color: #D7BBB8; 
  • plugins/diemPlugin/trunk/dmAdminPlugin/web/css/list.css

    r22539 r22786  
    6262} 
    6363 
    64 div.dm_form_pagination strong 
    65 
    66   color: #000; 
     64div.dm_form_pagination strong { 
    6765} 
    6866 
     
    10199 
    102100.sf_admin_list tr.even { 
    103   background: #F1F5FE
     101  background: #F0F4FC
    104102} 
    105103 
     
    107105  border: none; 
    108106  padding: 5px 5px; 
     107  color: #222; 
    109108} 
    110109 
  • plugins/diemPlugin/trunk/dmAdminPlugin/web/css/main.css

    r22539 r22786  
    88h2{font-size:123.1%;} 
    99h3{font-size:108%;} 
    10 h1,h2,h3,h4,h5,h6,strong{color: #555; font-weight:bold;} 
     10h1,h2,h3,h4,h5,h6,strong{color: #333; font-weight:bold;} 
    1111h1 { letter-spacing: 1px; } 
    1212abbr,acronym{border-bottom:1px dotted #000;cursor:help;} 
  • plugins/diemPlugin/trunk/dmAdminPlugin/web/css/module.css

    r22539 r22786  
    1010  color: #666; 
    1111} 
    12  
    1312 
    1413.dm_module_type_show .title { 
     
    4443#dm_module_search_input { 
    4544  width: 300px; 
    46   margin-right: 5px; 
     45  padding:2px; 
     46  border: 1px solid #ccc; 
    4747} 
     48 
     49div.dm_module_search input.dm_submit { 
     50  padding:1px 5px; 
     51  border: 1px solid #ccc; 
     52  margin-left: -1px; 
     53  border-left: none; 
     54  background: url(../../core/images/default_bg.png) center left repeat-x; 
     55  color: #444; 
     56  cursor: pointer; 
     57} 
     58div.dm_module_search input.dm_submit:hover { 
     59  color: #046BCA; 
     60} 
     61 
     62a.associated_record { 
     63  background-position: right -1072px; 
     64  padding-left: 0px !important; 
     65  padding-right: 18px; 
     66  text-decoration: none; 
     67  color: inherit; 
     68} 
     69 
     70a.associated_record:hover { 
     71  background-position: right -1056px; 
     72  color: #046BCA; 
     73  text-decoration: underline; 
     74} 
  • plugins/diemPlugin/trunk/dmAdminPlugin/web/js/dmAdminCtrl.js

    r22539 r22786  
    108108        $("input.datepicker_me", this.$).datepicker({}); 
    109109      } 
     110    }, 
     111     
     112    flashMessages: function() 
     113    { 
     114      $("#flash").click(function() 
     115      { 
     116        $(this).remove(); 
     117      }); 
    110118    } 
    111119     
  • plugins/diemPlugin/trunk/dmAdminPlugin/web/js/dmAdminForm.js

    r22539 r22786  
    88      this.$ = $("#dm_admin_content"); 
    99       
    10       this.deleteLink(); 
    1110      this.focusFirstInput(); 
    1211      this.markitup(); 
     
    1615      this.hotKeys(); 
    1716    }, 
    18      
    19     deleteLink: function() 
    20     { 
    21       $('a.dm_delete_link', this.$).each(function() { 
    22         $(this).click(function(e) 
    23         { 
    24           e.stopPropagation(); 
    25           if (!confirm($(this).attr('title')+ ' ?')) 
    26           { 
    27             return false; 
    28           } 
    29         }); 
    30       }); 
    31     }, 
    3217     
    3318    focusFirstInput: function() 
  • plugins/diemPlugin/trunk/dmCorePlugin/config/doctrine/page_schema.yml

    r22604 r22786  
    3737    Layout: 
    3838      class:                DmLayout 
     39      local:                dm_layout_id 
     40      foreign:              id 
    3941      onDelete:             CASCADE 
    4042      foreignAlias:         PageViews 
     
    6365    Layout: 
    6466      class:                DmLayout 
     67      local:                dm_layout_id 
     68      foreign:              id 
     69      foreignAlias:         Areas 
    6570      onDelete:             CASCADE 
    66       foreignAlias:         Areas 
    6771    PageView: 
    6872      class:                DmPageView 
    6973      local:                dm_page_view_id 
    7074      foreign:              id 
     75      foreignAlias:         Area 
    7176      onDelete:             CASCADE 
    7277 
     
    8186    Area: 
    8287      class:                DmArea 
     88      local:                dm_area_id 
     89      foreign:              id 
     90      foreignAlias:         Zones 
    8391      onDelete:             CASCADE 
    84       foreignAlias:         Zones 
    8592   
    8693DmWidget: 
     
    96103    Zone: 
    97104      class:                DmZone 
     105      local:                dm_zone_id 
     106      foreign:              id 
     107      foreignAlias:         Widgets 
    98108      onDelete:             CASCADE 
    99       foreignAlias:         Widgets 
    100109       
    101110package:                    dmCorePlugin.lib.model.doctrine.page 
  • plugins/diemPlugin/trunk/dmCorePlugin/data/generator/dmDoctrineForm/default/template/sfDoctrineFormGeneratedInheritanceTemplate.php

    r22276 r22786  
    1515    parent::setupInheritance(); 
    1616 
     17<?php foreach ($this->getColumns() as $column): ?> 
     18    $this->widgetSchema   ['<?php echo $column->getFieldName() ?>'] = new <?php echo $this->getWidgetClassForColumn($column) ?>(<?php echo $this->getWidgetOptionsForColumn($column) ?>); 
     19    $this->validatorSchema['<?php echo $column->getFieldName() ?>'] = new <?php echo $this->getValidatorClassForColumn($column) ?>(<?php echo $this->getValidatorOptionsForColumn($column) ?>); 
     20 
     21<?php endforeach; ?> 
    1722<?php foreach ($this->getManyToManyRelations() as $relation): ?> 
    1823    $this->widgetSchema   ['<?php echo $this->underscore($relation['alias']) ?>_list'] = new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => '<?php echo $relation['table']->getOption('name') ?>')); 
     
    6570    } 
    6671 
    67     if (null === $con
     72    if (is_null($con)
    6873    { 
    6974      $con = $this->getConnection(); 
  • plugins/diemPlugin/trunk/dmCorePlugin/data/i18n/en_fr.yml

    r22539 r22786  
     1"Open": "Ouvrir" 
    12"Delete": "Supprimer" 
    23"Add": "Ajouter" 
  • plugins/diemPlugin/trunk/dmCorePlugin/data/incrementalSkeleton/sf_test_dir/bootstrap/functional.php

    r22213 r22786  
    2525require_once dirname(__FILE__).'/../../config/ProjectConfiguration.class.php'; 
    2626$configuration = ProjectConfiguration::getApplicationConfiguration($app, $env, $debug); 
    27 dmContext::createInstance($configuration); 
     27dm::createContext($configuration); 
    2828 
    2929// remove all cache 
  • plugins/diemPlugin/trunk/dmCorePlugin/data/sprites/16

    r22539 r22786  
    6565arrow_up_right 
    6666arrow_left 
     67arrow_up_right_medium 
     68arrow_up_right_medium 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/config/dmModuleManagerConfigHandler.php

    r22474 r22786  
    154154      } 
    155155    } 
     156     
     157    $moduleKeys = array(); 
     158    foreach($this->config as $typeName => $typeConfig) 
     159    { 
     160      foreach($typeConfig as $spaceName => $modulesConfig) 
     161      { 
     162        foreach($modulesConfig as $moduleKey => $moduleConfig) 
     163        { 
     164          if (in_array($moduleKey, $moduleKeys)) 
     165          { 
     166            $this->throwException('The module '.$moduleKey.' is declared twice'); 
     167          } 
     168          else 
     169          { 
     170            $moduleKeys[] = $moduleKey; 
     171          } 
     172        } 
     173      } 
     174    } 
    156175  } 
    157176   
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/controller/dmFrontWebController.php

    r22213 r22786  
    1313  public function redirect($url, $delay = 0, $statusCode = 302) 
    1414  { 
    15     $this->dispatcher->notify(new sfEvent($this, 'dm.controller.redirect', array($url))); 
     15    $url = $this->genUrl($url, true); 
     16     
     17    $this->dispatcher->notify(new sfEvent($this, 'dm.controller.redirect')); 
    1618     
    1719    parent::redirect($url, $delay, $statusCode); 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/core/dm.php

    r22539 r22786  
    11<?php 
     2 
     3require_once(dirname(__FILE__).'/dmBase.php'); 
    24 
    35/* 
    46 * Provides shortcuts to Symfony & Diem static methods 
    57 */ 
    6 class dm 
     8class dm extends dmBase 
    79{ 
    810   
    9   protected static 
    10   $startTime, 
    11   $version, 
    12   $dir; 
    13  
    14   public static function register($dir) 
    15   { 
    16     if (null !== self::$dir) 
    17     { 
    18       throw new Exception('Diem has already been registered'); 
    19     } 
    20      
    21     self::resetStartTime(); 
    22  
    23     self::$dir = $dir; 
    24  
    25     require_once(self::$dir.'/dmCorePlugin/lib/config/dmProjectConfiguration.php'); 
    26   } 
    27    
    28   public static function resetStartTime() 
    29   { 
    30     self::$startTime = microtime(true); 
    31   } 
    32    
    33   public static function getDir() 
    34   { 
    35     return self::$dir; 
    36   } 
    37    
    38   public static function getStartTime() 
    39   { 
    40     return self::$startTime; 
    41   } 
    42    
    43    
    44   public static function checkServer() 
    45   { 
    46     $configuration = ProjectConfiguration::getApplicationConfiguration('admin', 'test', true); 
    47     dmContext::createInstance($configuration); 
    48      
    49     $serverCheck = new dmServerCheck; 
    50      
    51     print $serverCheck->render(); 
    52      
    53     exit; 
    54   } 
    55    
    56   /* 
    57    * Symfony common objects accessors 
    58    */ 
    59  
    60   public static function getRouting() 
    61   { 
    62     return dmContext::getInstance()->getRouting(); 
    63   } 
    64  
    65   /* 
    66    * @return dmWebRequest 
    67    */ 
    68   public static function getRequest() 
    69   { 
    70     return dmContext::getInstance()->getRequest(); 
    71   } 
    72  
    73   public static function getResponse() 
    74   { 
    75     return dmContext::getInstance()->getResponse(); 
    76   } 
    77  
    78   public static function getController() 
    79   { 
    80     return dmContext::getInstance()->getController(); 
    81   } 
    82  
    83   public static function getEventDispatcher() 
    84   { 
    85     return dmContext::hasInstance() 
    86     ? dmContext::getInstance()->getEventDispatcher() 
    87     : ProjectConfiguration::getActive()->getEventDispatcher(); 
    88   } 
    89  
    90   public static function getUser() 
    91   { 
    92     return dmContext::getInstance()->getUser(); 
    93   } 
    94  
    95   public static function getI18n() 
    96   { 
    97     return dmContext::getInstance()->getI18n(); 
    98   } 
    99    
    100   public static function loadHelpers($helpers) 
    101   { 
    102     return dmContext::getInstance()->getConfiguration()->loadHelpers($helpers); 
    103   } 
    104  
    105   /* 
    106    * Diem common features shortcuts 
    107    */ 
    108  
    109   public static function version() 
    110   { 
    111     return sfConfig::get('dm_version'); 
    112   } 
    113  
    114   /* 
    115    * Gadgets 
    116    */ 
    117  
    118   /* 
    119    * Diem code size 
    120    * returns array(files, lines, characters) 
    121    */ 
    122   public static function getDiemSize() 
    123   { 
    124     $timer = dmDebug::timerOrNull('dm::getDiemSize()'); 
    125  
    126     $pluginsDir = sfConfig::get('sf_plugins_dir').'/'; 
    127  
    128     $files = sfFinder::type('file') 
    129       ->prune('om') 
    130       ->prune('map') 
    131       ->prune('base') 
    132       ->prune('vendor') 
    133       ->name('*\.php', '*\.css', '*\.js', '*\.yml') 
    134       ->in($pluginsDir.'dmCorePlugin', $pluginsDir.'dmAdminPlugin', $pluginsDir.'dmFrontPlugin'); 
    135  
    136     foreach($files as $key => $file) 
    137     { 
    138       if(strpos($file, '/web/lib/')) 
    139       { 
    140         unset($files[$key]); 
    141       } 
    142     } 
    143  
    144     $lines = 0; 
    145     $characters = 0; 
    146  
    147     foreach($files as $file) 
    148     { 
    149       $content = file($file); 
    150       $lines += count($content); 
    151       $characters += strlen(implode(' ', $content)); 
    152     } 
    153  
    154     $response = array( 
    155       'nb_files' => count($files), 
    156       'lines' => $lines, 
    157       'characters' => $characters 
    158     ); 
    159  
    160     $timer && $timer->addTime(); 
    161  
    162     return $response; 
    163   } 
    16411} 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/pager/dmDoctrinePager.php

    r22539 r22786  
    33class dmDoctrinePager extends sfDoctrinePager 
    44{ 
     5   
     6  /** 
     7   * Get all the results for the pager instance 
     8   * 
     9   * @param integer $hydrationMode Doctrine::HYDRATE_* constants 
     10   * 
     11   * @return Doctrine_Collection|array 
     12   */ 
     13  public function getResults($hydrationMode = Doctrine::HYDRATE_RECORD) 
     14  { 
     15    if(null !== $this->results) 
     16    { 
     17      return $this->results; 
     18    } 
     19     
     20    return $this->results = $this->getQuery()->execute(array(), $hydrationMode)->getData(); 
     21  } 
    522 
    623  public function getCountQuery() 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/table/dmDoctrineTable.php

    r22539 r22786  
    315315  } 
    316316 
     317  public function isMarkdownColumn($columnName) 
     318  { 
     319    return strpos(dmArray::get($this->getColumnDefinition($columnName), 'extra', ''), 'markdown') !== false; 
     320  } 
     321   
    317322  /* 
    318323   * Please override getSortColumnName instead 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/form/dmForm.php

    r22539 r22786  
    114114    } 
    115115 
    116     if (strpos($action, '#') === false) 
    117     { 
    118       $action .= '#'.$this->getKey(); 
    119     } 
     116//    if (strpos($action, '#') === false) 
     117//    { 
     118//      $action .= '#'.$this->getKey(); 
     119//    } 
    120120 
    121121    if (isset($opt['action'])) unset($opt['action']); 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/helper/DmHelper.php

    r22539 r22786  
    5959} 
    6060 
     61function unMarkdown($markdown) 
     62{ 
     63  return dmContext::getInstance()->get('markdown')->toText($markdown); 
     64} 
     65 
    6166/* 
    6267 * a, class='tagada ergrg' id=zegf, contenu 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/page/PluginDmLayout.class.php

    r22128 r22786  
    2828    } 
    2929 
    30     foreach($this->Areas as $area) 
     30    foreach($this->get('Areas') as $area) 
    3131    { 
    3232      if($area->get('type') == $type) 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/model/doctrine/page/PluginDmPageTable.class.php

    r22680 r22786  
    7272      foreach($ids as $index => $id) 
    7373      { 
    74         if (isset($this->recordPageCache[$module][$index])) 
     74        if (isset($this->recordPageCache[$module][$id])) 
    7575        { 
    7676          unset($ids[$index]); 
     
    8383    } 
    8484     
    85     $pages = $this->createQuery('p INDEXBY p.record_id') 
     85    $pages = $this->createQuery('p') 
    8686    ->withI18n() 
    8787    ->select('p.id, p.module, p.action, p.record_id, p.is_secure, p.lft, p.rgt, pTranslation.slug, pTranslation.name, pTranslation.is_active') 
     
    9191    ->getData(); 
    9292     
    93     foreach($pages as $recordId => $page) 
    94     { 
    95       $this->recordPageCache[$module][$recordId] = $page; 
     93    foreach($pages as $page) 
     94    { 
     95      $this->recordPageCache[$module][$page->get('record_id')] = $page; 
    9696    } 
    9797     
     
    199199    $module = $record->getDmModule()->getKey(); 
    200200     
    201 //    if (!isset($this->recordPageCache[$module])) 
    202 //    { 
    203 //      $this->prepareRecordPageCache($module); 
    204 //    } 
    205      
    206201    if (isset($this->recordPageCache[$module][$record->get('id')])) 
    207202    { 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/response/asset/compressor/dmStylesheetCompressor.php

    r22128 r22786  
    3838  } 
    3939 
    40   protected function fixCssPaths($content, $path) 
     40 
     41   
     42  public function fixCssPaths($content, $path) 
    4143  { 
    4244    if (preg_match_all("/url\(\s?[\'|\"]?(.+)[\'|\"]?\s?\)/ix", $content, $urlMatches)) 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/search/dmSearchEngine.php

    r22128 r22786  
    1616  } 
    1717   
     18  public function setLogger(sfLogger $logger) 
     19  { 
     20    $this->logger = $logger; 
     21  } 
     22   
    1823  protected function configure() 
    1924  { 
     
    2227      $index = $this->serviceContainer->getService('search_index'); 
    2328      $index->setCulture($culture); 
     29      $index->setLogger($this->logger); 
    2430      $this->addIndex($index->getName(), $index); 
    2531    } 
     
    7177     
    7278    $oldCulture = $this->user->getCulture(); 
    73  
     79     
    7480    foreach ($this->getIndices() as $name => $index) 
    7581    { 
     
    8591    $this->logger->log($this->getName().' : Group populated in "' . round(microtime(true) - $start, 2) . '" seconds.'); 
    8692   
     93    $this->logger->log('-----> Search index population successfully completed'); 
     94     
    8795    return true; 
    8896  } 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/search/dmSearchIndex.php

    r22213 r22786  
    2929    $this->logger     = $logger; 
    3030  } 
     31   
     32   
     33  public function setLogger(sfLogger $logger) 
     34  { 
     35    $this->logger = $logger; 
     36  } 
    3137 
    3238  public function setCulture($culture) 
     
    99105    } 
    100106 
     107    $nb = 0; 
     108    $nbMax = count($pages); 
    101109    foreach ($pages as $page) 
    102110    { 
    103       $this->logger->log($this->getName().' : '.$page->get('slug')); 
     111      ++$nb; 
     112      $this->logger->log($this->getName().' '.$nb.'/'.$nbMax.' : '.$page->get('slug')); 
    104113      $this->index->addDocument(new dmSearchPageDocument($page)); 
    105114    } 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/search/dmSearchPageDocument.php

    r22213 r22786  
    1717    $this->store('page_id', $page->get('id')); 
    1818 
    19     $this->index('body', $this->getPageBodyText($page)); 
     19    $this->index('body', $this->getPageBodyText($page), 1); 
    2020 
    2121    $this->index('slug', dmString::unSlugify($i18n->get('slug')), 2); 
     
    5656    } 
    5757     
     58    $helper = dmContext::getInstance()->get('page_helper'); 
     59     
    5860    dmContext::getInstance()->setPage($page); 
    5961     
    60     $area = dmDb::query('DmArea a, a.Zones z, z.Widgets w') 
    61       ->select('a.id, z.width, z.css_class, w.module, w.action, w.value, w.css_class') 
    62       ->where('a.type = ? AND a.dm_page_view_id = ?', array('content', $page->get('PageView')->get('id'))) 
     62    $area = dmDb::query('DmPageView pv, pv.Area a') 
     63    ->select('a.id') 
     64    ->where('pv.module = ? AND pv.action = ?', array($page->get('module'), $page->get('action'))) 
     65    ->fetchPDO(); 
     66     
     67    $zones = dmDb::query('DmZone z, z.Widgets w') 
     68      ->select('z.dm_area_id, w.module, w.action, w.value') 
     69      ->where('z.dm_area_id = ?',$area[0][0]) 
    6370      ->fetchArray(); 
    6471     
    65     $helper = dmContext::getInstance()->get('page_helper'); 
     72    sfConfig::set('dm_search_populating', true); 
    6673     
    6774    $html = ''; 
    6875     
    69     foreach($area[0]['Zones'] as $zone) 
     76    foreach($zones as $zone) 
    7077    { 
    7178      foreach($zone['Widgets'] as $widget) 
     
    7885    } 
    7986     
    80     unset($area); 
     87    sfConfig::set('dm_search_populating', false); 
    8188     
    8289    $indexableText = dmSearchIndex::cleanText($html); 
     90     
     91    unset($area, $html, $helper); 
    8392     
    8493    return $indexableText; 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmAdminGenerateTask.class.php

    r22229 r22786  
    3434    if (!sfContext::hasInstance()) 
    3535    { 
    36       dmContext::createInstance($this->configuration); 
     36      dm::createContext($this->configuration); 
    3737    } 
    3838 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmDataTask.class.php

    r22229 r22786  
    2828    if (!sfContext::hasInstance()) 
    2929    { 
    30       dmContext::createInstance($this->configuration); 
     30      dm::createContext($this->configuration); 
    3131    } 
    3232 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmDoctrineBuildFormsTask.class.php

    r22229 r22786  
    2727    if (!sfContext::hasInstance()) 
    2828    { 
    29       dmContext::createInstance($this->configuration); 
     29      dm::createContext($this->configuration); 
    3030    } 
    3131 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmDoctrineBuildModelTask.class.php

    r22128 r22786  
    9494    $import->setOptions($options); 
    9595    $import->importSchema(array($tmpPath, $config['yaml_schema_path']), 'yml', $config['models_path']); 
     96 
     97    $properties = parse_ini_file(sfConfig::get('sf_config_dir').'/properties.ini', true); 
     98    $finder = sfFinder::type('file')->name('*'.$options['suffix'])->maxdepth(0); 
     99    $this->getFilesystem()->replaceTokens($finder->in($config['models_path']), '##', '##', array( 
     100      'PACKAGE'    => isset($properties['symfony']['name']) ? $properties['symfony']['name'] : 'symfony', 
     101      'SUBPACKAGE' => 'model', 
     102      'NAME'       => isset($properties['symfony']['author']) ? $properties['symfony']['author'] : 'Your name here', 
     103      'EMAIL'      => isset($properties['symfony']['email']) ? $properties['symfony']['email'] : 'you@email.com', 
     104    )); 
     105 
     106    $finder = sfFinder::type('file')->name('*Table'.$options['suffix'])->maxdepth(0); 
     107    foreach ($finder->in($config['models_path']) as $file) 
     108    { 
     109      $contents = file_get_contents($file); 
     110      $contents = strtr(sfToolkit::stripComments($contents), array( 
     111        "{\n\n}" => "{\n}\n", 
     112      )); 
     113      file_put_contents($file, $contents); 
     114    } 
    96115  } 
    97116   
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmFrontGenerateTask.class.php

    r22229 r22786  
    3131    if (!sfContext::hasInstance()) 
    3232    { 
    33       dmContext::createInstance($this->configuration); 
     33      dm::createContext($this->configuration); 
    3434    } 
    3535 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmFrontPageIndexableContentTask.class.php

    r22229 r22786  
    4141      if (!sfContext::hasInstance()) 
    4242      { 
    43         dmContext::createInstance($this->configuration); 
     43        dm::createContext($this->configuration); 
    4444      } 
    4545      $databaseManager = new sfDatabaseManager($this->configuration); 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmLoremizeTask.class.php

    r22229 r22786  
    3232    if (!sfContext::hasInstance()) 
    3333    { 
    34       dmContext::createInstance($this->configuration); 
     34      dm::createContext($this->configuration); 
    3535    } 
    3636 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmSearchUpdateTask.class.php

    r22229 r22786  
    2727    if (!sfContext::hasInstance()) 
    2828    { 
    29       dmContext::createInstance($this->configuration); 
     29      dm::createContext($this->configuration); 
    3030    } 
    3131 
     
    3535     
    3636    $index = dmContext::getInstance()->get('search_engine'); 
    37     $index->setLogger(new dmLoggerTask($this->dispatcher, $this->formatter)); 
     37    $index->setLogger(new sfConsoleLogger($this->dispatcher)); 
    3838     
    3939    $index->populate(); 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmSetupTask.class.php

    r22229 r22786  
    3737//    if (!sfContext::hasInstance()) 
    3838//    { 
    39 //      dmContext::createInstance($this->configuration); 
     39//      dm::createContext($this->configuration); 
    4040//    } 
    4141// 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/task/dmSpriteTask.class.php

    r22254 r22786  
    2626  protected function execute($arguments = array(), $options = array()) 
    2727  { 
    28     dmContext::createInstance($this->configuration); 
     28    dm::createContext($this->configuration); 
    2929    return $this->executeService("dmSprite", $options); 
    3030  } 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/test/dmCoreFunctionalCoverageTest.php

    r22213 r22786  
    5555    $configuration = ProjectConfiguration::getApplicationConfiguration($this->options['app'], $this->options['env'], $this->options['debug']); 
    5656 
    57     dmContext::createInstance($configuration); 
     57    dm::createContext($configuration); 
    5858 
    5959    // remove all cache 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/test/dmTestBrowser.php

    r22213 r22786  
    2929       
    3030      // create context 
    31       $this->context = dmContext::createInstance($configuration); 
     31      $this->context = dm::createContext($configuration); 
    3232      unset($currentConfiguration); 
    3333 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/view/html/link/dmLinkTag.php

    r22166 r22786  
    129129        ); 
    130130      } 
     131       
    131132      unset($attributes['params']); 
    132133    } 
  • plugins/diemPlugin/trunk/dmCorePlugin/lib/view/html/media/tag/dmMediaTagImage.php

    r22680 r22786  
    124124  protected function prepareMediaAttributes(array $attributes) 
    125125  { 
    126     if ($this->hasSize()
     126    if ($this->hasSize() && !sfConfig::get('dm_search_populating')
    127127    { 
    128128      try 
  • plugins/diemPlugin/trunk/dmCorePlugin/test/bootstrap/functional.php

    r22213 r22786  
    2121require_once dirname(__FILE__).'/../../config/ProjectConfiguration.class.php'; 
    2222$configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true); 
    23 dmContext::createInstance($configuration); 
     23dm::createContext($configuration); 
    2424 
    2525// remove all cache 
  • plugins/diemPlugin/trunk/dmCorePlugin/web/css/editMode.css

    r21654 r22786  
    5555   background: #fff; 
    5656} 
     57 
     58.dm .ui-state-default, .dm .ui-widget-content .ui-state-default { 
     59  background-image: url(../images/default_bg.png); 
     60} 
  • plugins/diemPlugin/trunk/dmCorePlugin/web/css/sprite16.css

    r22539 r22786  
    6565.s16_arrow_up_right { background-position: 0 -1024px; } 
    6666.s16_arrow_left { background-position: 0 -1040px; } 
     67.s16_arrow_up_right_medium { background-position: 0 -1056px; } 
     68.s16_arrow_up_right_medium { background-position: 0 -1072px; } 
  • plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreEditCtrl.js

    r22598 r22786  
    1414        } 
    1515      }); 
     16       
    1617      $('div.ui-dialog a.close_dialog').live('click', function() 
    1718      { 
    1819        $(this).closest('div.ui-dialog-content').dialog('close'); 
    1920      }); 
     21       
    2022      $('input.hint').hint(); 
    2123    }, 
     
    115117       
    116118      return $dialog; 
    117     }, 
    118      
    119     flashMessages: function() 
    120     { 
    121       $("#flash").click(function() 
    122       { 
    123         $(this).remove(); 
    124       }); 
    125119    } 
    126120  }); 
  • plugins/diemPlugin/trunk/dmFrontPlugin/config/dm/assets.yml

    r22474 r22786  
    99    pageBar:          dmFrontPageBar 
    1010    mediaBar:         dmFrontMediaBar 
     11    codeEditor:       dmFrontCodeEditor 
    1112    page:             page/dmPage 
    1213    area:             page/dmArea 
  • plugins/diemPlugin/trunk/dmFrontPlugin/lib/action/dmFrontModuleComponents.php

    r22680 r22786  
    152152      $records = $records->getData(); 
    153153    } 
    154      
     154         
    155155    if (!empty($records)) 
    156156    { 
  • plugins/diemPlugin/trunk/dmFrontPlugin/lib/dmWidget/text/dmWidgetContentTextView.php

    r22539 r22786  
    4242    extract($vars); 
    4343     
    44     $html = ''; 
    45      
    46     echo dmStaticHelper::£o('div.dm_text.text_'.$style); 
     44    $html = dmHelper::£o('div.dm_text.text_'.$style); 
    4745 
    4846    if ($title && $titlePosition == 'outside') 
    4947    { 
    50       $html .= dmStaticHelper::£('h2.text_title.outside', $title); 
     48      $html .= dmHelper::£('h2.text_title.outside', $title); 
    5149    } 
    5250 
    53     $html .= dmStaticHelper::£o('div.text_content.clearfix'); 
     51    $html .= dmHelper::£o('div.text_content.clearfix'); 
    5452   
    5553      if ($media && $mediaPosition != 'bottom') 
    5654      { 
    57         $html .= dmStaticHelper::£('div.text_image'.$mediaClass, $media); 
     55        $html .= dmHelper::£('div.text_image'.$mediaClass, $media); 
    5856      } 
    5957     
    6058      if ($title && $titlePosition == 'inside') 
    6159      { 
    62         $html .= dmStaticHelper::£('h2.text_title.inside', $title); 
     60        $html .= dmHelper::£('h2.text_title.inside', $title); 
    6361      } 
    6462     
    65       $html .= dmStaticHelper::£('text_markdown', dmContext::getInstance()->get('markdown')->toHtml($text)); 
     63      $html .= dmHelper::£('text_markdown', dmContext::getInstance()->get('markdown')->toHtml($text)); 
    6664     
    6765      if ($media && $mediaPosition == 'bottom') 
    6866      { 
    69         $html .= dmStaticHelper::£('div.text_image'.$mediaClass, $media); 
     67        $html .= dmHelper::£('div.text_image'.$mediaClass, $media); 
    7068      } 
    7169   
    72     $html .= dmStaticHelper::£c('div'); 
     70    $html .= dmHelper::£c('div'); 
    7371     
    74     $html .= dmStaticHelper::£c('div'); 
     72    $html .= dmHelper::£c('div'); 
    7573     
    7674    return $html; 
  • plugins/diemPlugin/trunk/dmFrontPlugin/lib/pager/dmFrontDoctrinePager.php

    r22539 r22786  
    1010  $navigationCache =array(); 
    1111 
    12   /** 
    13    * Get all the results for the pager instance 
    14    * 
    15    * @param integer $hydrationMode Doctrine::HYDRATE_* constants 
    16    * 
    17    * @return Doctrine_Collection|array 
    18    */ 
    19   public function getResults($hydrationMode = Doctrine::HYDRATE_RECORD) 
    20   { 
    21     return parent::getResults($hydrationMode)->getData(); 
    22   } 
    23    
    2412  public function configureNavigation(array $navigationConfiguration) 
    2513  { 
  • plugins/diemPlugin/trunk/dmFrontPlugin/lib/response/asset/dmFrontAssetConfig.php

    r22598 r22786  
    1313        'lib.ui', 
    1414        'lib.ui-dialog', 
    15         'lib.ui-resizable', 
    16         'lib.ui-tabs', 
    17         'lib.markitup', 
    18         'lib.markitupSet', 
    1915        'core.util', 
    2016        'core.editMode', 
     
    5652        'lib.ui-sortable', 
    5753        'lib.ui-dialog', 
    58         'lib.ui-resizable', 
    59         'lib.ui-tabs', 
    6054        'lib.blockUI', 
    6155        'lib.form', 
    6256        'lib.hotkeys', 
    63         'lib.markitup', 
    64         'lib.markitupSet', 
    6557        'core.config', 
    6658        'core.plugins', 
     
    6961        'core.editCtrl', 
    7062        'core.form', 
    71         'core.tabForm', 
    7263        'core.toolBar', 
    7364        'core.pageBar', 
  • plugins/diemPlugin/trunk/dmFrontPlugin/lib/view/html/link/tag/dmFrontLinkTagPage.php

    r22213 r22786  
    4444    unset($preparedAttributes['tag']); 
    4545     
    46     if ($tagName == 'span') 
     46    if ($tagName === 'span') 
    4747    { 
    4848      unset($preparedAttributes['href'], $preparedAttributes['target']); 
    4949    } 
    5050     
    51     $attributes = $this->convertAttributesToHtml($preparedAttributes); 
    52      
    53     $tag = sprintf('<%s%s>%s</%s>', 
    54       $tagName, 
    55       $attributes, 
    56       $this->renderText(), 
    57       $tagName 
    58     ); 
    59      
    60     return $tag; 
     51    return '<'.$tagName.$this->convertAttributesToHtml($preparedAttributes).'>'.$this->renderText().'</'.$tagName.'>'; 
    6152  } 
    6253   
     
    6556    $attributes = parent::prepareAttributesForHtml($attributes); 
    6657 
    67     if($currentPage = self::$context->getPage()) 
     58    if (!sfConfig::get('dm_search_populating')) 
    6859    { 
    69       if ($currentPage->get('id') === $this->page->get('id')) 
     60      if($currentPage = self::$context->getPage()) 
    7061      { 
    71         $attributes['class'][] = 'dm_current'; 
    72          
    73         if(dmConfig::get('link_current_span', true)) 
     62        if ($currentPage->get('id') === $this->page->get('id')) 
    7463        { 
    75           $attributes['tag'] = 'span'; 
     64          $attributes['class'][] = 'dm_current'; 
     65           
     66          if(dmConfig::get('link_current_span', true)) 
     67          { 
     68            $attributes['tag'] = 'span'; 
     69          } 
    7670        } 
    77       } 
    78       elseif($currentPage->getNode()->isDescendantOf($this->page)) 
    79       { 
    80         $attributes['class'][] = 'dm_parent'; 
     71        elseif($currentPage->getNode()->isDescendantOf($this->page)) 
     72        { 
     73          $attributes['class'][] = 'dm_parent'; 
     74        } 
    8175      } 
    8276    } 
  • plugins/diemPlugin/trunk/dmFrontPlugin/lib/view/html/page/dmFrontPageHelper.php

    r22474 r22786  
    225225  public function renderWidgetInner(array $widget, dmWidgetType $widgetType = null) 
    226226  { 
    227 //    ob_start(); 
    228      
    229227    try 
    230228    { 
     
    241239       
    242240      $html = $this->serviceContainer->getService('widget_view')->render(); 
    243        
    244 //      ob_clean(); 
    245241    } 
    246242    catch(Exception $e) 
    247243    { 
    248 //      ob_clean(); 
    249       if (sfConfig::get('dm_debug')) 
     244      if (sfConfig::get('dm_debug') || sfConfig::get('dm_serach_populating')) 
    250245      { 
    251246        throw $e; 
  • plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmCodeEditor/actions/actions.class.php

    r22379 r22786  
    77  { 
    88    $this->fileMenu = new dmHtmlMenu($this->getFileMenu()); 
     9     
     10    $assetAliases = include($this->context->get('config_cache')->checkConfig('config/dm/assets.yml')); 
    911 
    1012    $js = 
    11     file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), sfConfig::get('dm_core_asset'), 'lib/jquery-ui/js/ui.tabs.min.js')). 
     13    file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['js.lib.ui-tabs'])). 
    1214    dmJsMinifier::transform( 
    13     file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), sfConfig::get('dm_core_asset'), 'js/dmCoreCodeArea.js'))
    14     file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), sfConfig::get('dm_front_asset'), 'js/dmFrontCodeEditor.js')) 
     15    file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['js.core.codeArea'])).';'
     16    file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['js.front.codeEditor'])) 
    1517    ); 
    1618 
    1719    $this->css = dmCssMinifier::transform( 
    18     file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), sfConfig::get('dm_front_asset'), 'css/codeEditor.css')) 
     20    file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['css.lib.ui-tabs'])). 
     21    file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['css.front.codeEditor'])) 
    1922    ); 
    2023     
  • plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmCodeEditor/templates/_launch.php

    r22379 r22786  
    11<?php 
    22 
    3 echo '<style type="text/css">'.$css.'</style>'; 
     3echo '<style type="text/css">', $css, '</style>'; 
    44 
    55echo £o('div.dm_code_editor_wrap'); 
  • plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmWidget/actions/actions.class.php

    r22584 r22786  
    5555      } 
    5656    } 
     57     
     58    $html = $this->renderEdit($form, $widgetType); 
     59   
     60    $js = ''; 
     61    $css = ''; 
     62     
     63    if (strpos($html, 'dm_tabbed_form')) 
     64    { 
     65      $assetAliases = include($this->context->get('config_cache')->checkConfig('config/dm/assets.yml')); 
     66       
     67      $js .= 
     68      file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['js.lib.ui-tabs'])). 
     69      dmJsMinifier::transform( 
     70      file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['js.core.tabForm'])) 
     71      ); 
     72       
     73      $css .= file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['css.lib.ui-tabs'])); 
     74    } 
     75     
     76    if (strpos($html, 'dm_markdown')) 
     77    { 
     78      $assetAliases = include($this->context->get('config_cache')->checkConfig('config/dm/assets.yml')); 
     79       
     80      $js .= 
     81      file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['js.lib.ui-resizable'])). 
     82      file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['js.lib.markitup'])). 
     83      file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases['js.lib.markitupSet'])) 
     84      ; 
     85       
     86      $stylesheetCompressor = $this->context->get('stylesheet_compressor'); 
     87       
     88      foreach(array('css.lib.markitup', 'css.lib.markitupSet', 'css.lib.ui-resizable') as $cssKey) 
     89      { 
     90        $css .= $stylesheetCompressor->fixCssPaths( 
     91          file_get_contents(dmOs::join(sfConfig::get('sf_web_dir'), $assetAliases[$cssKey])), 
     92          $assetAliases[$cssKey] 
     93        ); 
     94      } 
     95       
     96      $css = dmCssMinifier::transform($css); 
     97    } 
     98     
     99    if ($css) 
     100    { 
     101      $html = '<style type="text/css">'.$css.'</style>' . $html; 
     102    } 
    57103 
    58104    return $this->renderJson(array( 
    59105      'type' => 'form', 
    60       'html' => $this->renderEdit($form, $widgetType) 
     106      'html' => $html, 
     107      'js'   => $js 
    61108    )); 
    62109  } 
     
    90137      $codeEditorLinks = '<div class="code_editor_links">'.$codeEditorLinks.'</div>'; 
    91138    } 
    92  
    93     return 
    94     '<div class="dm dm_widget_edit {form_class: \''.$widgetType->getFullKey().'\'}">'. 
     139     
     140    return '<div class="dm dm_widget_edit {form_class: \''.$widgetType->getFullKey().'Form\'}">'. 
    95141    $form->render('.dm_form.list.little'). 
    96142    $codeEditorLinks. 
  • plugins/diemPlugin/trunk/dmFrontPlugin/web/css/form.css

    r22094 r22786  
    6767 
    6868.dm .dm_tabbed_form .ui-tabs-panel { 
    69   padding: 5px 0 0 0
     69  padding: 5px 0 0 0 !important
    7070} 
    7171 
  • plugins/diemPlugin/trunk/dmFrontPlugin/web/js/dmFrontEditCtrl.js

    r21423 r22786  
    99       
    1010      this.bars(); 
    11        
    12       this.flashMessages(); 
    1311       
    1412      this.liveEvents(); 
  • plugins/diemPlugin/trunk/dmFrontPlugin/web/js/page/dmWidgetForms.js

    r21489 r22786  
    3232  { 
    3333    var self = this, $form = self.find('form:first'), $tabs = $form.find('div.dm_tabbed_form').dmCoreTabForm({}); 
    34      
    3534    self.dmWidgetContentMediaForm(widget); 
    3635  },