. */ include("./include/include.php"); require_once(FILESYSTEMROOTPATH."jc/include/classes/DefaultLayout.php"); $layout = new DefaultLayout(Access::VISITOR); $layout->init(); $layout->echoln('

CIA

'); $ciaService = $GLOBALS['ClassFactory']->getCIAService(); //titles select box $order = -1; $unselected = ''; $a_title = new CIA(''); if(isset($_GET['order'])){ $order = $_GET['order']; $a_title->setOrder($order); $unselected = ''; } $layout->echoln("Warning: This is not the authentic (official) version of the CIA, please consult the pdf version as published by the Juridical Commission in case of doubt.

"); $layout->echoln('

Select Section

'); $titles = $ciaService->loadTitles(); $layout->echoln('
Title:


'); if ($order == -1){ $layout->page_footer(); exit(); } $sentences = $ciaService->loadByTitleOrder($order); $previous = array( 'category'=>'', //current category 'order'=>'', //current title 'order2'=>'', //current title2 'article'=>'', //current article number 'article_title' =>'', 'paragraph'=>'', //current paragraph ); /*TODO * - if only one sentence/paragraph: don't show numbering! * - number 0 is possible: introduction! * */ foreach ($sentences as $sentence) { if ($sentence['order'] != $previous['order']) { //we have moved to next 'title' section $layout->echoln('

'.$sentence['title'].'

'); $layout->echoln(''.$sentence['last_change'].'
'); } if ($sentence['order2'] != $previous['order2'] AND $sentence['title2'])//Only in case there really is a title title! { //we have moved to next 'title2' section $layout->echoln('

'.$sentence['title2'].'

'); } if ($sentence['article'] != $previous['article'] || $sentence['article_title'] != $previous['article_title']) { // article_title: we can display bis artiles //we have moved to next article $txt = '
'; if ($sentence['article']!= 0) $txt .= 'Article '.$sentence['article'];//else introduction if ($sentence['article']!= 0 AND $sentence['article_title']) $txt .= ': ';//colon only if there are an article number and an article title $txt.= $sentence['article_title'].''; $layout->echoln($txt); $previous['paragraph']=''; //reset paragraph counter [needed when previous article has 1 paragraph] } if ($sentence['paragraph'] != $previous['paragraph']) { //we have moved to next paragraph $layout->echoln('
'); if($sentence['paragraph']) $layout->echoln('('.$sentence['paragraph'].')'); } $layout->echoln(''.$sentence['sentence'].''.nl2br($sentence['sentence_text']).'
'); $previous = $sentence; } $layout->page_footer(); ?>