$this->fields['stats_exclude_ip'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Exclure les IP suivantes des statistiques'), 'grade' => 3, 'hint' => sprintf(__('Indiquer une adresse ip de la forme %s par ligne'), 'www.xxx.yyy.zzz'));
$this->fields['googleAnalytics'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Code Google Analytics'), 'size' => 10);
$this->fields['googleAnalyticsCustom'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Code Google Analytics personnalisé'));
+ $this->fields['xiti'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Code XiTi global'));
+ $this->fields['xiti_page'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Modèle code xiti (pour tags relatifs aux pages)'));
$this->forms['stats'] = array('label' => __('Statistiques'),
- 'fieldsnames' => array('stats', 'stats_score', 'stats_exclude_ip', '|', 'googleAnalytics', 'googleAnalyticsCustom'));
+ 'fieldsnames' => array('stats', 'stats_score', 'stats_exclude_ip', '|', 'googleAnalytics', 'googleAnalyticsCustom', '|', 'xiti', 'xiti_page'));
$this->fields['displayChaptersIcon'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Affiche l'icône du sommaire"), 'grade' => 1);
$this->fields['displayChaptersLine'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Affiche une ligne entre le label et le numéro de page"), 'grade' => 5);
* @author Vincent
*/
class wsLinks {
+ protected static $_testLinkCache = null;
public static function linksToExcel($links, $rulers, $pages = null) {
set_time_limit(0);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); */
+ $comments = array();
+
$xls = new PHPExcel();
$s = $xls->setActiveSheetIndex(0);
$s->setTitle('Links');
$s->getStyleByColumnAndRow($i, 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$i++;
}
+
// Links
$j = 2;
foreach ($links as $l) {
$l[$id] = 'physical';
}
}
+ if ($id == 'to' && in_array($l['type'], array(2))) {
+ $comment = false;
+ if (!Zend_Uri_Http::check($l[$id])) {
+ $comment = 'Invalid URI';
+ } else {
+ $comment = self::testLink($l[$id]);
+ }
+ if ($comment) {
+ $s->getComment(PHPExcel_Cell::stringFromColumnIndex($j - 1) . $i)->getText()->createTextRun($comment);
+ }
+
+ }
$value = $l[$id];
} else {
$value = '';
}
$j++;
}
-
// Rulers
$s = $xls->createSheet();
$s->setTitle('Rulers');
return $xls;
}
+ public static function testLink($uri) {
+ $client = new Zend_Http_Client($uri);
+ try {
+ $client->request('head');
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ return false;
+ }
+
public static function setDocumentLinks($document_id, $links, $rulers, $user, $comments, $time) {
global $core;
$c = $core->con->openCursor('document_links_versions');
}
}
-}
-
-?>
+}
\ No newline at end of file
case 6:
return self::getMultimediaInstance($id, $init, $compiler);
break;
+ case 23:
+ return new statsTagLink($id, $init, $compiler);
+ break;
default:
return null;
}
}
+class statsTagLink extends wsHTML5Link {
+ public function __construct($id, $init, &$compiler) {
+ parent::__construct($id, $init, $compiler);
+ $this->width = 1;
+ $this->height = 1;
+ }
+
+ public function getHTMLContent() {
+ return str_replace('%tag%', $this->to, $this->compiler->book->parametres->xiti_page);
+ }
+}
+
class flfLink extends wescoLink {
public function getURL() {
<movie input="" />\r
<movie path="..\composer.swf" />\r
<movie fps="45" />\r
- <movie width="4096" />\r
- <movie height="900" />\r
+ <movie width="1280" />\r
+ <movie height="768" />\r
<movie version="14" />\r
<movie minorVersion="0" />\r
<movie platform="Flash Player" />\r