Merge branch 'download' of https://forge.chapril.org/ZwiiCMS-Team/ZwiiCMS into download

This commit is contained in:
Fred Tempez 2021-02-12 17:07:29 +01:00
commit ed2130e8e1
24 changed files with 2654 additions and 2654 deletions

View File

@ -1,38 +1,38 @@
<?php <?php
namespace FeedWriter; namespace FeedWriter;
/* /*
* Copyright (C) 2012 Michael Bemmerl <mail@mx-server.de> * Copyright (C) 2012 Michael Bemmerl <mail@mx-server.de>
* *
* This file is part of the "Universal Feed Writer" project. * This file is part of the "Universal Feed Writer" project.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* Wrapper for creating ATOM feeds * Wrapper for creating ATOM feeds
* *
* @package UniversalFeedWriter * @package UniversalFeedWriter
*/ */
class ATOM extends Feed class ATOM extends Feed
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function __construct() public function __construct()
{ {
parent::__construct(Feed::ATOM); parent::__construct(Feed::ATOM);
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +1,33 @@
<?php <?php
namespace FeedWriter; namespace FeedWriter;
use \LogicException; use \LogicException;
/* /*
* Copyright (C) 2016 Michael Bemmerl <mail@mx-server.de> * Copyright (C) 2016 Michael Bemmerl <mail@mx-server.de>
* *
* This file is part of the "Universal Feed Writer" project. * This file is part of the "Universal Feed Writer" project.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* The exception that is thrown when an invalid operation is performed on * The exception that is thrown when an invalid operation is performed on
* the object. * the object.
* *
* @package UniversalFeedWriter * @package UniversalFeedWriter
*/ */
class InvalidOperationException extends LogicException class InvalidOperationException extends LogicException
{ {
} }

View File

@ -1,413 +1,413 @@
<?php <?php
namespace FeedWriter; namespace FeedWriter;
use \DateTime; use \DateTime;
/* /*
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com> * Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
* Copyright (C) 2010-2013, 2015-2016 Michael Bemmerl <mail@mx-server.de> * Copyright (C) 2010-2013, 2015-2016 Michael Bemmerl <mail@mx-server.de>
* *
* This file is part of the "Universal Feed Writer" project. * This file is part of the "Universal Feed Writer" project.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* Universal Feed Writer * Universal Feed Writer
* *
* Item class - Used as feed element in Feed class * Item class - Used as feed element in Feed class
* *
* @package UniversalFeedWriter * @package UniversalFeedWriter
* @author Anis uddin Ahmad <anisniit@gmail.com> * @author Anis uddin Ahmad <anisniit@gmail.com>
* @link http://www.ajaxray.com/projects/rss * @link http://www.ajaxray.com/projects/rss
*/ */
class Item class Item
{ {
/** /**
* Collection of feed item elements * Collection of feed item elements
*/ */
private $elements = array(); private $elements = array();
/** /**
* Contains the format of this feed. * Contains the format of this feed.
*/ */
private $version; private $version;
/** /**
* Is used as a suffix when multiple elements have the same name. * Is used as a suffix when multiple elements have the same name.
**/ **/
private $_cpt = 0; private $_cpt = 0;
/** /**
* Constructor * Constructor
* *
* @param string $version constant (RSS1/RSS2/ATOM) RSS2 is default. * @param string $version constant (RSS1/RSS2/ATOM) RSS2 is default.
*/ */
public function __construct($version = Feed::RSS2) public function __construct($version = Feed::RSS2)
{ {
$this->version = $version; $this->version = $version;
} }
/** /**
* Return an unique number * Return an unique number
* *
* @access private * @access private
* @return int * @return int
**/ **/
private function cpt() private function cpt()
{ {
return $this->_cpt++; return $this->_cpt++;
} }
/** /**
* Add an element to elements array * Add an element to elements array
* *
* @access public * @access public
* @param string $elementName The tag name of an element * @param string $elementName The tag name of an element
* @param string $content The content of tag * @param string $content The content of tag
* @param array $attributes Attributes (if any) in 'attrName' => 'attrValue' format * @param array $attributes Attributes (if any) in 'attrName' => 'attrValue' format
* @param boolean $overwrite Specifies if an already existing element is overwritten. * @param boolean $overwrite Specifies if an already existing element is overwritten.
* @param boolean $allowMultiple Specifies if multiple elements of the same name are allowed. * @param boolean $allowMultiple Specifies if multiple elements of the same name are allowed.
* @return self * @return self
* @throws \InvalidArgumentException if the element name is not a string, empty or NULL. * @throws \InvalidArgumentException if the element name is not a string, empty or NULL.
*/ */
public function addElement($elementName, $content, array $attributes = null, $overwrite = FALSE, $allowMultiple = FALSE) public function addElement($elementName, $content, array $attributes = null, $overwrite = FALSE, $allowMultiple = FALSE)
{ {
if (empty($elementName)) if (empty($elementName))
throw new \InvalidArgumentException('The element name may not be empty or NULL.'); throw new \InvalidArgumentException('The element name may not be empty or NULL.');
if (!is_string($elementName)) if (!is_string($elementName))
throw new \InvalidArgumentException('The element name must be a string.'); throw new \InvalidArgumentException('The element name must be a string.');
$key = $elementName; $key = $elementName;
// return if element already exists & if overwriting is disabled // return if element already exists & if overwriting is disabled
// & if multiple elements are not allowed. // & if multiple elements are not allowed.
if (isset($this->elements[$elementName]) && !$overwrite) { if (isset($this->elements[$elementName]) && !$overwrite) {
if (!$allowMultiple) if (!$allowMultiple)
return $this; return $this;
$key .= '-' . $this->cpt(); $key .= '-' . $this->cpt();
} }
$this->elements[$key]['name'] = $elementName; $this->elements[$key]['name'] = $elementName;
$this->elements[$key]['content'] = $content; $this->elements[$key]['content'] = $content;
$this->elements[$key]['attributes'] = $attributes; $this->elements[$key]['attributes'] = $attributes;
return $this; return $this;
} }
/** /**
* Set multiple feed elements from an array. * Set multiple feed elements from an array.
* Elements which have attributes cannot be added by this method * Elements which have attributes cannot be added by this method
* *
* @access public * @access public
* @param array array of elements in 'tagName' => 'tagContent' format. * @param array array of elements in 'tagName' => 'tagContent' format.
* @return self * @return self
*/ */
public function addElementArray(array $elementArray) public function addElementArray(array $elementArray)
{ {
foreach ($elementArray as $elementName => $content) { foreach ($elementArray as $elementName => $content) {
$this->addElement($elementName, $content); $this->addElement($elementName, $content);
} }
return $this; return $this;
} }
/** /**
* Return the collection of elements in this feed item * Return the collection of elements in this feed item
* *
* @access public * @access public
* @return array All elements of this item. * @return array All elements of this item.
* @throws InvalidOperationException on ATOM feeds if either a content or link element is missing. * @throws InvalidOperationException on ATOM feeds if either a content or link element is missing.
* @throws InvalidOperationException on RSS1 feeds if a title or link element is missing. * @throws InvalidOperationException on RSS1 feeds if a title or link element is missing.
*/ */
public function getElements() public function getElements()
{ {
// ATOM feeds have some specific requirements... // ATOM feeds have some specific requirements...
if ($this->version == Feed::ATOM) if ($this->version == Feed::ATOM)
{ {
// Add an 'id' element, if it was not added by calling the setLink method. // Add an 'id' element, if it was not added by calling the setLink method.
// Use the value of the title element as key, since no link element was specified. // Use the value of the title element as key, since no link element was specified.
if (!array_key_exists('id', $this->elements)) if (!array_key_exists('id', $this->elements))
$this->setId(Feed::uuid($this->elements['title']['content'], 'urn:uuid:')); $this->setId(Feed::uuid($this->elements['title']['content'], 'urn:uuid:'));
// Either a 'link' or 'content' element is needed. // Either a 'link' or 'content' element is needed.
if (!array_key_exists('content', $this->elements) && !array_key_exists('link', $this->elements)) if (!array_key_exists('content', $this->elements) && !array_key_exists('link', $this->elements))
throw new InvalidOperationException('ATOM feed entries need a link or a content element. Call the setLink or setContent method.'); throw new InvalidOperationException('ATOM feed entries need a link or a content element. Call the setLink or setContent method.');
} }
// ...same with RSS1 feeds. // ...same with RSS1 feeds.
else if ($this->version == Feed::RSS1) else if ($this->version == Feed::RSS1)
{ {
if (!array_key_exists('title', $this->elements)) if (!array_key_exists('title', $this->elements))
throw new InvalidOperationException('RSS1 feed entries need a title element. Call the setTitle method.'); throw new InvalidOperationException('RSS1 feed entries need a title element. Call the setTitle method.');
if (!array_key_exists('link', $this->elements)) if (!array_key_exists('link', $this->elements))
throw new InvalidOperationException('RSS1 feed entries need a link element. Call the setLink method.'); throw new InvalidOperationException('RSS1 feed entries need a link element. Call the setLink method.');
} }
return $this->elements; return $this->elements;
} }
/** /**
* Return the type of this feed item * Return the type of this feed item
* *
* @access public * @access public
* @return string The feed type, as defined in Feed.php * @return string The feed type, as defined in Feed.php
*/ */
public function getVersion() public function getVersion()
{ {
return $this->version; return $this->version;
} }
// Wrapper functions ------------------------------------------------------ // Wrapper functions ------------------------------------------------------
/** /**
* Set the 'description' element of feed item * Set the 'description' element of feed item
* *
* @access public * @access public
* @param string $description The content of the 'description' or 'summary' element * @param string $description The content of the 'description' or 'summary' element
* @return self * @return self
*/ */
public function setDescription($description) public function setDescription($description)
{ {
$tag = ($this->version == Feed::ATOM) ? 'summary' : 'description'; $tag = ($this->version == Feed::ATOM) ? 'summary' : 'description';
return $this->addElement($tag, $description); return $this->addElement($tag, $description);
} }
/** /**
* Set the 'content' element of the feed item * Set the 'content' element of the feed item
* For ATOM feeds only * For ATOM feeds only
* *
* @access public * @access public
* @param string $content Content for the item (i.e., the body of a download post). * @param string $content Content for the item (i.e., the body of a download post).
* @return self * @return self
* @throws InvalidOperationException if this method is called on non-ATOM feeds. * @throws InvalidOperationException if this method is called on non-ATOM feeds.
*/ */
public function setContent($content) public function setContent($content)
{ {
if ($this->version != Feed::ATOM) if ($this->version != Feed::ATOM)
throw new InvalidOperationException('The content element is supported in ATOM feeds only.'); throw new InvalidOperationException('The content element is supported in ATOM feeds only.');
return $this->addElement('content', $content, array('type' => 'html')); return $this->addElement('content', $content, array('type' => 'html'));
} }
/** /**
* Set the 'title' element of feed item * Set the 'title' element of feed item
* *
* @access public * @access public
* @param string $title The content of 'title' element * @param string $title The content of 'title' element
* @return self * @return self
*/ */
public function setTitle($title) public function setTitle($title)
{ {
return $this->addElement('title', $title); return $this->addElement('title', $title);
} }
/** /**
* Set the 'date' element of the feed item. * Set the 'date' element of the feed item.
* *
* The value of the date parameter can be either an instance of the * The value of the date parameter can be either an instance of the
* DateTime class, an integer containing a UNIX timestamp or a string * DateTime class, an integer containing a UNIX timestamp or a string
* which is parseable by PHP's 'strtotime' function. * which is parseable by PHP's 'strtotime' function.
* *
* @access public * @access public
* @param DateTime|int|string $date Date which should be used. * @param DateTime|int|string $date Date which should be used.
* @return self * @return self
* @throws \InvalidArgumentException if the given date was not parseable. * @throws \InvalidArgumentException if the given date was not parseable.
*/ */
public function setDate($date) public function setDate($date)
{ {
if (!is_numeric($date)) { if (!is_numeric($date)) {
if ($date instanceof DateTime) if ($date instanceof DateTime)
$date = $date->getTimestamp(); $date = $date->getTimestamp();
else { else {
$date = strtotime($date); $date = strtotime($date);
if ($date === FALSE) if ($date === FALSE)
throw new \InvalidArgumentException('The given date string was not parseable.'); throw new \InvalidArgumentException('The given date string was not parseable.');
} }
} elseif ($date < 0) } elseif ($date < 0)
throw new \InvalidArgumentException('The given date is not an UNIX timestamp.'); throw new \InvalidArgumentException('The given date is not an UNIX timestamp.');
if ($this->version == Feed::ATOM) { if ($this->version == Feed::ATOM) {
$tag = 'updated'; $tag = 'updated';
$value = date(\DATE_ATOM, $date); $value = date(\DATE_ATOM, $date);
} elseif ($this->version == Feed::RSS2) { } elseif ($this->version == Feed::RSS2) {
$tag = 'pubDate'; $tag = 'pubDate';
$value = date(\DATE_RSS, $date); $value = date(\DATE_RSS, $date);
} else { } else {
$tag = 'dc:date'; $tag = 'dc:date';
$value = date("Y-m-d", $date); $value = date("Y-m-d", $date);
} }
return $this->addElement($tag, $value); return $this->addElement($tag, $value);
} }
/** /**
* Set the 'link' element of feed item * Set the 'link' element of feed item
* *
* @access public * @access public
* @param string $link The content of 'link' element * @param string $link The content of 'link' element
* @return self * @return self
*/ */
public function setLink($link) public function setLink($link)
{ {
if ($this->version == Feed::RSS2 || $this->version == Feed::RSS1) { if ($this->version == Feed::RSS2 || $this->version == Feed::RSS1) {
$this->addElement('link', $link); $this->addElement('link', $link);
} else { } else {
$this->addElement('link','',array('href'=>$link)); $this->addElement('link','',array('href'=>$link));
$this->setId(Feed::uuid($link,'urn:uuid:')); $this->setId(Feed::uuid($link,'urn:uuid:'));
} }
return $this; return $this;
} }
/** /**
* Attach a external media to the feed item. * Attach a external media to the feed item.
* Not supported in RSS 1.0 feeds. * Not supported in RSS 1.0 feeds.
* *
* See RFC 4288 for syntactical correct MIME types. * See RFC 4288 for syntactical correct MIME types.
* *
* Note that you should avoid the use of more than one enclosure in one item, * Note that you should avoid the use of more than one enclosure in one item,
* since some RSS aggregators don't support it. * since some RSS aggregators don't support it.
* *
* @access public * @access public
* @param string $url The URL of the media. * @param string $url The URL of the media.
* @param integer $length The length of the media. * @param integer $length The length of the media.
* @param string $type The MIME type attribute of the media. * @param string $type The MIME type attribute of the media.
* @param boolean $multiple Specifies if multiple enclosures are allowed * @param boolean $multiple Specifies if multiple enclosures are allowed
* @return self * @return self
* @link https://tools.ietf.org/html/rfc4288 * @link https://tools.ietf.org/html/rfc4288
* @throws \InvalidArgumentException if the length or type parameter is invalid. * @throws \InvalidArgumentException if the length or type parameter is invalid.
* @throws InvalidOperationException if this method is called on RSS1 feeds. * @throws InvalidOperationException if this method is called on RSS1 feeds.
*/ */
public function addEnclosure($url, $length, $type, $multiple = TRUE) public function addEnclosure($url, $length, $type, $multiple = TRUE)
{ {
if ($this->version == Feed::RSS1) if ($this->version == Feed::RSS1)
throw new InvalidOperationException('Media attachment is not supported in RSS1 feeds.'); throw new InvalidOperationException('Media attachment is not supported in RSS1 feeds.');
// the length parameter should be set to 0 if it can't be determined // the length parameter should be set to 0 if it can't be determined
// see http://www.rssboard.org/rss-profile#element-channel-item-enclosure // see http://www.rssboard.org/rss-profile#element-channel-item-enclosure
if (!is_numeric($length) || $length < 0) if (!is_numeric($length) || $length < 0)
throw new \InvalidArgumentException('The length parameter must be an integer and greater or equals to zero.'); throw new \InvalidArgumentException('The length parameter must be an integer and greater or equals to zero.');
// Regex used from RFC 4287, page 41 // Regex used from RFC 4287, page 41
if (!is_string($type) || preg_match('/.+\/.+/', $type) != 1) if (!is_string($type) || preg_match('/.+\/.+/', $type) != 1)
throw new \InvalidArgumentException('type parameter must be a string and a MIME type.'); throw new \InvalidArgumentException('type parameter must be a string and a MIME type.');
$attributes = array('length' => $length, 'type' => $type); $attributes = array('length' => $length, 'type' => $type);
if ($this->version == Feed::RSS2) { if ($this->version == Feed::RSS2) {
$attributes['url'] = $url; $attributes['url'] = $url;
$this->addElement('enclosure', '', $attributes, FALSE, $multiple); $this->addElement('enclosure', '', $attributes, FALSE, $multiple);
} else { } else {
$attributes['href'] = $url; $attributes['href'] = $url;
$attributes['rel'] = 'enclosure'; $attributes['rel'] = 'enclosure';
$this->addElement('atom:link', '', $attributes, FALSE, $multiple); $this->addElement('atom:link', '', $attributes, FALSE, $multiple);
} }
return $this; return $this;
} }
/** /**
* Set the 'author' element of feed item. * Set the 'author' element of feed item.
* Not supported in RSS 1.0 feeds. * Not supported in RSS 1.0 feeds.
* *
* @access public * @access public
* @param string $author The author of this item * @param string $author The author of this item
* @param string|null $email Optional email address of the author * @param string|null $email Optional email address of the author
* @param string|null $uri Optional URI related to the author * @param string|null $uri Optional URI related to the author
* @return self * @return self
* @throws \InvalidArgumentException if the provided email address is syntactically incorrect. * @throws \InvalidArgumentException if the provided email address is syntactically incorrect.
* @throws InvalidOperationException if this method is called on RSS1 feeds. * @throws InvalidOperationException if this method is called on RSS1 feeds.
*/ */
public function setAuthor($author, $email = null, $uri = null) public function setAuthor($author, $email = null, $uri = null)
{ {
if ($this->version == Feed::RSS1) if ($this->version == Feed::RSS1)
throw new InvalidOperationException('The author element is not supported in RSS1 feeds.'); throw new InvalidOperationException('The author element is not supported in RSS1 feeds.');
// Regex from RFC 4287 page 41 // Regex from RFC 4287 page 41
if ($email != null && preg_match('/.+@.+/', $email) != 1) if ($email != null && preg_match('/.+@.+/', $email) != 1)
throw new \InvalidArgumentException('The email address is syntactically incorrect.'); throw new \InvalidArgumentException('The email address is syntactically incorrect.');
if ($this->version == Feed::RSS2) if ($this->version == Feed::RSS2)
{ {
if ($email != null) if ($email != null)
$author = $email . ' (' . $author . ')'; $author = $email . ' (' . $author . ')';
$this->addElement('author', $author); $this->addElement('author', $author);
} }
else else
{ {
$elements = array('name' => $author); $elements = array('name' => $author);
if ($email != null) if ($email != null)
$elements['email'] = $email; $elements['email'] = $email;
if ($uri != null) if ($uri != null)
$elements['uri'] = $uri; $elements['uri'] = $uri;
$this->addElement('author', $elements); $this->addElement('author', $elements);
} }
return $this; return $this;
} }
/** /**
* Set the unique identifier of the feed item * Set the unique identifier of the feed item
* *
* On ATOM feeds, the identifier must begin with an valid URI scheme. * On ATOM feeds, the identifier must begin with an valid URI scheme.
* *
* @access public * @access public
* @param string $id The unique identifier of this item * @param string $id The unique identifier of this item
* @param boolean $permaLink The value of the 'isPermaLink' attribute in RSS 2 feeds. * @param boolean $permaLink The value of the 'isPermaLink' attribute in RSS 2 feeds.
* @return self * @return self
* @throws \InvalidArgumentException if the permaLink parameter is not boolean. * @throws \InvalidArgumentException if the permaLink parameter is not boolean.
* @throws InvalidOperationException if this method is called on RSS1 feeds. * @throws InvalidOperationException if this method is called on RSS1 feeds.
*/ */
public function setId($id, $permaLink = false) public function setId($id, $permaLink = false)
{ {
if ($this->version == Feed::RSS2) { if ($this->version == Feed::RSS2) {
if (!is_bool($permaLink)) if (!is_bool($permaLink))
throw new \InvalidArgumentException('The permaLink parameter must be boolean.'); throw new \InvalidArgumentException('The permaLink parameter must be boolean.');
$permaLink = $permaLink ? 'true' : 'false'; $permaLink = $permaLink ? 'true' : 'false';
$this->addElement('guid', $id, array('isPermaLink' => $permaLink)); $this->addElement('guid', $id, array('isPermaLink' => $permaLink));
} elseif ($this->version == Feed::ATOM) { } elseif ($this->version == Feed::ATOM) {
// Check if the given ID is an valid URI scheme (see RFC 4287 4.2.6) // Check if the given ID is an valid URI scheme (see RFC 4287 4.2.6)
// The list of valid schemes was generated from http://www.iana.org/assignments/uri-schemes // The list of valid schemes was generated from http://www.iana.org/assignments/uri-schemes
// by using only permanent or historical schemes. // by using only permanent or historical schemes.
$validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'cap', 'cid', 'coap', 'coaps', 'crid', 'data', 'dav', 'dict', 'dns', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s'); $validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'cap', 'cid', 'coap', 'coaps', 'crid', 'data', 'dav', 'dict', 'dns', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s');
$found = FALSE; $found = FALSE;
$checkId = strtolower($id); $checkId = strtolower($id);
foreach($validSchemes as $scheme) foreach($validSchemes as $scheme)
if (strrpos($checkId, $scheme . ':', -strlen($checkId)) !== FALSE) if (strrpos($checkId, $scheme . ':', -strlen($checkId)) !== FALSE)
{ {
$found = TRUE; $found = TRUE;
break; break;
} }
if (!$found) if (!$found)
throw new \InvalidArgumentException("The ID must begin with an IANA-registered URI scheme."); throw new \InvalidArgumentException("The ID must begin with an IANA-registered URI scheme.");
$this->addElement('id', $id, NULL, TRUE); $this->addElement('id', $id, NULL, TRUE);
} else } else
throw new InvalidOperationException('A unique ID is not supported in RSS1 feeds.'); throw new InvalidOperationException('A unique ID is not supported in RSS1 feeds.');
return $this; return $this;
} }
} // end of class Item } // end of class Item

View File

@ -1,42 +1,42 @@
# Generate **RSS 1.0**, **RSS 2.0** or **ATOM** Formatted Feeds # Generate **RSS 1.0**, **RSS 2.0** or **ATOM** Formatted Feeds
This package can be used to generate feeds in either **RSS 1.0**, **RSS 2.0** or **ATOM** format. This package can be used to generate feeds in either **RSS 1.0**, **RSS 2.0** or **ATOM** format.
Applications can create a feed object, several feed item objects, set several types of properties of either feed and feed items, and add items to the feed. Applications can create a feed object, several feed item objects, set several types of properties of either feed and feed items, and add items to the feed.
Once a feed is fully composed with its items, the feed class can generate the necessary XML structure to describe the feed in **RSS** or **ATOM** format. This structure can be directly sent to the browser, or just returned as string. Once a feed is fully composed with its items, the feed class can generate the necessary XML structure to describe the feed in **RSS** or **ATOM** format. This structure can be directly sent to the browser, or just returned as string.
## Requirements ## Requirements
- PHP 5.3 or higher - PHP 5.3 or higher
If you don't have **PHP 5.3** available on your system there is a version supporting **PHP 5.0** and above. See the `legacy-php-5.0` branch. If you don't have **PHP 5.3** available on your system there is a version supporting **PHP 5.0** and above. See the `legacy-php-5.0` branch.
## Documentation ## Documentation
The documentation can be found in the `gh-pages` branch, or on [GitHub Pages](https://mibe.github.io/FeedWriter/). The documentation can be found in the `gh-pages` branch, or on [GitHub Pages](https://mibe.github.io/FeedWriter/).
See the `/examples` directory for usage examples. See the `/examples` directory for usage examples.
See the `CHANGELOG.md` file for changes between the different versions. See the `CHANGELOG.md` file for changes between the different versions.
## Authors ## Authors
In chronological order: In chronological order:
- [Anis uddin Ahmad](https://github.com/ajaxray) - [Anis uddin Ahmad](https://github.com/ajaxray)
- [Michael Bemmerl](https://github.com/mibe) - [Michael Bemmerl](https://github.com/mibe)
- Phil Freo - Phil Freo
- Paul Ferrett - Paul Ferrett
- Brennen Bearnes - Brennen Bearnes
- Michael Robinson - Michael Robinson
- Baptiste Fontaine - Baptiste Fontaine
- Kristián Valentín - Kristián Valentín
- Brandtley McMinn - Brandtley McMinn
- Julian Bogdani - Julian Bogdani
- Cedric Gampert - Cedric Gampert
- Yamek - Yamek
- Thielj - Thielj
- Pavel Khakhlou - Pavel Khakhlou
- Daniel - Daniel
- Tino Goratsch - Tino Goratsch

View File

@ -1,37 +1,37 @@
<?php <?php
namespace FeedWriter; namespace FeedWriter;
/* /*
* Copyright (C) 2012 Michael Bemmerl <mail@mx-server.de> * Copyright (C) 2012 Michael Bemmerl <mail@mx-server.de>
* *
* This file is part of the "Universal Feed Writer" project. * This file is part of the "Universal Feed Writer" project.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* Wrapper for creating RSS1 feeds * Wrapper for creating RSS1 feeds
* *
* @package UniversalFeedWriter * @package UniversalFeedWriter
*/ */
class RSS1 extends Feed class RSS1 extends Feed
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function __construct() public function __construct()
{ {
parent::__construct(Feed::RSS1); parent::__construct(Feed::RSS1);
} }
} }

View File

@ -1,37 +1,37 @@
<?php <?php
namespace FeedWriter; namespace FeedWriter;
/* /*
* Copyright (C) 2012 Michael Bemmerl <mail@mx-server.de> * Copyright (C) 2012 Michael Bemmerl <mail@mx-server.de>
* *
* This file is part of the "Universal Feed Writer" project. * This file is part of the "Universal Feed Writer" project.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* Wrapper for creating RSS2 feeds * Wrapper for creating RSS2 feeds
* *
* @package UniversalFeedWriter * @package UniversalFeedWriter
*/ */
class RSS2 extends Feed class RSS2 extends Feed
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function __construct() public function __construct()
{ {
parent::__construct(Feed::RSS2); parent::__construct(Feed::RSS2);
} }
} }

View File

@ -1,18 +1,18 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
/** NE PAS EFFACER /** NE PAS EFFACER
* admin.css * admin.css
*/ */

View File

@ -1,54 +1,54 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
/** /**
* Soumission du formulaire pour enregistrer en brouillon * Soumission du formulaire pour enregistrer en brouillon
*/ */
$("#downloadAddDraft").on("click", function() { $("#downloadAddDraft").on("click", function() {
$("#downloadAddState").val(0); $("#downloadAddState").val(0);
$("#downloadAddForm").trigger("submit"); $("#downloadAddForm").trigger("submit");
}); });
/** /**
* Options de commentaires * Options de commentaires
*/ */
$("#downloadAddCommentClose").on("change", function() { $("#downloadAddCommentClose").on("change", function() {
if ($(this).is(':checked') ) { if ($(this).is(':checked') ) {
$(".commentOptionsWrapper").slideUp(); $(".commentOptionsWrapper").slideUp();
} else { } else {
$(".commentOptionsWrapper").slideDown(); $(".commentOptionsWrapper").slideDown();
} }
}); });
$("#downloadAddCommentNotification").on("change", function() { $("#downloadAddCommentNotification").on("change", function() {
if ($(this).is(':checked') ) { if ($(this).is(':checked') ) {
$("#downloadAddCommentGroupNotification").slideDown(); $("#downloadAddCommentGroupNotification").slideDown();
} else { } else {
$("#downloadAddCommentGroupNotification").slideUp(); $("#downloadAddCommentGroupNotification").slideUp();
} }
}); });
$( document).ready(function() { $( document).ready(function() {
if ($("#downloadAddCloseComment").is(':checked') ) { if ($("#downloadAddCloseComment").is(':checked') ) {
$(".commentOptionsWrapper").slideUp(); $(".commentOptionsWrapper").slideUp();
} else { } else {
$(".commentOptionsWrapper").slideDown(); $(".commentOptionsWrapper").slideDown();
} }
if ($("#downloadAddCommentNotification").is(':checked') ) { if ($("#downloadAddCommentNotification").is(':checked') ) {
$("#downloadAddCommentGroupNotification").slideDown(); $("#downloadAddCommentGroupNotification").slideDown();
} else { } else {
$("#downloadAddCommentGroupNotification").slideUp(); $("#downloadAddCommentGroupNotification").slideUp();
} }
}); });

View File

@ -1,125 +1,125 @@
<?php echo template::formOpen('downloadAddForm'); ?> <?php echo template::formOpen('downloadAddForm'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col2">
<?php echo template::button('downloadAddBack', [ <?php echo template::button('downloadAddBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left', 'ico' => 'left',
'value' => 'Retour' 'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col3 offset5"> <div class="col3 offset5">
<?php echo template::button('downloadAddDraft', [ <?php echo template::button('downloadAddDraft', [
'uniqueSubmission' => true, 'uniqueSubmission' => true,
'value' => 'Enregistrer en brouillon' 'value' => 'Enregistrer en brouillon'
]); ?> ]); ?>
<?php echo template::hidden('downloadAddState', [ <?php echo template::hidden('downloadAddState', [
'value' => true 'value' => true
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::submit('downloadAddPublish', [ <?php echo template::submit('downloadAddPublish', [
'value' => 'Publier' 'value' => 'Publier'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Informations générales</h4> <h4>Informations générales</h4>
<div class="row"> <div class="row">
<div class="col8"> <div class="col8">
<?php echo template::text('downloadAddTitle', [ <?php echo template::text('downloadAddTitle', [
'label' => 'Titre' 'label' => 'Titre'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::text('downloadAddFileVersion', [ <?php echo template::text('downloadAddFileVersion', [
'label' => 'Version' 'label' => 'Version'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::date('downloadAddFileDate', [ <?php echo template::date('downloadAddFileDate', [
'label' => 'Date' 'label' => 'Date'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::file('downloadAddFile', [ <?php echo template::file('downloadAddFile', [
'label' => 'Archive du fichier' 'label' => 'Archive du fichier'
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::file('downloadAddPicture', [ <?php echo template::file('downloadAddPicture', [
'label' => 'Capture d\'écran', 'label' => 'Capture d\'écran',
'type' => 1 'type' => 1
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<?php echo template::textarea('downloadAddContent', [ <?php echo template::textarea('downloadAddContent', [
'class' => 'editorWysiwyg' 'class' => 'editorWysiwyg'
]); ?> ]); ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Options de publication</h4> <h4>Options de publication</h4>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('downloadAddUserId', $module::$users, [ <?php echo template::select('downloadAddUserId', $module::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id'), 'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::date('downloadAddPublishedOn', [ <?php echo template::date('downloadAddPublishedOn', [
'help' => 'L\'item n\'est visible qu\'après la date de publication prévue.', 'help' => 'L\'item n\'est visible qu\'après la date de publication prévue.',
'label' => 'Date de publication', 'label' => 'Date de publication',
'value' => time() 'value' => time()
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('downloadAddConsent', $module::$itemConsent , [ <?php echo template::select('downloadAddConsent', $module::$itemConsent , [
'label' => 'Edition / Suppression', 'label' => 'Edition / Suppression',
'selected' => $module::EDIT_ALL, 'selected' => $module::EDIT_ALL,
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction' 'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction'
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Commentaires</h4> <h4>Commentaires</h4>
<div class="row"> <div class="row">
<div class="col4 "> <div class="col4 ">
<?php echo template::checkbox('downloadAddCommentClose', true, 'Fermer les commentaires'); ?> <?php echo template::checkbox('downloadAddCommentClose', true, 'Fermer les commentaires'); ?>
</div> </div>
<div class="col4 commentOptionsWrapper "> <div class="col4 commentOptionsWrapper ">
<?php echo template::checkbox('downloadAddCommentApproved', true, 'Approbation par un modérateur'); ?> <?php echo template::checkbox('downloadAddCommentApproved', true, 'Approbation par un modérateur'); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadAddCommentMaxlength', $module::$commentLength,[ <?php echo template::select('downloadAddCommentMaxlength', $module::$commentLength,[
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.', 'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.',
'label' => 'Caractères par commentaire' 'label' => 'Caractères par commentaire'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col3 commentOptionsWrapper offset2"> <div class="col3 commentOptionsWrapper offset2">
<?php echo template::checkbox('downloadAddCommentNotification', true, 'Notification par email'); ?> <?php echo template::checkbox('downloadAddCommentNotification', true, 'Notification par email'); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadAddCommentGroupNotification', $module::$groupNews); ?> <?php echo template::select('downloadAddCommentGroupNotification', $module::$groupNews); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>

View File

@ -1,18 +1,18 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
/** NE PAS EFFACER /** NE PAS EFFACER
* admin.css * admin.css
*/ */

View File

@ -1,62 +1,62 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
/** /**
* Confirmation de suppression * Confirmation de suppression
*/ */
$(".downloadCommentDelete").on("click", function() { $(".downloadCommentDelete").on("click", function() {
var _this = $(this); var _this = $(this);
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>"; var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
return core.confirm("Supprimer le commentaire de l'item " + nom + " ?", function() { return core.confirm("Supprimer le commentaire de l'item " + nom + " ?", function() {
$(location).attr("href", _this.attr("href")); $(location).attr("href", _this.attr("href"));
}); });
}); });
/** /**
* Confirmation d'approbation * Confirmation d'approbation
*/ */
$(".downloadCommentApproved").on("click", function() { $(".downloadCommentApproved").on("click", function() {
var _this = $(this); var _this = $(this);
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>"; var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
return core.confirm("Approuver le commentaire de l'item " + nom + " ?", function() { return core.confirm("Approuver le commentaire de l'item " + nom + " ?", function() {
$(location).attr("href", _this.attr("href")); $(location).attr("href", _this.attr("href"));
}); });
}); });
/** /**
* Confirmation de rejet * Confirmation de rejet
*/ */
$(".downloadCommentRejected").on("click", function() { $(".downloadCommentRejected").on("click", function() {
var _this = $(this); var _this = $(this);
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>"; var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
return core.confirm("Rejeter le commentaire de l'item " + nom + " ?", function() { return core.confirm("Rejeter le commentaire de l'item " + nom + " ?", function() {
$(location).attr("href", _this.attr("href")); $(location).attr("href", _this.attr("href"));
}); });
}); });
/** /**
* Confirmation de suppression en masse * Confirmation de suppression en masse
*/ */
$(".downloadCommentDeleteAll").on("click", function() { $(".downloadCommentDeleteAll").on("click", function() {
var _this = $(this); var _this = $(this);
var nombre = "<?php echo count($this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'comment' ])); ?>"; var nombre = "<?php echo count($this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'comment' ])); ?>";
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>"; var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
if( nombre === "1"){ if( nombre === "1"){
var message = "Supprimer le commentaire de l'item " + nom + " ?"; var message = "Supprimer le commentaire de l'item " + nom + " ?";
} else{ } else{
var message = "Supprimer les " + nombre + " commentaires de l'item " + nom + " ?"; var message = "Supprimer les " + nombre + " commentaires de l'item " + nom + " ?";
} }
return core.confirm(message, function() { return core.confirm(message, function() {
$(location).attr("href", _this.attr("href")); $(location).attr("href", _this.attr("href"));
}); });
}); });

View File

@ -1,22 +1,22 @@
<div class="row"> <div class="row">
<div class="col2"> <div class="col2">
<?php echo template::button('downloadCommentBack', [ <?php echo template::button('downloadCommentBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left', 'ico' => 'left',
'value' => 'Retour' 'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<?php if($module::$comments): ?> <?php if($module::$comments): ?>
<div class="col2 offset8"> <div class="col2 offset8">
<?php echo $module::$commentsDelete; ?> <?php echo $module::$commentsDelete; ?>
</div> </div>
</div> </div>
<?php echo template::table([3, 5, 2, 1, 1], $module::$comments, ['Date', 'Contenu', 'Auteur', '', '']); ?> <?php echo template::table([3, 5, 2, 1, 1], $module::$comments, ['Date', 'Contenu', 'Auteur', '', '']); ?>
<?php echo $module::$pages.'<br/>'; ?> <?php echo $module::$pages.'<br/>'; ?>
<?php else: ?> <?php else: ?>
</div> </div>
<?php echo template::speech('Aucun commentaire.'); ?> <?php echo template::speech('Aucun commentaire.'); ?>
<?php endif; ?> <?php endif; ?>

View File

@ -1,18 +1,18 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
/** NE PAS EFFACER /** NE PAS EFFACER
* admin.css * admin.css
*/ */

View File

@ -1,21 +1,21 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
/** /**
* Confirmation de suppression * Confirmation de suppression
*/ */
$(".downloadConfigDelete").on("click", function() { $(".downloadConfigDelete").on("click", function() {
var _this = $(this); var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cet item ?", function() { return core.confirm("Êtes-vous sûr de vouloir supprimer cet item ?", function() {
$(location).attr("href", _this.attr("href")); $(location).attr("href", _this.attr("href"));
}); });
}); });

View File

@ -1,52 +1,52 @@
<?php echo template::formOpen('downloadConfig'); ?> <?php echo template::formOpen('downloadConfig'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col2">
<?php echo template::button('downloadConfigBack', [ <?php echo template::button('downloadConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'items', 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'items',
'ico' => 'left', 'ico' => 'left',
'value' => 'Retour' 'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col2 offset6"> <div class="col2 offset6">
<?php echo template::button('downloadConfigAdd', [ <?php echo template::button('downloadConfigAdd', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/add', 'href' => helper::baseUrl() . $this->getUrl(0) . '/add',
'ico' => 'plus', 'ico' => 'plus',
'value' => 'Item' 'value' => 'Item'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::submit('downloadConfigSubmit'); ?> <?php echo template::submit('downloadConfigSubmit'); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Paramètres du module</h4> <h4>Paramètres du module</h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::checkbox('downloadConfigShowFeeds', true, 'Lien du flux RSS', [ <?php echo template::checkbox('downloadConfigShowFeeds', true, 'Lien du flux RSS', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::text('downloadConfigFeedslabel', [ <?php echo template::text('downloadConfigFeedslabel', [
'label' => 'Etiquette du flux', 'label' => 'Etiquette du flux',
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<?php if($module::$items): ?> <?php if($module::$items): ?>
<?php echo template::table([3, 1, 3, 1, 1, 1, 1, 1], $module::$items, ['Titre', 'Version', 'Du', 'Stats', 'État', 'Commentaires', '','']); ?> <?php echo template::table([3, 1, 3, 1, 1, 1, 1, 1], $module::$items, ['Titre', 'Version', 'Du', 'Stats', 'État', 'Commentaires', '','']); ?>
<?php echo $module::$pages; ?> <?php echo $module::$pages; ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Aucun item.'); ?> <?php echo template::speech('Aucun item.'); ?>
<?php endif; ?> <?php endif; ?>
<div class="moduleVersion">Version <div class="moduleVersion">Version
<?php echo $module::VERSION; ?> <?php echo $module::VERSION; ?>
</div> </div>

View File

@ -1,18 +1,18 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
/** NE PAS EFFACER /** NE PAS EFFACER
* admin.css * admin.css
*/ */

View File

@ -1,66 +1,66 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
// Lien de connexion // Lien de connexion
$("#downloadEditMailNotification").on("change", function() { $("#downloadEditMailNotification").on("change", function() {
if($(this).is(":checked")) { if($(this).is(":checked")) {
$("#formConfigGroup").show(); $("#formConfigGroup").show();
} }
else { else {
$("#formConfigGroup").hide(); $("#formConfigGroup").hide();
} }
}).trigger("change"); }).trigger("change");
/** /**
* Soumission du formulaire pour enregistrer en brouillon * Soumission du formulaire pour enregistrer en brouillon
*/ */
$("#downloadEditDraft").on("click", function() { $("#downloadEditDraft").on("click", function() {
$("#downloadEditState").val(0); $("#downloadEditState").val(0);
$("#downloadEditForm").trigger("submit"); $("#downloadEditForm").trigger("submit");
}); });
/** /**
* Options de commentaires * Options de commentaires
*/ */
$("#downloadEditCommentClose").on("change", function() { $("#downloadEditCommentClose").on("change", function() {
if ($(this).is(':checked') ) { if ($(this).is(':checked') ) {
$(".commentOptionsWrapper").slideUp(); $(".commentOptionsWrapper").slideUp();
} else { } else {
$(".commentOptionsWrapper").slideDown(); $(".commentOptionsWrapper").slideDown();
} }
}); });
$("#downloadEditCommentNotification").on("change", function() { $("#downloadEditCommentNotification").on("change", function() {
if ($(this).is(':checked') ) { if ($(this).is(':checked') ) {
$("#downloadEditCommentGroupNotification").slideDown(); $("#downloadEditCommentGroupNotification").slideDown();
} else { } else {
$("#downloadEditCommentGroupNotification").slideUp(); $("#downloadEditCommentGroupNotification").slideUp();
} }
}); });
$( document).ready(function() { $( document).ready(function() {
if ($("#downloadEditCloseComment").is(':checked') ) { if ($("#downloadEditCloseComment").is(':checked') ) {
$(".commentOptionsWrapper").slideUp(); $(".commentOptionsWrapper").slideUp();
} else { } else {
$(".commentOptionsWrapper").slideDown(); $(".commentOptionsWrapper").slideDown();
} }
if ($("#downloadEditCommentNotification").is(':checked') ) { if ($("#downloadEditCommentNotification").is(':checked') ) {
$("#downloadEditCommentGroupNotification").slideDown(); $("#downloadEditCommentGroupNotification").slideDown();
} else { } else {
$("#downloadEditCommentGroupNotification").slideUp(); $("#downloadEditCommentGroupNotification").slideUp();
} }
}); });

View File

@ -1,145 +1,145 @@
<?php echo template::formOpen('downloadEditForm'); ?> <?php echo template::formOpen('downloadEditForm'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col2">
<?php echo template::button('downloadEditBack', [ <?php echo template::button('downloadEditBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left', 'ico' => 'left',
'value' => 'Retour' 'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col3 offset5"> <div class="col3 offset5">
<?php echo template::button('downloadEditDraft', [ <?php echo template::button('downloadEditDraft', [
'uniqueSubmission' => true, 'uniqueSubmission' => true,
'value' => 'Enregistrer en brouillon' 'value' => 'Enregistrer en brouillon'
]); ?> ]); ?>
<?php echo template::hidden('downloadEditState', [ <?php echo template::hidden('downloadEditState', [
'value' => true 'value' => true
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::submit('downloadEditSubmit', [ <?php echo template::submit('downloadEditSubmit', [
'value' => 'Publier' 'value' => 'Publier'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Informations générales</h4> <h4>Informations générales</h4>
<div class="row"> <div class="row">
<div class="col8"> <div class="col8">
<?php echo template::text('downloadEditTitle', [ <?php echo template::text('downloadEditTitle', [
'label' => 'Titre', 'label' => 'Titre',
'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'title']) 'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'title'])
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::text('downloadEditFileVersion', [ <?php echo template::text('downloadEditFileVersion', [
'label' => 'Version', 'label' => 'Version',
'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'fileVersion']) 'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'fileVersion'])
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::date('downloadEditFileDate', [ <?php echo template::date('downloadEditFileDate', [
'label' => 'Date', 'label' => 'Date',
'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'fileDate']) 'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'fileDate'])
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::file('downloadEditFile', [ <?php echo template::file('downloadEditFile', [
'label' => 'Archive du fichier', 'label' => 'Archive du fichier',
'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'file']) 'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'file'])
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::file('downloadEditPicture', [ <?php echo template::file('downloadEditPicture', [
'label' => 'Capture d\'écran', 'label' => 'Capture d\'écran',
'type' => 1, 'type' => 1,
'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'picture']) 'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'picture'])
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<?php echo template::textarea('downloadEditContent', [ <?php echo template::textarea('downloadEditContent', [
'class' => 'editorWysiwyg', 'class' => 'editorWysiwyg',
'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'content']) 'value' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'content'])
]); ?> ]); ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Options de publication</h4> <h4>Options de publication</h4>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('downloadEditUserId', $module::$users, [ <?php echo template::select('downloadEditUserId', $module::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id'), 'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::date('downloadEditPublishedOn', [ <?php echo template::date('downloadEditPublishedOn', [
'help' => 'L\'item n\'est visible qu\'après la date de publication prévue.', 'help' => 'L\'item n\'est visible qu\'après la date de publication prévue.',
'label' => 'Date de publication', 'label' => 'Date de publication',
'value' => time() 'value' => time()
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('downloadEditConsent', $module::$itemConsent , [ <?php echo template::select('downloadEditConsent', $module::$itemConsent , [
'label' => 'Edition / Suppression', 'label' => 'Edition / Suppression',
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'editConsent']), 'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction' 'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction'
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Commentaires</h4> <h4>Commentaires</h4>
<div class="row"> <div class="row">
<div class="col4 "> <div class="col4 ">
<?php echo template::checkbox('downloadEditCommentClose', true, 'Fermer les commentaires', [ <?php echo template::checkbox('downloadEditCommentClose', true, 'Fermer les commentaires', [
'checked' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentClose']) 'checked' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentClose'])
]); ?> ]); ?>
</div> </div>
<div class="col4 commentOptionsWrapper "> <div class="col4 commentOptionsWrapper ">
<?php echo template::checkbox('downloadEditCommentApproved', true, 'Approbation par un modérateur', [ <?php echo template::checkbox('downloadEditCommentApproved', true, 'Approbation par un modérateur', [
'checked' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentApproved']), 'checked' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentApproved']),
'' ''
]); ?> ]); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadEditCommentMaxlength', $module::$commentLength,[ <?php echo template::select('downloadEditCommentMaxlength', $module::$commentLength,[
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.', 'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.',
'label' => 'Caractères par commentaire', 'label' => 'Caractères par commentaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentMaxlength']) 'selected' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentMaxlength'])
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col3 commentOptionsWrapper offset2"> <div class="col3 commentOptionsWrapper offset2">
<?php echo template::checkbox('downloadEditCommentNotification', true, 'Notification par email', [ <?php echo template::checkbox('downloadEditCommentNotification', true, 'Notification par email', [
'checked' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentNotification']), 'checked' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentNotification']),
]); ?> ]); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadEditCommentGroupNotification', $module::$groupNews, [ <?php echo template::select('downloadEditCommentGroupNotification', $module::$groupNews, [
'selected' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentGroupNotification']), 'selected' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'commentGroupNotification']),
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs' 'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>

View File

@ -1,68 +1,68 @@
.rowitem { .rowitem {
margin-bottom: 10px !important; margin-bottom: 10px !important;
} }
.downloadPicture { .downloadPicture {
float: none; float: none;
border: 1px; border: 1px;
} }
.downloadPicture img { .downloadPicture img {
width: 100%; width: 100%;
height: auto; height: auto;
/* /*
border:1px solid lightgray; border:1px solid lightgray;
box-shadow: 1px 1px 5px darkgray; box-shadow: 1px 1px 5px darkgray;
*/ */
} }
.downloadPicture:hover { .downloadPicture:hover {
opacity: .7; opacity: .7;
} }
.row:after { .row:after {
content: " "; content: " ";
display: table; display: table;
clear: both; clear: both;
} }
.downloadComment { .downloadComment {
padding-right: 10px; padding-right: 10px;
float: right; float: right;
} }
.downloadTitle { .downloadTitle {
/*background-color: #ECEFF1;*/ /*background-color: #ECEFF1;*/
padding: 0px; padding: 0px;
margin-bottom: 5px; margin-bottom: 5px;
} }
.downloadContent { .downloadContent {
float: left; float: left;
margin-top: 5px; margin-top: 5px;
} }
.downloadDate { .downloadDate {
font-size:0.8em; font-size:0.8em;
font-style: italic; font-style: italic;
/* /*
color: grey; color: grey;
*/ */
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.downloadContent { .downloadContent {
display: none; display: none;
} }
.downloadPicture img { .downloadPicture img {
width: 50% ; width: 50% ;
display: block; display: block;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
} }
/* /*
* Flux RSS * Flux RSS
*/ */
#rssFeed { #rssFeed {
text-align: right; text-align: right;
float: right; float: right;
} }
#rssFeed p { #rssFeed p {
display: inline; display: inline;
vertical-align: top; vertical-align: top;
} }

View File

@ -1,67 +1,67 @@
<?php if($module::$items): ?> <?php if($module::$items): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php foreach($module::$items as $itemId => $item): ?> <?php foreach($module::$items as $itemId => $item): ?>
<div class="row rowitem"> <div class="row rowitem">
<div class="col3"> <div class="col3">
<?php <?php
// Déterminer le nom de la miniature // Déterminer le nom de la miniature
$parts = explode('/',$item['picture']); $parts = explode('/',$item['picture']);
$thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $item['picture']); $thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $item['picture']);
// Créer la miniature si manquante // Créer la miniature si manquante
if (!file_exists( self::FILE_DIR . 'thumb/' . $thumb) ) { if (!file_exists( self::FILE_DIR . 'thumb/' . $thumb) ) {
$this->makeThumb( self::FILE_DIR . 'source/' . $item['picture'], $this->makeThumb( self::FILE_DIR . 'source/' . $item['picture'],
self::FILE_DIR . 'thumb/' . $thumb, self::FILE_DIR . 'thumb/' . $thumb,
self::THUMBS_WIDTH); self::THUMBS_WIDTH);
} }
?> ?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>" class="downloadPicture"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>" class="downloadPicture">
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb; ?>" alt="<?php echo $item['picture']; ?>"> <img src="<?php echo helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb; ?>" alt="<?php echo $item['picture']; ?>">
</a> </a>
</div> </div>
<div class="col9"> <div class="col9">
<article> <article>
<h1 class="downloadTitle"> <h1 class="downloadTitle">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>">
<?php echo $item['title']; ?> <?php echo $item['title']; ?>
</a> </a>
</h1> </h1>
<div class="downloadComment"> <div class="downloadComment">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>#comment"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>#comment">
<?php if ($item['comment']): ?> <?php if ($item['comment']): ?>
<?php echo count($item['comment']); ?> <?php echo count($item['comment']); ?>
<?php endif; ?> <?php endif; ?>
</a> </a>
<?php echo template::ico('comment', 'left'); ?> <?php echo template::ico('comment', 'left'); ?>
</div> </div>
<div class="downloadDate"> <div class="downloadDate">
<i class="far fa-calendar-alt"></i> <i class="far fa-calendar-alt"></i>
<?php echo mb_detect_encoding(strftime('%d %B %Y - %H:%M', $item['publishedOn']), 'UTF-8', true) <?php echo mb_detect_encoding(strftime('%d %B %Y - %H:%M', $item['publishedOn']), 'UTF-8', true)
? strftime('%d %B %Y', $item['publishedOn']) ? strftime('%d %B %Y', $item['publishedOn'])
: utf8_encode(strftime('%d %B %Y', $item['publishedOn'])); ?> : utf8_encode(strftime('%d %B %Y', $item['publishedOn'])); ?>
</div> </div>
<p class="downloadContent"> <p class="downloadContent">
<?php echo helper::subword(strip_tags($item['content']), 0, 400); ?>... <?php echo helper::subword(strip_tags($item['content']), 0, 400); ?>...
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>">Lire la suite</a> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>">Lire la suite</a>
</p> </p>
</article> </article>
</div> </div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</div> </div>
<?php echo $module::$pages; ?> <?php echo $module::$pages; ?>
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?> <?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
<div id="rssFeed"> <div id="rssFeed">
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?> "> <a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?> ">
<img src='module/news/ressource/feed-icon-16.gif' /> <img src='module/news/ressource/feed-icon-16.gif' />
<?php <?php
echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ; echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ;
?> ?>
</a> </a>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Aucun item.'); ?> <?php echo template::speech('Aucun item.'); ?>
<?php endif; ?> <?php endif; ?>

View File

@ -1,63 +1,63 @@
#sectionTitle { #sectionTitle {
margin-top: 0; margin-top: 0;
margin-bottom: 5px; margin-bottom: 5px;
} }
.downloaditemPicture { .downloaditemPicture {
height: auto; height: auto;
border:1px solid lightgray; border:1px solid lightgray;
box-shadow: 1px 1px 5px; box-shadow: 1px 1px 5px;
} }
.downloaditemPictureleft { .downloaditemPictureleft {
float: left; float: left;
margin: 15px 10px 5px 0 ; margin: 15px 10px 5px 0 ;
} }
.downloaditemPictureright { .downloaditemPictureright {
float: right; float: right;
margin: 15px 0 5px 10px ; margin: 15px 0 5px 10px ;
} }
.pict20{ .pict20{
width: 20%; width: 20%;
} }
.pict30{ .pict30{
width: 30%; width: 30%;
} }
.pict40{ .pict40{
width: 40%; width: 40%;
} }
.pict50{ .pict50{
width: 50%; width: 50%;
} }
.pict100{ .pict100{
width: 100%; width: 100%;
margin: 15px 0 20px 0 ; margin: 15px 0 20px 0 ;
} }
#downloaditemCommentShow { #downloaditemCommentShow {
cursor: text; cursor: text;
} }
#downloaditemOr { #downloaditemOr {
padding: 10px; padding: 10px;
} }
.downloadDate { .downloadDate {
font-size:0.8em; font-size:0.8em;
font-style: italic; font-style: italic;
color: grey; color: grey;
} }
@media (max-width: 767px) { @media (max-width: 767px) {
.downloaditemPicture { .downloaditemPicture {
height:auto; height:auto;
max-width: 100%;} max-width: 100%;}
} }
#rssFeed { #rssFeed {
text-align: right; text-align: right;
float: right; float: right;
} }
#rssFeed p { #rssFeed p {
display: inline; display: inline;
vertical-align: top; vertical-align: top;
} }

View File

@ -1,43 +1,43 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
/** /**
* Affiche le bloc pour rédiger un commentaire * Affiche le bloc pour rédiger un commentaire
*/ */
var commentShowDOM = $("#downloaditemCommentShow"); var commentShowDOM = $("#downloaditemCommentShow");
commentShowDOM.on("click focus", function() { commentShowDOM.on("click focus", function() {
$("#downloaditemCommentShowWrapper").fadeOut(function() { $("#downloaditemCommentShowWrapper").fadeOut(function() {
$("#downloaditemCommentWrapper").fadeIn(); $("#downloaditemCommentWrapper").fadeIn();
$("#downloaditemCommentContent").trigger("focus"); $("#downloaditemCommentContent").trigger("focus");
}); });
}); });
if($("#downloaditemCommentWrapper").find("textarea.notice,input.notice").length) { if($("#downloaditemCommentWrapper").find("textarea.notice,input.notice").length) {
commentShowDOM.trigger("click"); commentShowDOM.trigger("click");
} }
/** /**
* Cache le bloc pour rédiger un commentaire * Cache le bloc pour rédiger un commentaire
*/ */
$("#downloaditemCommentHide").on("click focus", function() { $("#downloaditemCommentHide").on("click focus", function() {
$("#downloaditemCommentWrapper").fadeOut(function() { $("#downloaditemCommentWrapper").fadeOut(function() {
$("#downloaditemCommentShowWrapper").fadeIn(); $("#downloaditemCommentShowWrapper").fadeIn();
$("#downloaditemCommentContent").val(""); $("#downloaditemCommentContent").val("");
$("#downloaditemCommentAuthor").val(""); $("#downloaditemCommentAuthor").val("");
}); });
}); });
/** /**
* Force le scroll vers les commentaires en cas d'erreur * Force le scroll vers les commentaires en cas d'erreur
*/ */
$("#downloaditemCommentForm").on("submit", function() { $("#downloaditemCommentForm").on("submit", function() {
$(location).attr("href", "#comment"); $(location).attr("href", "#comment");
}); });

View File

@ -1,188 +1,188 @@
<article> <article>
<div class="row"> <div class="row">
<div class="col10"> <div class="col10">
<div class="downloadDate"> <div class="downloadDate">
<i class="far fa-calendar-alt"></i> <i class="far fa-calendar-alt"></i>
<?php $date = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) <?php $date = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true)
? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn'])) ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn']))
: utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn']))); : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn'])));
$heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true)
? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn'])) ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn']))
: utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn']))); : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'publishedOn'])));
echo $date . ' à ' . $heure; echo $date . ' à ' . $heure;
?> ?>
</div> </div>
</div> </div>
<div class="col2"> <div class="col2">
<?php if ( <?php if (
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND AND
( // Propriétaire ( // Propriétaire
( (
$this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'editConsent']) === $module::EDIT_OWNER $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'editConsent']) === $module::EDIT_OWNER
AND ( $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'userId']) === $this->getUser('id') AND ( $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'userId']) === $this->getUser('id')
OR $this->getUser('group') === self::GROUP_ADMIN ) OR $this->getUser('group') === self::GROUP_ADMIN )
) )
OR ( OR (
// Groupe // Groupe
( $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'editConsent']) === self::GROUP_ADMIN ( $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'editConsent']) === self::GROUP_ADMIN
OR $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'editConsent']) === self::GROUP_MODERATOR) OR $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'editConsent']) === self::GROUP_MODERATOR)
AND $this->getUser('group') >= $this->getData(['module',$this->getUrl(0), 'items', $this->getUrl(1),'editConsent']) AND $this->getUser('group') >= $this->getData(['module',$this->getUrl(0), 'items', $this->getUrl(1),'editConsent'])
) )
OR ( OR (
// Tout le monde // Tout le monde
$this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'editConsent']) === $module::EDIT_ALL $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1),'editConsent']) === $module::EDIT_ALL
AND $this->getUser('group') >= $module::$actions['config'] AND $this->getUser('group') >= $module::$actions['config']
) )
) )
): ?> ): ?>
<?php echo template::button('downloadItemEdit', [ <?php echo template::button('downloadItemEdit', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1) . '/' . $_SESSION['csrf'], 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1) . '/' . $_SESSION['csrf'],
'value' => 'Editer' 'value' => 'Editer'
]); ?> ]); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php $pictureSize = $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'pictureSize']); ?> <?php $pictureSize = $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'pictureSize']); ?>
<?php <?php
echo '<img class="downloaditemPicture" src="' . helper::baseUrl(false) . self::FILE_DIR.'source/' . $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'picture']) . echo '<img class="downloaditemPicture" src="' . helper::baseUrl(false) . self::FILE_DIR.'source/' . $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'picture']) .
'" alt="' . $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'picture']) . '">'; '" alt="' . $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'picture']) . '">';
?> ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php echo template::button('downloadItemFile', [ <?php echo template::button('downloadItemFile', [
//'href' => self::FILE_DIR . 'source/' . $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'file']), //'href' => self::FILE_DIR . 'source/' . $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'file']),
'href' => helper::baseUrl() . $this->getUrl(0) . '/downloadFile/' . $this->getUrl(1) . '/' . $_SESSION['csrf'], 'href' => helper::baseUrl() . $this->getUrl(0) . '/downloadFile/' . $this->getUrl(1) . '/' . $_SESSION['csrf'],
'value' => 'Télécharger' 'value' => 'Télécharger'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12 textAlignCenter"> <div class="col12 textAlignCenter">
<?php echo 'Version n°' . $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'fileVersion']); ?> <?php echo 'Version n°' . $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'fileVersion']); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12 textAlignCenter"> <div class="col12 textAlignCenter">
<?php $date = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'fileDate'])), 'UTF-8', true) <?php $date = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'fileDate'])), 'UTF-8', true)
? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'fileDate'])) ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'fileDate']))
: utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'fileDate']))); : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'fileDate'])));
?> ?>
<?php echo ' du ' . $date; ?> <?php echo ' du ' . $date; ?>
</div> </div>
</div> </div>
</div> </div>
<div class="col9"> <div class="col9">
<?php echo $this->getData(['module', $this->getUrl(0),'items', $this->getUrl(1), 'content']); ?> <?php echo $this->getData(['module', $this->getUrl(0),'items', $this->getUrl(1), 'content']); ?>
</div> </div>
<div class="col12"> <div class="col12">
<p class="clearBoth signature"><?php echo $module::$itemSignature;?></p> <p class="clearBoth signature"><?php echo $module::$itemSignature;?></p>
</div> </div>
</div> </div>
<!-- Bloc RSS--> <!-- Bloc RSS-->
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?> <?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
<div id="rssFeed"> <div id="rssFeed">
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?> "> <a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?> ">
<img src='module/news/ressource/feed-icon-16.gif' /> <img src='module/news/ressource/feed-icon-16.gif' />
<?php <?php
echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ; echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ;
?> ?>
</a> </a>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if($this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'commentClose'])): ?> <?php if($this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'commentClose'])): ?>
<p>Cet item ne reçoit pas de commentaire.</p> <p>Cet item ne reçoit pas de commentaire.</p>
<?php else: ?> <?php else: ?>
<h3 id="comment"> <h3 id="comment">
<?php //$commentsNb = count($module::$comments); ?> <?php //$commentsNb = count($module::$comments); ?>
<?php $commentsNb = $module::$nbCommentsApproved; ?> <?php $commentsNb = $module::$nbCommentsApproved; ?>
<?php $s = $commentsNb === 1 ? '': 's' ?> <?php $s = $commentsNb === 1 ? '': 's' ?>
<?php echo $commentsNb > 0 ? $commentsNb . ' ' . 'commentaire' . $s : 'Pas encore de commentaire'; ?> <?php echo $commentsNb > 0 ? $commentsNb . ' ' . 'commentaire' . $s : 'Pas encore de commentaire'; ?>
</h3> </h3>
<?php echo template::formOpen('downloaditemForm'); ?> <?php echo template::formOpen('downloaditemForm'); ?>
<?php echo template::text('downloaditemCommentShow', [ <?php echo template::text('downloaditemCommentShow', [
'placeholder' => 'Rédiger un commentaire...', 'placeholder' => 'Rédiger un commentaire...',
'readonly' => true 'readonly' => true
]); ?> ]); ?>
<div id="downloaditemCommentWrapper" class="displayNone"> <div id="downloaditemCommentWrapper" class="displayNone">
<?php if($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')): ?> <?php if($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')): ?>
<?php echo template::text('downloaditemUserName', [ <?php echo template::text('downloaditemUserName', [
'label' => 'Nom', 'label' => 'Nom',
'readonly' => true, 'readonly' => true,
'value' => $module::$editCommentSignature 'value' => $module::$editCommentSignature
]); ?> ]); ?>
<?php echo template::hidden('downloaditemUserId', [ <?php echo template::hidden('downloaditemUserId', [
'value' => $this->getUser('id') 'value' => $this->getUser('id')
]); ?> ]); ?>
<?php else: ?> <?php else: ?>
<div class="row"> <div class="row">
<div class="col9"> <div class="col9">
<?php echo template::text('downloaditemAuthor', [ <?php echo template::text('downloaditemAuthor', [
'label' => 'Nom' 'label' => 'Nom'
]); ?> ]); ?>
</div> </div>
<div class="col1 textAlignCenter verticalAlignBottom"> <div class="col1 textAlignCenter verticalAlignBottom">
<div id="downloaditemOr">Ou</div> <div id="downloaditemOr">Ou</div>
</div> </div>
<div class="col2 verticalAlignBottom"> <div class="col2 verticalAlignBottom">
<?php echo template::button('downloaditemLogin', [ <?php echo template::button('downloaditemLogin', [
'href' => helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()) . '__comment', 'href' => helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()) . '__comment',
'value' => 'Connexion' 'value' => 'Connexion'
]); ?> ]); ?>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php echo template::textarea('downloaditemContent', [ <?php echo template::textarea('downloaditemContent', [
'label' => 'Commentaire avec maximum '.$this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'commentMaxlength']).' caractères', 'label' => 'Commentaire avec maximum '.$this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'commentMaxlength']).' caractères',
'class' => 'editorWysiwygComment', 'class' => 'editorWysiwygComment',
'noDirty' => true, 'noDirty' => true,
'maxlength' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'commentMaxlength']) 'maxlength' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'commentMaxlength'])
]); ?> ]); ?>
<div id="downloaditemContentAlarm"> </div> <div id="downloaditemContentAlarm"> </div>
<?php if($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?> <?php if($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php echo template::captcha('downloaditemCaptcha', [ <?php echo template::captcha('downloaditemCaptcha', [
'limit' => $this->getData(['config','captchaStrong']) 'limit' => $this->getData(['config','captchaStrong'])
]); ?> ]); ?>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="row"> <div class="row">
<div class="col2 offset8"> <div class="col2 offset8">
<?php echo template::button('downloaditemCommentHide', [ <?php echo template::button('downloaditemCommentHide', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'value' => 'Annuler' 'value' => 'Annuler'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::submit('downloaditemSubmit', [ <?php echo template::submit('downloaditemSubmit', [
'value' => 'Envoyer', 'value' => 'Envoyer',
'ico' => '' 'ico' => ''
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
<?php endif;?> <?php endif;?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php foreach($module::$comments as $commentId => $comment): ?> <?php foreach($module::$comments as $commentId => $comment): ?>
<div class="block"> <div class="block">
<h4><?php echo $module::$commentsSignature[$commentId]; ?> <h4><?php echo $module::$commentsSignature[$commentId]; ?>
le <?php echo mb_detect_encoding(strftime('%d %B %Y - %H:%M', $comment['createdOn']), 'UTF-8', true) le <?php echo mb_detect_encoding(strftime('%d %B %Y - %H:%M', $comment['createdOn']), 'UTF-8', true)
? strftime('%d %B %Y - %H:%M', $comment['createdOn']) ? strftime('%d %B %Y - %H:%M', $comment['createdOn'])
: utf8_encode(strftime('%d %B %Y - %H:%M', $comment['createdOn'])); : utf8_encode(strftime('%d %B %Y - %H:%M', $comment['createdOn']));
?> ?>
<?php echo $comment['content']; ?> <?php echo $comment['content']; ?>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</div> </div>
<?php echo $module::$pages; ?> <?php echo $module::$pages; ?>
</article> </article>