Skip to content

Commit

Permalink
Merge commit 'c8e329f7189387e3afa8922a7f0d67e58e557e1f' into develop
Browse files Browse the repository at this point in the history
pull après merge pull request FortAwesome#24
  • Loading branch information
lioshi committed Dec 6, 2011
2 parents ec81b81 + c8e329f commit 7b3eb95
Show file tree
Hide file tree
Showing 306 changed files with 63 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ public function setup() {



$this->widgetSchema['titreBloc'] = new sfWidgetFormInputText(array());
$this->widgetSchema['titreBloc'] = new sfWidgetFormInputText(array('default' => 'Dossiers'));
$this->validatorSchema['titreBloc'] = new sfValidatorString(array(
'required' => false
'required' => true
));

$this->widgetSchema['titreLien'] = new sfWidgetFormInputText(array());
Expand Down Expand Up @@ -37,12 +37,10 @@ public function setup() {
//
$this->widgetSchema->setHelps(array(
// 'm_rubriques_list' => 'Vous pouvez choisir les rubriques des article à afficher en page d\'accueil ou hors contexte',
'titreBloc' => 'Le titre optionnel du bloc.',
'titreLien' => "Le libellé du lien vers tous les articles actus.",
'titreBloc' => 'Le titre OBLIGATOIRE du bloc',
'titreLien' => "Le libellé du lien vers la liste de tous les contenus de la section choisie dans la rubrique affichée(contextuel).",
'nbArticle' => 'Le nombre maximum d\'articles affichés.',
'longueurTexte' => 'Longueur du texte avant de la tronquer',
// 'photo' => 'affiche ou pas la photo',
// 'chapo' => 'Choisir si on veut afficher le résumé de la page ou le contenu entier de la page'
));

parent::setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public function configure() {
'section',
'longueurTexte',
'nbArticle'
// 'photo',
));
}

Expand Down Expand Up @@ -52,10 +51,13 @@ protected function doRender() {
->limit($vars['nbArticle'])
->execute();

// $rubriqueName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId($dmPage->module,$dmPage->action,$dmPage->record_id);
// $sectionName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId('section',$dmPage->action,$sectionPages[0]);

// echo'totto '. $rubriqueName->name.'<br />';
// echo'totto '.$sectionName->name;
}
}
$rubriqueName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId($dmPage->module,$dmPage->action,$dmPage->record_id);
$sectionName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId('section',$dmPage->action,$sectionPages[0]->id);

break;

Expand All @@ -81,11 +83,12 @@ protected function doRender() {
->execute();

$rubriqueName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId('rubrique','show',$rubrique->id);
$sectionName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId($dmPage->module,$dmPage->action,$sectionPages[0]);
echo $rubriqueName[0].' - '.$sectionName[0];
$sectionName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId($dmPage->module,$dmPage->action,$sectionPages[0]->id);
// echo $rubriqueName->name.' - '.$sectionName->name;
}
}

$rubriqueName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId('rubrique','show',$rubrique->id);
$sectionName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId($dmPage->module,$dmPage->action,$sectionPages[0]->id);
break;

case 'article/show':
Expand All @@ -109,14 +112,18 @@ protected function doRender() {
->limit($vars['nbArticle'])
->execute();

$rubriqueName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId('rubrique','show',$rubrique->id);
$sectionName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId($dmPage->module,$dmPage->action,$sectionPages[0]);
echo $rubriqueName[0].' - '.$sectionName[0];

// echo $rubriqueName->name.' - '.$sectionName->name;
}
}
$rubriqueName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId('rubrique','show',$rubrique->id);
$sectionName = dmDb::table('dmPage')->findOneByModuleAndActionAndRecordId('section',$dmPage->action,$articleId->section_id);
break;

default;
default :
$articles = array();
$rubriqueName ="";
$sectionName="";
break;

}
Expand All @@ -133,10 +140,10 @@ protected function doRender() {
'articles' => $articles,
// 'lien' => $arrayLienIds,
'titreBloc' => $vars['titreBloc'],
'titreLien' => $vars['titreLien'],
'longueurTexte' => $vars['longueurTexte'],
// 'photo' => $vars['photo']
// 'rubrique' => $rubriqueName[0]->getName(),
// 'section' => $sectionName[0]->getName()
'rubrique' => $rubriqueName,
'section' => $sectionName
));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

$html = "";
$html .= _open('li.element');
$html.= _open('span.wrapper');
$html.= _tag('span.title itemprop="name"', $article->getTitle());
//on ajoute le chapeau dans tous les cas
$html.= _tag('span.teaser itemprop="description"', stringTools::str_truncate($article->getChapeau(), $textLength, $textEnd, true));

$html.= _close('span.wrapper');

//On englobe l'ensemble du contenu dans un lien que l'on affiche
echo _link($article)
->set('.link_box')
->title($article->getTitle())
->text($html);
$html .= _close('li');
?>
Original file line number Diff line number Diff line change
@@ -1,63 +1,24 @@
<?php
// vars : $articles, $lien, $titreBloc, $longueurTexte, $rubrique, $section
//if (count($articles)) { // si nous avons des actu articles
// if($nbArticles == 1){
// if ($titreBloc != true) {
// echo _tag('h4.title', $rubrique);
// }
// else echo _tag('h4.title', $titreBloc);
// }
// echo _tag('h4.title', $titreBloc);
// echo _open('ul.elements');
// foreach ($articles as $i=>$article) {
// echo "<h4 class='title'>".$article->getTitle().'</h4>';
// echo "<span class='teaser'>".$article->getChapeau().'</span>';
// echo _link($article);
// if($lien[$i] != null){
// echo "<a class='link' href=".$article.'>'.$lien[$i].'</a>';
// }
// echo '<hr/>';
//
// include_partial("objectPartials/articleContextuel", array("lien" => $lien,"articles" => $articles,"textLength" => $longueurTexte,"textEnd" => '(...)',"photoArticle" => $photo,'titreBloc' => $titreBloc));
////
// }
// echo _close('ul');
//
// echo _open('div.navigation.navigationBottom');
// echo _open('ul.elements');
// echo _open('li.element');
// echo _link('sidActuArticle/list')->text($titreLien);
// echo _close('li');
// echo _close('ul');
// echo _close('div');
//} // sinon on affiche rien
//<?php
// vars : $section, $titreBloc, $titreLien, $longueurTexte, $articles, $arrayRubrique, $photo

// vars : $articles, $titreBloc, $titreLien, $longueurTexte, $articles, $rubrique, $section
if (count($articles)) { // si nous avons des actu articles

echo _tag('h4.title', $titreBloc);
echo _open('ul.elements');
foreach ($articles as $article){
$html ="";
echo _open('li.element');
if ($titreBloc != true) {
$html.= _tag('h4.title', $rubrique);
}
else $html.= _tag('h4.title', $titreBloc);

$html .= _open('span.wrapper');
$html .= _tag('span.title', '' . $article) ;
$html .= _tag('span.teaser itemprop="description"', stringTools::str_truncate($article->getChapeau(), $longueurTexte, '(...)', true));
$html .= _close('span.wrapper');

echo _link($article)->text($html)->set('.link_box');
echo _open('div.navigation.navigationBottom');
//echo _link($article->Section)->text($section.' - '.$rubrique);
// echo _close('ul');
echo _close('div');
echo _close('li');
// include_partial("objectPartials/filActualite", array("article" => $article,"textLength" => $longueurTexte,"textEnd" => '(...)','titreBloc' => $titreBloc, "titreLien" => $titreLien,"arrayRubrique" => $arrayRubrique,"photo" => $photo));

include_partial("objectPartials/articleBySectionContextuel", array("article" => $article,"textLength" => $longueurTexte,"textEnd" => '(...)'));

}
echo _close('ul');

echo _open('div.navigation.navigationBottom');
echo _open ('ul.elements');
echo _open ('li.element');
if($titreLien){$text = $titreLien;}
else $text = $section->name.' en '. $rubrique->name;
echo _link($article->Section)->text($text);
echo _close('li');
echo _close('ul');
echo _close('div');
}

Large diffs are not rendered by default.

0 comments on commit 7b3eb95

Please sign in to comment.