Changeset 1555


Ignore:
Timestamp:
Oct 3, 2010, 11:10:46 AM (10 years ago)
Author:
teymour
Message:

Suppression du référencement des pages statiques

Location:
cpc/trunk/project/lib/task
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/lib/task/indexSolrTask.class.php

    r1541 r1555  
    2222    $this->addOption('all', null, sfCommandOption::PARAMETER_OPTIONAL, 'Reindex all the database (=no|yes no default)', 'no');
    2323    $this->addOption('pages', null, sfCommandOption::PARAMETER_OPTIONAL, 'Index static pages (=no|yes no default)', 'no');
     24    $this->addOption('removePages', null, sfCommandOption::PARAMETER_OPTIONAL, 'remove indexed static pages(=no|yes no default)', 'no');
    2425
    2526    $this->file_conf = sys_get_temp_dir().DIRECTORY_SEPARATOR."reindex_slor.db";
     
    3031  }
    3132
     33  protected function removeNonObjectPages($solr) {
     34    $array = NonObjectPage::getElements();
     35    foreach ($array as $k => $v) {
     36      $solr->deleteLuceneRecord('NonObjectPage/'.$k);
     37    }
     38  }
    3239  protected function indexNonObjectPages($solr) {
    3340    $array = NonObjectPage::getElements();
     
    5966    if ($options['removeAll'] == 'yes') {
    6067      $solr->deleteAll();
     68    }
     69
     70    if ($options['removePages'] == 'yes') {
     71      $this->removeNonObjectPages($solr);
     72      return ;
    6173    }
    6274
  • cpc/trunk/project/lib/task/printCircosSolrTask.class.php

    r1550 r1555  
    1212  protected function execute($arguments = array(), $options = array()) {
    1313    $manager = new sfDatabaseManager($this->configuration);
    14     $ct = 1;
    1514    foreach (Parlementaire::$dptmt_pref as $dep => $pref) {
    16       echo "url$ct:\n";
    17       echo "  url: \"/circonscription/departement/".str_replace(' ', '_', $dep)."\"\n";
    18       echo "  title: \"Les députés ".$pref.(!preg_match("/'/", $pref) ? ' ' : '').$dep.' ('.Parlementaire::getNumeroDepartement($dep).')"'."\n";
    1915      $num = Parlementaire::getNumeroDepartement($dep);
    2016      if (preg_match('/^\d$/', $num))
     
    2420      else
    2521        $fixednum = sprintf('%03d',$num);
    26       echo "  image: \"<img width='53' class='jstitle' title='".$dep." (".$num.")' alt='".$dep." (".$num.")' src='/circonscription/image/".$fixednum."/53/0'/>\"\n";
     22      echo "circo$num:\n";
     23      echo "  url: \"/circonscription/departement/".str_replace(' ', '_', $dep)."\"\n";
     24      echo "  title: \"Les députés ".$pref.(!preg_match("/'/", $pref) ? ' ' : '').$dep.' ('.Parlementaire::getNumeroDepartement($dep).')"'."\n";
     25      echo "  image: \"<img width='53' class='jstitle' title=q'".$dep." (".$num.")' alt='".$dep." (".$num.")' src='/circonscription/image/".$fixednum."/53/0'/>\"\n";
    2726      echo "  weight: 10\n";
    28       $ct++;
    2927    }
    3028  }
Note: See TracChangeset for help on using the changeset viewer.