| [ Index ] |
|
Code source de phpMyVisites 2.3 |
1 <?php 2 /* 3 * phpMyVisites : website statistics and audience measurements 4 * Copyright (C) 2002 - 2006 5 * http://www.phpmyvisites.net/ 6 * phpMyVisites is free software (license GNU/GPL) 7 * Authors : phpMyVisites team 8 */ 9 10 // $Id: FormPdfConfig.class.php 29 2006-08-18 07:35:21Z matthieu_ $ 11 12 13 14 require_once INCLUDE_PATH . "/core/forms/Form.class.php"; 15 require_once INCLUDE_PATH . "/core/include/SiteConfigDb.class.php"; 16 require_once INCLUDE_PATH . "/core/include/Cookie.class.php"; 17 require_once INCLUDE_PATH . "/core/include/PdfConfigDb.class.php"; 18 19 class FormSitePdfConfig extends Form 20 { 21 22 var $pdfName = ''; 23 var $pdfParam = ''; 24 var $pdfId = -1; 25 26 function FormSitePdfConfig( &$template, $siteAdmin, $pdfId = null ) 27 { 28 parent::Form( $template ); 29 30 $this->siteAdmin = $siteAdmin; 31 $confpdf = new PdfConfigDb($siteAdmin); 32 $this->tpl->assign( 'choix_pdf', $confpdf->getChoixPdf()); 33 $this->tpl->assign( 'default_pdf', $confpdf->getDefaultPdf()); 34 $this->tpl->assign( 'siteAdmin', $siteAdmin); 35 $this->tpl->assign( 'pdfId', $pdfId); 36 37 38 // case modify a pdf 39 if(!is_null($pdfId)) 40 { 41 42 $o_pdf = $confpdf->getPdf($pdfId); 43 $setDefault = getRequestVar("default", "false", "string"); 44 if ($setDefault == "true") { 45 $o_pdf->pdfParam = $confpdf->getDefaultPdf(); 46 } 47 48 $this->pdfId = $pdfId; 49 $this->pdfName = $o_pdf->pdfName; 50 $this->pdfParam = $o_pdf->pdfParam; 51 $this->tpl->assign( 'pdf', $o_pdf); 52 } 53 else { 54 // Add PDF : add a blank page 55 //$paramPdf = array(array (PDF_KEY_FREE_PAGE, "false", "false")); 56 $paramPdf = array(); 57 $o_pdf = new PdfConfig("", $paramPdf, ""); 58 $this->tpl->assign( 'pdf', $o_pdf); 59 } 60 } 61 62 function process() 63 { 64 // general input 65 $formElements = array( 66 array('text', 'form_name', $GLOBALS['lang']['admin_name'], 'value="'.$this->pdfName.'"'), 67 array('hidden', 'form_id', $this->pdfId ), 68 array('hidden', 'form_site_admin', $this->siteAdmin ) 69 ); 70 71 $this->addElements( $formElements ); 72 73 // launche process 74 return parent::process('admin_pdf_title'); 75 76 } 77 78 function postProcess() 79 { 80 $idSite = $this->getSubmitValue( 'form_site_admin'); 81 $confPdf = new PdfConfigDb($idSite); 82 83 84 $listChoix = $confPdf->getChoixPdf(); 85 86 $paramElem = $this->getSubmitValue( 'param_pdf_result'); 87 //print ("debut : ".$paramElem."<br>"); 88 $tabLine = split("@@", $paramElem); 89 $param = array(); 90 $i = 0; 91 foreach ($tabLine as $key => $info) { 92 //print ("Get : ".$key." : int : ".$info."<br>"); 93 $tmpLine = split("#", $info); 94 //$param[$tmpLine[0]] = array_slice ($tmpLine, 1); 95 $param[$i] = $tmpLine; 96 $i++; 97 } 98 /* 99 foreach ($param as $key => $info) { 100 print ("Select : ".$key." : int : ".$info[PDF_INDEX_INT]." all : ".$info[PDF_INDEX_ALL]); 101 if (isset($info[PDF_INDEX_AUTRE])) { 102 print(", autre : ".$info[PDF_INDEX_AUTRE]); 103 } 104 print("<br>"); 105 // print (" Result Select : ".$key." : int : ".$info."<br>"); 106 } 107 */ 108 109 /* 110 $param = array(); 111 foreach ($listChoix as $key => $info) { 112 $selCh = $this->getSubmitValue($key); 113 $selInt = "false"; 114 $selAll = "false"; 115 if ($selCh == 1) { 116 //print ("$key : $selCh<br>"); 117 if (! isset($info["PAG"])) { 118 if ($info["INT"] == "true") { 119 if ($this->getSubmitValue($key."I") == 1) { 120 $selInt = "true"; 121 } 122 } 123 if ($info["ALL"] == "true") { 124 if ($this->getSubmitValue($key."A") == 1) { 125 $selAll = "true"; 126 } 127 } 128 } 129 $param[$key] = array ($selInt, $selAll); 130 } 131 } 132 */ 133 /* 134 foreach ($param as $key => $info) { 135 print ("Select : ".$key." : int : ".$info[0]." all : ".$info[1]."<br>"); 136 } 137 */ 138 // add a new pdf 139 140 if($this->pdfId == -1) 141 { 142 $confPdf->addPdf($this->getSubmitValue( 'form_name'), 143 $param , 144 ($this->getSubmitValue( 'form_public_pdf') == 'yes') 145 ); 146 147 } 148 // mod an existing one 149 else 150 { 151 $confPdf->updatePdf($this->getSubmitValue( 'form_id'), 152 $this->getSubmitValue( 'form_name'), 153 $param, 154 ($this->getSubmitValue( 'form_public_pdf') == 'yes') 155 ); 156 } 157 //$confPdf->savePdf (); 158 159 } 160 } 161 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Mon Nov 26 14:10:01 2007 | par Balluche grâce à PHPXref 0.7 |
|