diff --git a/core/lib/Thelia/Command/CacheClear.php b/core/lib/Thelia/Command/CacheClear.php
index 72b7571d2..1126f99a6 100755
--- a/core/lib/Thelia/Command/CacheClear.php
+++ b/core/lib/Thelia/Command/CacheClear.php
@@ -62,26 +62,34 @@ class CacheClear extends ContainerAwareCommand
$this->clearCache($cacheDir, $output);
if (!$input->getOption("without-assets")) {
- $this->clearCache(THELIA_WEB_DIR . "/assets", $output);
+ $this->clearCache(THELIA_WEB_DIR . "assets", $output);
}
}
protected function clearCache($dir, OutputInterface $output)
{
- if (!is_writable($dir)) {
- throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $dir));
- }
-
$output->writeln(sprintf("Clearing cache in /gi,""),t(/<\/p>/gi,"\n"),t(/ |\u00a0/gi," "),t(/"/gi,'"'),t(/</gi,"<"),t(/>/gi,">"),t(/&/gi,"&"),e},_punbb_bbcode2html:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/\n/gi,"ModuleImage instance. If
+ * obj is an instance of ModuleImage, delegates to
+ * equals(ModuleImage). Otherwise, returns false.
+ *
+ * @param obj The object to compare to.
+ * @return Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @param string $name The virtual column name
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @return mixed
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return ModuleImage The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return ModuleImage The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [module_id] column value.
+ *
+ * @return int
+ */
+ public function getModuleId()
+ {
+
+ return $this->module_id;
+ }
+
+ /**
+ * Get the [file] column value.
+ *
+ * @return string
+ */
+ public function getFile()
+ {
+
+ return $this->file;
+ }
+
+ /**
+ * Get the [position] column value.
+ *
+ * @return int
+ */
+ public function getPosition()
+ {
+
+ return $this->position;
+ }
+
+ /**
+ * Get the [optionally formatted] temporal [created_at] column value.
+ *
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the raw \DateTime object will be returned.
+ *
+ * @return mixed Formatted date/time value as string or \DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
+ *
+ * @throws PropelException - if unable to parse/validate the date/time value.
+ */
+ public function getCreatedAt($format = NULL)
+ {
+ if ($format === null) {
+ return $this->created_at;
+ } else {
+ return $this->created_at !== null ? $this->created_at->format($format) : null;
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] temporal [updated_at] column value.
+ *
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the raw \DateTime object will be returned.
+ *
+ * @return mixed Formatted date/time value as string or \DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
+ *
+ * @throws PropelException - if unable to parse/validate the date/time value.
+ */
+ public function getUpdatedAt($format = NULL)
+ {
+ if ($format === null) {
+ return $this->updated_at;
+ } else {
+ return $this->updated_at !== null ? $this->updated_at->format($format) : null;
+ }
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[] = ModuleImageTableMap::ID;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [module_id] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function setModuleId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->module_id !== $v) {
+ $this->module_id = $v;
+ $this->modifiedColumns[] = ModuleImageTableMap::MODULE_ID;
+ }
+
+ if ($this->aModule !== null && $this->aModule->getId() !== $v) {
+ $this->aModule = null;
+ }
+
+
+ return $this;
+ } // setModuleId()
+
+ /**
+ * Set the value of [file] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function setFile($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->file !== $v) {
+ $this->file = $v;
+ $this->modifiedColumns[] = ModuleImageTableMap::FILE;
+ }
+
+
+ return $this;
+ } // setFile()
+
+ /**
+ * Set the value of [position] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function setPosition($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->position !== $v) {
+ $this->position = $v;
+ $this->modifiedColumns[] = ModuleImageTableMap::POSITION;
+ }
+
+
+ return $this;
+ } // setPosition()
+
+ /**
+ * Sets the value of [created_at] column to a normalized version of the date/time value specified.
+ *
+ * @param mixed $v string, integer (timestamp), or \DateTime value.
+ * Empty strings are treated as NULL.
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function setCreatedAt($v)
+ {
+ $dt = PropelDateTime::newInstance($v, null, '\DateTime');
+ if ($this->created_at !== null || $dt !== null) {
+ if ($dt !== $this->created_at) {
+ $this->created_at = $dt;
+ $this->modifiedColumns[] = ModuleImageTableMap::CREATED_AT;
+ }
+ } // if either are not null
+
+
+ return $this;
+ } // setCreatedAt()
+
+ /**
+ * Sets the value of [updated_at] column to a normalized version of the date/time value specified.
+ *
+ * @param mixed $v string, integer (timestamp), or \DateTime value.
+ * Empty strings are treated as NULL.
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function setUpdatedAt($v)
+ {
+ $dt = PropelDateTime::newInstance($v, null, '\DateTime');
+ if ($this->updated_at !== null || $dt !== null) {
+ if ($dt !== $this->updated_at) {
+ $this->updated_at = $dt;
+ $this->modifiedColumns[] = ModuleImageTableMap::UPDATED_AT;
+ }
+ } // if either are not null
+
+
+ return $this;
+ } // setUpdatedAt()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ModuleImageTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ModuleImageTableMap::translateFieldName('ModuleId', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->module_id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ModuleImageTableMap::translateFieldName('File', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->file = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ModuleImageTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->position = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ModuleImageTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ if ($col === '0000-00-00 00:00:00') {
+ $col = null;
+ }
+ $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ModuleImageTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
+ if ($col === '0000-00-00 00:00:00') {
+ $col = null;
+ }
+ $this->updated_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 6; // 6 = ModuleImageTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \Thelia\Model\ModuleImage object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ if ($this->aModule !== null && $this->module_id !== $this->aModule->getId()) {
+ $this->aModule = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(ModuleImageTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildModuleImageQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->aModule = null;
+ $this->collModuleImageI18ns = null;
+
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see ModuleImage::setDeleted()
+ * @see ModuleImage::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildModuleImageQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ // timestampable behavior
+ if (!$this->isColumnModified(ModuleImageTableMap::CREATED_AT)) {
+ $this->setCreatedAt(time());
+ }
+ if (!$this->isColumnModified(ModuleImageTableMap::UPDATED_AT)) {
+ $this->setUpdatedAt(time());
+ }
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ // timestampable behavior
+ if ($this->isModified() && !$this->isColumnModified(ModuleImageTableMap::UPDATED_AT)) {
+ $this->setUpdatedAt(time());
+ }
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ ModuleImageTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+ // We call the save method on the following object(s) if they
+ // were passed to this object by their corresponding set
+ // method. This object relates to these object(s) by a
+ // foreign key reference.
+
+ if ($this->aModule !== null) {
+ if ($this->aModule->isModified() || $this->aModule->isNew()) {
+ $affectedRows += $this->aModule->save($con);
+ }
+ $this->setModule($this->aModule);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ if ($this->moduleImageI18nsScheduledForDeletion !== null) {
+ if (!$this->moduleImageI18nsScheduledForDeletion->isEmpty()) {
+ \Thelia\Model\ModuleImageI18nQuery::create()
+ ->filterByPrimaryKeys($this->moduleImageI18nsScheduledForDeletion->getPrimaryKeys(false))
+ ->delete($con);
+ $this->moduleImageI18nsScheduledForDeletion = null;
+ }
+ }
+
+ if ($this->collModuleImageI18ns !== null) {
+ foreach ($this->collModuleImageI18ns as $referrerFK) {
+ if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+ $this->modifiedColumns[] = ModuleImageTableMap::ID;
+ if (null !== $this->id) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key (' . ModuleImageTableMap::ID . ')');
+ }
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(ModuleImageTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::MODULE_ID)) {
+ $modifiedColumns[':p' . $index++] = 'MODULE_ID';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::FILE)) {
+ $modifiedColumns[':p' . $index++] = 'FILE';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::POSITION)) {
+ $modifiedColumns[':p' . $index++] = 'POSITION';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::CREATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'CREATED_AT';
+ }
+ if ($this->isColumnModified(ModuleImageTableMap::UPDATED_AT)) {
+ $modifiedColumns[':p' . $index++] = 'UPDATED_AT';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO module_image (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'MODULE_ID':
+ $stmt->bindValue($identifier, $this->module_id, PDO::PARAM_INT);
+ break;
+ case 'FILE':
+ $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR);
+ break;
+ case 'POSITION':
+ $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
+ break;
+ case 'CREATED_AT':
+ $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
+ break;
+ case 'UPDATED_AT':
+ $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ try {
+ $pk = $con->lastInsertId();
+ } catch (Exception $e) {
+ throw new PropelException('Unable to get autoincrement id.', 0, $e);
+ }
+ $this->setId($pk);
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = ModuleImageTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getModuleId();
+ break;
+ case 2:
+ return $this->getFile();
+ break;
+ case 3:
+ return $this->getPosition();
+ break;
+ case 4:
+ return $this->getCreatedAt();
+ break;
+ case 5:
+ return $this->getUpdatedAt();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['ModuleImage'][$this->getPrimaryKey()])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['ModuleImage'][$this->getPrimaryKey()] = true;
+ $keys = ModuleImageTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getModuleId(),
+ $keys[2] => $this->getFile(),
+ $keys[3] => $this->getPosition(),
+ $keys[4] => $this->getCreatedAt(),
+ $keys[5] => $this->getUpdatedAt(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach($virtualColumns as $key => $virtualColumn)
+ {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aModule) {
+ $result['Module'] = $this->aModule->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ if (null !== $this->collModuleImageI18ns) {
+ $result['ModuleImageI18ns'] = $this->collModuleImageI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = ModuleImageTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setModuleId($value);
+ break;
+ case 2:
+ $this->setFile($value);
+ break;
+ case 3:
+ $this->setPosition($value);
+ break;
+ case 4:
+ $this->setCreatedAt($value);
+ break;
+ case 5:
+ $this->setUpdatedAt($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = ModuleImageTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setModuleId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setFile($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setPosition($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setUpdatedAt($arr[$keys[5]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ModuleImageTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(ModuleImageTableMap::ID)) $criteria->add(ModuleImageTableMap::ID, $this->id);
+ if ($this->isColumnModified(ModuleImageTableMap::MODULE_ID)) $criteria->add(ModuleImageTableMap::MODULE_ID, $this->module_id);
+ if ($this->isColumnModified(ModuleImageTableMap::FILE)) $criteria->add(ModuleImageTableMap::FILE, $this->file);
+ if ($this->isColumnModified(ModuleImageTableMap::POSITION)) $criteria->add(ModuleImageTableMap::POSITION, $this->position);
+ if ($this->isColumnModified(ModuleImageTableMap::CREATED_AT)) $criteria->add(ModuleImageTableMap::CREATED_AT, $this->created_at);
+ if ($this->isColumnModified(ModuleImageTableMap::UPDATED_AT)) $criteria->add(ModuleImageTableMap::UPDATED_AT, $this->updated_at);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ModuleImageTableMap::DATABASE_NAME);
+ $criteria->add(ModuleImageTableMap::ID, $this->id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+ /**
+ * Generic method to set the primary key (id column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return null === $this->getId();
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \Thelia\Model\ModuleImage (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setModuleId($this->getModuleId());
+ $copyObj->setFile($this->getFile());
+ $copyObj->setPosition($this->getPosition());
+ $copyObj->setCreatedAt($this->getCreatedAt());
+ $copyObj->setUpdatedAt($this->getUpdatedAt());
+
+ if ($deepCopy) {
+ // important: temporarily setNew(false) because this affects the behavior of
+ // the getter/setter methods for fkey referrer objects.
+ $copyObj->setNew(false);
+
+ foreach ($this->getModuleImageI18ns() as $relObj) {
+ if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
+ $copyObj->addModuleImageI18n($relObj->copy($deepCopy));
+ }
+ }
+
+ } // if ($deepCopy)
+
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \Thelia\Model\ModuleImage Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Declares an association between this object and a ChildModule object.
+ *
+ * @param ChildModule $v
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setModule(ChildModule $v = null)
+ {
+ if ($v === null) {
+ $this->setModuleId(NULL);
+ } else {
+ $this->setModuleId($v->getId());
+ }
+
+ $this->aModule = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildModule object, it will not be re-added.
+ if ($v !== null) {
+ $v->addModuleImage($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildModule object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildModule The associated ChildModule object.
+ * @throws PropelException
+ */
+ public function getModule(ConnectionInterface $con = null)
+ {
+ if ($this->aModule === null && ($this->module_id !== null)) {
+ $this->aModule = ChildModuleQuery::create()->findPk($this->module_id, $con);
+ /* The following can be used additionally to
+ guarantee the related object contains a reference
+ to this object. This level of coupling may, however, be
+ undesirable since it could result in an only partially populated collection
+ in the referenced object.
+ $this->aModule->addModuleImages($this);
+ */
+ }
+
+ return $this->aModule;
+ }
+
+
+ /**
+ * Initializes a collection based on the name of a relation.
+ * Avoids crafting an 'init[$relationName]s' method name
+ * that wouldn't work when StandardEnglishPluralizer is used.
+ *
+ * @param string $relationName The name of the relation to initialize
+ * @return void
+ */
+ public function initRelation($relationName)
+ {
+ if ('ModuleImageI18n' == $relationName) {
+ return $this->initModuleImageI18ns();
+ }
+ }
+
+ /**
+ * Clears out the collModuleImageI18ns collection
+ *
+ * This does not modify the database; however, it will remove any associated objects, causing
+ * them to be refetched by subsequent calls to accessor method.
+ *
+ * @return void
+ * @see addModuleImageI18ns()
+ */
+ public function clearModuleImageI18ns()
+ {
+ $this->collModuleImageI18ns = null; // important to set this to NULL since that means it is uninitialized
+ }
+
+ /**
+ * Reset is the collModuleImageI18ns collection loaded partially.
+ */
+ public function resetPartialModuleImageI18ns($v = true)
+ {
+ $this->collModuleImageI18nsPartial = $v;
+ }
+
+ /**
+ * Initializes the collModuleImageI18ns collection.
+ *
+ * By default this just sets the collModuleImageI18ns collection to an empty array (like clearcollModuleImageI18ns());
+ * however, you may wish to override this method in your stub class to provide setting appropriate
+ * to your application -- for example, setting the initial array to the values stored in database.
+ *
+ * @param boolean $overrideExisting If set to true, the method call initializes
+ * the collection even if it is not empty
+ *
+ * @return void
+ */
+ public function initModuleImageI18ns($overrideExisting = true)
+ {
+ if (null !== $this->collModuleImageI18ns && !$overrideExisting) {
+ return;
+ }
+ $this->collModuleImageI18ns = new ObjectCollection();
+ $this->collModuleImageI18ns->setModel('\Thelia\Model\ModuleImageI18n');
+ }
+
+ /**
+ * Gets an array of ChildModuleImageI18n objects which contain a foreign key that references this object.
+ *
+ * If the $criteria is not null, it is used to always fetch the results from the database.
+ * Otherwise the results are fetched from the database the first time, then cached.
+ * Next time the same method is called without $criteria, the cached collection is returned.
+ * If this ChildModuleImage is new, it will return
+ * an empty collection or the current collection; the criteria is ignored on a new object.
+ *
+ * @param Criteria $criteria optional Criteria object to narrow the query
+ * @param ConnectionInterface $con optional connection object
+ * @return Collection|ChildModuleImageI18n[] List of ChildModuleImageI18n objects
+ * @throws PropelException
+ */
+ public function getModuleImageI18ns($criteria = null, ConnectionInterface $con = null)
+ {
+ $partial = $this->collModuleImageI18nsPartial && !$this->isNew();
+ if (null === $this->collModuleImageI18ns || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collModuleImageI18ns) {
+ // return empty collection
+ $this->initModuleImageI18ns();
+ } else {
+ $collModuleImageI18ns = ChildModuleImageI18nQuery::create(null, $criteria)
+ ->filterByModuleImage($this)
+ ->find($con);
+
+ if (null !== $criteria) {
+ if (false !== $this->collModuleImageI18nsPartial && count($collModuleImageI18ns)) {
+ $this->initModuleImageI18ns(false);
+
+ foreach ($collModuleImageI18ns as $obj) {
+ if (false == $this->collModuleImageI18ns->contains($obj)) {
+ $this->collModuleImageI18ns->append($obj);
+ }
+ }
+
+ $this->collModuleImageI18nsPartial = true;
+ }
+
+ $collModuleImageI18ns->getInternalIterator()->rewind();
+
+ return $collModuleImageI18ns;
+ }
+
+ if ($partial && $this->collModuleImageI18ns) {
+ foreach ($this->collModuleImageI18ns as $obj) {
+ if ($obj->isNew()) {
+ $collModuleImageI18ns[] = $obj;
+ }
+ }
+ }
+
+ $this->collModuleImageI18ns = $collModuleImageI18ns;
+ $this->collModuleImageI18nsPartial = false;
+ }
+ }
+
+ return $this->collModuleImageI18ns;
+ }
+
+ /**
+ * Sets a collection of ModuleImageI18n objects related by a one-to-many relationship
+ * to the current object.
+ * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
+ * and new objects from the given Propel collection.
+ *
+ * @param Collection $moduleImageI18ns A Propel collection.
+ * @param ConnectionInterface $con Optional connection object
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function setModuleImageI18ns(Collection $moduleImageI18ns, ConnectionInterface $con = null)
+ {
+ $moduleImageI18nsToDelete = $this->getModuleImageI18ns(new Criteria(), $con)->diff($moduleImageI18ns);
+
+
+ //since at least one column in the foreign key is at the same time a PK
+ //we can not just set a PK to NULL in the lines below. We have to store
+ //a backup of all values, so we are able to manipulate these items based on the onDelete value later.
+ $this->moduleImageI18nsScheduledForDeletion = clone $moduleImageI18nsToDelete;
+
+ foreach ($moduleImageI18nsToDelete as $moduleImageI18nRemoved) {
+ $moduleImageI18nRemoved->setModuleImage(null);
+ }
+
+ $this->collModuleImageI18ns = null;
+ foreach ($moduleImageI18ns as $moduleImageI18n) {
+ $this->addModuleImageI18n($moduleImageI18n);
+ }
+
+ $this->collModuleImageI18ns = $moduleImageI18ns;
+ $this->collModuleImageI18nsPartial = false;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of related ModuleImageI18n objects.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct
+ * @param ConnectionInterface $con
+ * @return int Count of related ModuleImageI18n objects.
+ * @throws PropelException
+ */
+ public function countModuleImageI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
+ {
+ $partial = $this->collModuleImageI18nsPartial && !$this->isNew();
+ if (null === $this->collModuleImageI18ns || null !== $criteria || $partial) {
+ if ($this->isNew() && null === $this->collModuleImageI18ns) {
+ return 0;
+ }
+
+ if ($partial && !$criteria) {
+ return count($this->getModuleImageI18ns());
+ }
+
+ $query = ChildModuleImageI18nQuery::create(null, $criteria);
+ if ($distinct) {
+ $query->distinct();
+ }
+
+ return $query
+ ->filterByModuleImage($this)
+ ->count($con);
+ }
+
+ return count($this->collModuleImageI18ns);
+ }
+
+ /**
+ * Method called to associate a ChildModuleImageI18n object to this object
+ * through the ChildModuleImageI18n foreign key attribute.
+ *
+ * @param ChildModuleImageI18n $l ChildModuleImageI18n
+ * @return \Thelia\Model\ModuleImage The current object (for fluent API support)
+ */
+ public function addModuleImageI18n(ChildModuleImageI18n $l)
+ {
+ if ($l && $locale = $l->getLocale()) {
+ $this->setLocale($locale);
+ $this->currentTranslations[$locale] = $l;
+ }
+ if ($this->collModuleImageI18ns === null) {
+ $this->initModuleImageI18ns();
+ $this->collModuleImageI18nsPartial = true;
+ }
+
+ if (!in_array($l, $this->collModuleImageI18ns->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
+ $this->doAddModuleImageI18n($l);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param ModuleImageI18n $moduleImageI18n The moduleImageI18n object to add.
+ */
+ protected function doAddModuleImageI18n($moduleImageI18n)
+ {
+ $this->collModuleImageI18ns[]= $moduleImageI18n;
+ $moduleImageI18n->setModuleImage($this);
+ }
+
+ /**
+ * @param ModuleImageI18n $moduleImageI18n The moduleImageI18n object to remove.
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function removeModuleImageI18n($moduleImageI18n)
+ {
+ if ($this->getModuleImageI18ns()->contains($moduleImageI18n)) {
+ $this->collModuleImageI18ns->remove($this->collModuleImageI18ns->search($moduleImageI18n));
+ if (null === $this->moduleImageI18nsScheduledForDeletion) {
+ $this->moduleImageI18nsScheduledForDeletion = clone $this->collModuleImageI18ns;
+ $this->moduleImageI18nsScheduledForDeletion->clear();
+ }
+ $this->moduleImageI18nsScheduledForDeletion[]= clone $moduleImageI18n;
+ $moduleImageI18n->setModuleImage(null);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->module_id = null;
+ $this->file = null;
+ $this->position = null;
+ $this->created_at = null;
+ $this->updated_at = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ if ($this->collModuleImageI18ns) {
+ foreach ($this->collModuleImageI18ns as $o) {
+ $o->clearAllReferences($deep);
+ }
+ }
+ } // if ($deep)
+
+ // i18n behavior
+ $this->currentLocale = 'en_US';
+ $this->currentTranslations = null;
+
+ if ($this->collModuleImageI18ns instanceof Collection) {
+ $this->collModuleImageI18ns->clearIterator();
+ }
+ $this->collModuleImageI18ns = null;
+ $this->aModule = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(ModuleImageTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ // timestampable behavior
+
+ /**
+ * Mark the current object so that the update date doesn't get updated during next save
+ *
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function keepUpdateDateUnchanged()
+ {
+ $this->modifiedColumns[] = ModuleImageTableMap::UPDATED_AT;
+
+ return $this;
+ }
+
+ // i18n behavior
+
+ /**
+ * Sets the locale for translations
+ *
+ * @param string $locale Locale to use for the translation, e.g. 'fr_FR'
+ *
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function setLocale($locale = 'en_US')
+ {
+ $this->currentLocale = $locale;
+
+ return $this;
+ }
+
+ /**
+ * Gets the locale for translations
+ *
+ * @return string $locale Locale to use for the translation, e.g. 'fr_FR'
+ */
+ public function getLocale()
+ {
+ return $this->currentLocale;
+ }
+
+ /**
+ * Returns the current translation for a given locale
+ *
+ * @param string $locale Locale to use for the translation, e.g. 'fr_FR'
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildModuleImageI18n */
+ public function getTranslation($locale = 'en_US', ConnectionInterface $con = null)
+ {
+ if (!isset($this->currentTranslations[$locale])) {
+ if (null !== $this->collModuleImageI18ns) {
+ foreach ($this->collModuleImageI18ns as $translation) {
+ if ($translation->getLocale() == $locale) {
+ $this->currentTranslations[$locale] = $translation;
+
+ return $translation;
+ }
+ }
+ }
+ if ($this->isNew()) {
+ $translation = new ChildModuleImageI18n();
+ $translation->setLocale($locale);
+ } else {
+ $translation = ChildModuleImageI18nQuery::create()
+ ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
+ ->findOneOrCreate($con);
+ $this->currentTranslations[$locale] = $translation;
+ }
+ $this->addModuleImageI18n($translation);
+ }
+
+ return $this->currentTranslations[$locale];
+ }
+
+ /**
+ * Remove the translation for a given locale
+ *
+ * @param string $locale Locale to use for the translation, e.g. 'fr_FR'
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildModuleImage The current object (for fluent API support)
+ */
+ public function removeTranslation($locale = 'en_US', ConnectionInterface $con = null)
+ {
+ if (!$this->isNew()) {
+ ChildModuleImageI18nQuery::create()
+ ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
+ ->delete($con);
+ }
+ if (isset($this->currentTranslations[$locale])) {
+ unset($this->currentTranslations[$locale]);
+ }
+ foreach ($this->collModuleImageI18ns as $key => $translation) {
+ if ($translation->getLocale() == $locale) {
+ unset($this->collModuleImageI18ns[$key]);
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the current translation
+ *
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildModuleImageI18n */
+ public function getCurrentTranslation(ConnectionInterface $con = null)
+ {
+ return $this->getTranslation($this->getLocale(), $con);
+ }
+
+
+ /**
+ * Get the [title] column value.
+ *
+ * @return string
+ */
+ public function getTitle()
+ {
+ return $this->getCurrentTranslation()->getTitle();
+ }
+
+
+ /**
+ * Set the value of [title] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setTitle($v)
+ { $this->getCurrentTranslation()->setTitle($v);
+
+ return $this;
+ }
+
+
+ /**
+ * Get the [description] column value.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->getCurrentTranslation()->getDescription();
+ }
+
+
+ /**
+ * Set the value of [description] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setDescription($v)
+ { $this->getCurrentTranslation()->setDescription($v);
+
+ return $this;
+ }
+
+
+ /**
+ * Get the [chapo] column value.
+ *
+ * @return string
+ */
+ public function getChapo()
+ {
+ return $this->getCurrentTranslation()->getChapo();
+ }
+
+
+ /**
+ * Set the value of [chapo] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setChapo($v)
+ { $this->getCurrentTranslation()->setChapo($v);
+
+ return $this;
+ }
+
+
+ /**
+ * Get the [postscriptum] column value.
+ *
+ * @return string
+ */
+ public function getPostscriptum()
+ {
+ return $this->getCurrentTranslation()->getPostscriptum();
+ }
+
+
+ /**
+ * Set the value of [postscriptum] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setPostscriptum($v)
+ { $this->getCurrentTranslation()->setPostscriptum($v);
+
+ return $this;
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/core/lib/Thelia/Model/Base/ModuleImageI18n.php b/core/lib/Thelia/Model/Base/ModuleImageI18n.php
new file mode 100644
index 000000000..2425b4e65
--- /dev/null
+++ b/core/lib/Thelia/Model/Base/ModuleImageI18n.php
@@ -0,0 +1,1439 @@
+locale = 'en_US';
+ }
+
+ /**
+ * Initializes internal state of Thelia\Model\Base\ModuleImageI18n object.
+ * @see applyDefaults()
+ */
+ public function __construct()
+ {
+ $this->applyDefaultValues();
+ }
+
+ /**
+ * Returns whether the object has been modified.
+ *
+ * @return boolean True if the object has been modified.
+ */
+ public function isModified()
+ {
+ return !empty($this->modifiedColumns);
+ }
+
+ /**
+ * Has specified column been modified?
+ *
+ * @param string $col column fully qualified name (TableMap::TYPE_COLNAME), e.g. Book::AUTHOR_ID
+ * @return boolean True if $col has been modified.
+ */
+ public function isColumnModified($col)
+ {
+ return in_array($col, $this->modifiedColumns);
+ }
+
+ /**
+ * Get the columns that have been modified in this object.
+ * @return array A unique list of the modified column names for this object.
+ */
+ public function getModifiedColumns()
+ {
+ return array_unique($this->modifiedColumns);
+ }
+
+ /**
+ * Returns whether the object has ever been saved. This will
+ * be false, if the object was retrieved from storage or was created
+ * and then saved.
+ *
+ * @return true, if the object has never been persisted.
+ */
+ public function isNew()
+ {
+ return $this->new;
+ }
+
+ /**
+ * Setter for the isNew attribute. This method will be called
+ * by Propel-generated children and objects.
+ *
+ * @param boolean $b the state of the object.
+ */
+ public function setNew($b)
+ {
+ $this->new = (Boolean) $b;
+ }
+
+ /**
+ * Whether this object has been deleted.
+ * @return boolean The deleted state of this object.
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Specify whether this object has been deleted.
+ * @param boolean $b The deleted state of this object.
+ * @return void
+ */
+ public function setDeleted($b)
+ {
+ $this->deleted = (Boolean) $b;
+ }
+
+ /**
+ * Sets the modified state for the object to be false.
+ * @param string $col If supplied, only the specified column is reset.
+ * @return void
+ */
+ public function resetModified($col = null)
+ {
+ if (null !== $col) {
+ while (false !== ($offset = array_search($col, $this->modifiedColumns))) {
+ array_splice($this->modifiedColumns, $offset, 1);
+ }
+ } else {
+ $this->modifiedColumns = array();
+ }
+ }
+
+ /**
+ * Compares this with another ModuleImageI18n instance. If
+ * obj is an instance of ModuleImageI18n, delegates to
+ * equals(ModuleImageI18n). Otherwise, returns false.
+ *
+ * @param obj The object to compare to.
+ * @return Whether equal to the object specified.
+ */
+ public function equals($obj)
+ {
+ $thisclazz = get_class($this);
+ if (!is_object($obj) || !($obj instanceof $thisclazz)) {
+ return false;
+ }
+
+ if ($this === $obj) {
+ return true;
+ }
+
+ if (null === $this->getPrimaryKey()
+ || null === $obj->getPrimaryKey()) {
+ return false;
+ }
+
+ return $this->getPrimaryKey() === $obj->getPrimaryKey();
+ }
+
+ /**
+ * If the primary key is not null, return the hashcode of the
+ * primary key. Otherwise, return the hash code of the object.
+ *
+ * @return int Hashcode
+ */
+ public function hashCode()
+ {
+ if (null !== $this->getPrimaryKey()) {
+ return crc32(serialize($this->getPrimaryKey()));
+ }
+
+ return crc32(serialize(clone $this));
+ }
+
+ /**
+ * Get the associative array of the virtual columns in this object
+ *
+ * @param string $name The virtual column name
+ *
+ * @return array
+ */
+ public function getVirtualColumns()
+ {
+ return $this->virtualColumns;
+ }
+
+ /**
+ * Checks the existence of a virtual column in this object
+ *
+ * @return boolean
+ */
+ public function hasVirtualColumn($name)
+ {
+ return array_key_exists($name, $this->virtualColumns);
+ }
+
+ /**
+ * Get the value of a virtual column in this object
+ *
+ * @return mixed
+ */
+ public function getVirtualColumn($name)
+ {
+ if (!$this->hasVirtualColumn($name)) {
+ throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
+ }
+
+ return $this->virtualColumns[$name];
+ }
+
+ /**
+ * Set the value of a virtual column in this object
+ *
+ * @param string $name The virtual column name
+ * @param mixed $value The value to give to the virtual column
+ *
+ * @return ModuleImageI18n The current object, for fluid interface
+ */
+ public function setVirtualColumn($name, $value)
+ {
+ $this->virtualColumns[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Logs a message using Propel::log().
+ *
+ * @param string $msg
+ * @param int $priority One of the Propel::LOG_* logging levels
+ * @return boolean
+ */
+ protected function log($msg, $priority = Propel::LOG_INFO)
+ {
+ return Propel::log(get_class($this) . ': ' . $msg, $priority);
+ }
+
+ /**
+ * Populate the current object from a string, using a given parser format
+ *
+ * $book = new Book();
+ * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance,
+ * or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param string $data The source data to import from
+ *
+ * @return ModuleImageI18n The current object, for fluid interface
+ */
+ public function importFrom($parser, $data)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $this->fromArray($parser->toArray($data), TableMap::TYPE_PHPNAME);
+ }
+
+ /**
+ * Export the current object properties to a string, using a given parser format
+ *
+ * $book = BookQuery::create()->findPk(9012);
+ * echo $book->exportTo('JSON');
+ * => {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
+ *
+ *
+ * @param mixed $parser A AbstractParser instance, or a format name ('XML', 'YAML', 'JSON', 'CSV')
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy load(ed) columns. Defaults to TRUE.
+ * @return string The exported data
+ */
+ public function exportTo($parser, $includeLazyLoadColumns = true)
+ {
+ if (!$parser instanceof AbstractParser) {
+ $parser = AbstractParser::getParser($parser);
+ }
+
+ return $parser->fromArray($this->toArray(TableMap::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
+ }
+
+ /**
+ * Clean up internal collections prior to serializing
+ * Avoids recursive loops that turn into segmentation faults when serializing
+ */
+ public function __sleep()
+ {
+ $this->clearAllReferences();
+
+ return array_keys(get_object_vars($this));
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+ /**
+ * Get the [locale] column value.
+ *
+ * @return string
+ */
+ public function getLocale()
+ {
+
+ return $this->locale;
+ }
+
+ /**
+ * Get the [title] column value.
+ *
+ * @return string
+ */
+ public function getTitle()
+ {
+
+ return $this->title;
+ }
+
+ /**
+ * Get the [description] column value.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+
+ return $this->description;
+ }
+
+ /**
+ * Get the [chapo] column value.
+ *
+ * @return string
+ */
+ public function getChapo()
+ {
+
+ return $this->chapo;
+ }
+
+ /**
+ * Get the [postscriptum] column value.
+ *
+ * @return string
+ */
+ public function getPostscriptum()
+ {
+
+ return $this->postscriptum;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::ID;
+ }
+
+ if ($this->aModuleImage !== null && $this->aModuleImage->getId() !== $v) {
+ $this->aModuleImage = null;
+ }
+
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [locale] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setLocale($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->locale !== $v) {
+ $this->locale = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::LOCALE;
+ }
+
+
+ return $this;
+ } // setLocale()
+
+ /**
+ * Set the value of [title] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setTitle($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->title !== $v) {
+ $this->title = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::TITLE;
+ }
+
+
+ return $this;
+ } // setTitle()
+
+ /**
+ * Set the value of [description] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setDescription($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->description !== $v) {
+ $this->description = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::DESCRIPTION;
+ }
+
+
+ return $this;
+ } // setDescription()
+
+ /**
+ * Set the value of [chapo] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setChapo($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->chapo !== $v) {
+ $this->chapo = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::CHAPO;
+ }
+
+
+ return $this;
+ } // setChapo()
+
+ /**
+ * Set the value of [postscriptum] column.
+ *
+ * @param string $v new value
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ */
+ public function setPostscriptum($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->postscriptum !== $v) {
+ $this->postscriptum = $v;
+ $this->modifiedColumns[] = ModuleImageI18nTableMap::POSTSCRIPTUM;
+ }
+
+
+ return $this;
+ } // setPostscriptum()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ if ($this->locale !== 'en_US') {
+ return false;
+ }
+
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by DataFetcher->fetch().
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
+ {
+ try {
+
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ModuleImageI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->id = (null !== $col) ? (int) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ModuleImageI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->locale = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ModuleImageI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->title = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ModuleImageI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->description = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ModuleImageI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->chapo = (null !== $col) ? (string) $col : null;
+
+ $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ModuleImageI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
+ $this->postscriptum = (null !== $col) ? (string) $col : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 6; // 6 = ModuleImageI18nTableMap::NUM_HYDRATE_COLUMNS.
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating \Thelia\Model\ModuleImageI18n object", 0, $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+ if ($this->aModuleImage !== null && $this->id !== $this->aModuleImage->getId()) {
+ $this->aModuleImage = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param ConnectionInterface $con (optional) The ConnectionInterface connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $dataFetcher = ChildModuleImageI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
+ $row = $dataFetcher->fetch();
+ $dataFetcher->close();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->aModuleImage = null;
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param ConnectionInterface $con
+ * @return void
+ * @throws PropelException
+ * @see ModuleImageI18n::setDeleted()
+ * @see ModuleImageI18n::isDeleted()
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ try {
+ $deleteQuery = ChildModuleImageI18nQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey());
+ $ret = $this->preDelete($con);
+ if ($ret) {
+ $deleteQuery->delete($con);
+ $this->postDelete($con);
+ $con->commit();
+ $this->setDeleted(true);
+ } else {
+ $con->commit();
+ }
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Persists this object to the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All modified related objects will also be persisted in the doSave()
+ * method. This method wraps all precipitate database operations in a
+ * single transaction.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save(ConnectionInterface $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+
+ $con->beginTransaction();
+ $isInsert = $this->isNew();
+ try {
+ $ret = $this->preSave($con);
+ if ($isInsert) {
+ $ret = $ret && $this->preInsert($con);
+ } else {
+ $ret = $ret && $this->preUpdate($con);
+ }
+ if ($ret) {
+ $affectedRows = $this->doSave($con);
+ if ($isInsert) {
+ $this->postInsert($con);
+ } else {
+ $this->postUpdate($con);
+ }
+ $this->postSave($con);
+ ModuleImageI18nTableMap::addInstanceToPool($this);
+ } else {
+ $affectedRows = 0;
+ }
+ $con->commit();
+
+ return $affectedRows;
+ } catch (Exception $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ /**
+ * Performs the work of inserting or updating the row in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param ConnectionInterface $con
+ * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave(ConnectionInterface $con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+ // We call the save method on the following object(s) if they
+ // were passed to this object by their corresponding set
+ // method. This object relates to these object(s) by a
+ // foreign key reference.
+
+ if ($this->aModuleImage !== null) {
+ if ($this->aModuleImage->isModified() || $this->aModuleImage->isNew()) {
+ $affectedRows += $this->aModuleImage->save($con);
+ }
+ $this->setModuleImage($this->aModuleImage);
+ }
+
+ if ($this->isNew() || $this->isModified()) {
+ // persist changes
+ if ($this->isNew()) {
+ $this->doInsert($con);
+ } else {
+ $this->doUpdate($con);
+ }
+ $affectedRows += 1;
+ $this->resetModified();
+ }
+
+ $this->alreadyInSave = false;
+
+ }
+
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Insert the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @throws PropelException
+ * @see doSave()
+ */
+ protected function doInsert(ConnectionInterface $con)
+ {
+ $modifiedColumns = array();
+ $index = 0;
+
+
+ // check the columns in natural order for more readable SQL queries
+ if ($this->isColumnModified(ModuleImageI18nTableMap::ID)) {
+ $modifiedColumns[':p' . $index++] = 'ID';
+ }
+ if ($this->isColumnModified(ModuleImageI18nTableMap::LOCALE)) {
+ $modifiedColumns[':p' . $index++] = 'LOCALE';
+ }
+ if ($this->isColumnModified(ModuleImageI18nTableMap::TITLE)) {
+ $modifiedColumns[':p' . $index++] = 'TITLE';
+ }
+ if ($this->isColumnModified(ModuleImageI18nTableMap::DESCRIPTION)) {
+ $modifiedColumns[':p' . $index++] = 'DESCRIPTION';
+ }
+ if ($this->isColumnModified(ModuleImageI18nTableMap::CHAPO)) {
+ $modifiedColumns[':p' . $index++] = 'CHAPO';
+ }
+ if ($this->isColumnModified(ModuleImageI18nTableMap::POSTSCRIPTUM)) {
+ $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
+ }
+
+ $sql = sprintf(
+ 'INSERT INTO module_image_i18n (%s) VALUES (%s)',
+ implode(', ', $modifiedColumns),
+ implode(', ', array_keys($modifiedColumns))
+ );
+
+ try {
+ $stmt = $con->prepare($sql);
+ foreach ($modifiedColumns as $identifier => $columnName) {
+ switch ($columnName) {
+ case 'ID':
+ $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
+ break;
+ case 'LOCALE':
+ $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR);
+ break;
+ case 'TITLE':
+ $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
+ break;
+ case 'DESCRIPTION':
+ $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
+ break;
+ case 'CHAPO':
+ $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR);
+ break;
+ case 'POSTSCRIPTUM':
+ $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR);
+ break;
+ }
+ }
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
+ }
+
+ $this->setNew(false);
+ }
+
+ /**
+ * Update the row in the database.
+ *
+ * @param ConnectionInterface $con
+ *
+ * @return Integer Number of updated rows
+ * @see doSave()
+ */
+ protected function doUpdate(ConnectionInterface $con)
+ {
+ $selectCriteria = $this->buildPkeyCriteria();
+ $valuesCriteria = $this->buildCriteria();
+
+ return $selectCriteria->doUpdate($valuesCriteria, $con);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = ModuleImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+ $field = $this->getByPosition($pos);
+
+ return $field;
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch ($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getLocale();
+ break;
+ case 2:
+ return $this->getTitle();
+ break;
+ case 3:
+ return $this->getDescription();
+ break;
+ case 4:
+ return $this->getChapo();
+ break;
+ case 5:
+ return $this->getPostscriptum();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
+ * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
+ * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
+ *
+ * @return array an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
+ {
+ if (isset($alreadyDumpedObjects['ModuleImageI18n'][serialize($this->getPrimaryKey())])) {
+ return '*RECURSION*';
+ }
+ $alreadyDumpedObjects['ModuleImageI18n'][serialize($this->getPrimaryKey())] = true;
+ $keys = ModuleImageI18nTableMap::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getLocale(),
+ $keys[2] => $this->getTitle(),
+ $keys[3] => $this->getDescription(),
+ $keys[4] => $this->getChapo(),
+ $keys[5] => $this->getPostscriptum(),
+ );
+ $virtualColumns = $this->virtualColumns;
+ foreach($virtualColumns as $key => $virtualColumn)
+ {
+ $result[$key] = $virtualColumn;
+ }
+
+ if ($includeForeignObjects) {
+ if (null !== $this->aModuleImage) {
+ $result['ModuleImage'] = $this->aModuleImage->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * Defaults to TableMap::TYPE_PHPNAME.
+ * @return void
+ */
+ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
+ {
+ $pos = ModuleImageI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
+
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch ($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setLocale($value);
+ break;
+ case 2:
+ $this->setTitle($value);
+ break;
+ case 3:
+ $this->setDescription($value);
+ break;
+ case 4:
+ $this->setChapo($value);
+ break;
+ case 5:
+ $this->setPostscriptum($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ * The default key type is the column's TableMap::TYPE_PHPNAME.
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
+ {
+ $keys = ModuleImageI18nTableMap::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setLocale($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setTitle($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setDescription($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setChapo($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setPostscriptum($arr[$keys[5]]);
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ModuleImageI18nTableMap::DATABASE_NAME);
+
+ if ($this->isColumnModified(ModuleImageI18nTableMap::ID)) $criteria->add(ModuleImageI18nTableMap::ID, $this->id);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::LOCALE)) $criteria->add(ModuleImageI18nTableMap::LOCALE, $this->locale);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::TITLE)) $criteria->add(ModuleImageI18nTableMap::TITLE, $this->title);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::DESCRIPTION)) $criteria->add(ModuleImageI18nTableMap::DESCRIPTION, $this->description);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::CHAPO)) $criteria->add(ModuleImageI18nTableMap::CHAPO, $this->chapo);
+ if ($this->isColumnModified(ModuleImageI18nTableMap::POSTSCRIPTUM)) $criteria->add(ModuleImageI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ModuleImageI18nTableMap::DATABASE_NAME);
+ $criteria->add(ModuleImageI18nTableMap::ID, $this->id);
+ $criteria->add(ModuleImageI18nTableMap::LOCALE, $this->locale);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+ $pks[0] = $this->getId();
+ $pks[1] = $this->getLocale();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+ $this->setId($keys[0]);
+ $this->setLocale($keys[1]);
+ }
+
+ /**
+ * Returns true if the primary key for this object is null.
+ * @return boolean
+ */
+ public function isPrimaryKeyNull()
+ {
+
+ return (null === $this->getId()) && (null === $this->getLocale());
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of \Thelia\Model\ModuleImageI18n (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
+ {
+ $copyObj->setId($this->getId());
+ $copyObj->setLocale($this->getLocale());
+ $copyObj->setTitle($this->getTitle());
+ $copyObj->setDescription($this->getDescription());
+ $copyObj->setChapo($this->getChapo());
+ $copyObj->setPostscriptum($this->getPostscriptum());
+ if ($makeNew) {
+ $copyObj->setNew(true);
+ }
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return \Thelia\Model\ModuleImageI18n Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+
+ return $copyObj;
+ }
+
+ /**
+ * Declares an association between this object and a ChildModuleImage object.
+ *
+ * @param ChildModuleImage $v
+ * @return \Thelia\Model\ModuleImageI18n The current object (for fluent API support)
+ * @throws PropelException
+ */
+ public function setModuleImage(ChildModuleImage $v = null)
+ {
+ if ($v === null) {
+ $this->setId(NULL);
+ } else {
+ $this->setId($v->getId());
+ }
+
+ $this->aModuleImage = $v;
+
+ // Add binding for other direction of this n:n relationship.
+ // If this object has already been added to the ChildModuleImage object, it will not be re-added.
+ if ($v !== null) {
+ $v->addModuleImageI18n($this);
+ }
+
+
+ return $this;
+ }
+
+
+ /**
+ * Get the associated ChildModuleImage object
+ *
+ * @param ConnectionInterface $con Optional Connection object.
+ * @return ChildModuleImage The associated ChildModuleImage object.
+ * @throws PropelException
+ */
+ public function getModuleImage(ConnectionInterface $con = null)
+ {
+ if ($this->aModuleImage === null && ($this->id !== null)) {
+ $this->aModuleImage = ChildModuleImageQuery::create()->findPk($this->id, $con);
+ /* The following can be used additionally to
+ guarantee the related object contains a reference
+ to this object. This level of coupling may, however, be
+ undesirable since it could result in an only partially populated collection
+ in the referenced object.
+ $this->aModuleImage->addModuleImageI18ns($this);
+ */
+ }
+
+ return $this->aModuleImage;
+ }
+
+ /**
+ * Clears the current object and sets all attributes to their default values
+ */
+ public function clear()
+ {
+ $this->id = null;
+ $this->locale = null;
+ $this->title = null;
+ $this->description = null;
+ $this->chapo = null;
+ $this->postscriptum = null;
+ $this->alreadyInSave = false;
+ $this->clearAllReferences();
+ $this->applyDefaultValues();
+ $this->resetModified();
+ $this->setNew(true);
+ $this->setDeleted(false);
+ }
+
+ /**
+ * Resets all references to other model objects or collections of model objects.
+ *
+ * This method is a user-space workaround for PHP's inability to garbage collect
+ * objects with circular references (even in PHP 5.3). This is currently necessary
+ * when using Propel in certain daemon or large-volume/high-memory operations.
+ *
+ * @param boolean $deep Whether to also clear the references on all referrer objects.
+ */
+ public function clearAllReferences($deep = false)
+ {
+ if ($deep) {
+ } // if ($deep)
+
+ $this->aModuleImage = null;
+ }
+
+ /**
+ * Return the string representation of this object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->exportTo(ModuleImageI18nTableMap::DEFAULT_STRING_FORMAT);
+ }
+
+ /**
+ * Code to be run before persisting the object
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preSave(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after persisting the object
+ * @param ConnectionInterface $con
+ */
+ public function postSave(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before inserting to database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preInsert(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after inserting to database
+ * @param ConnectionInterface $con
+ */
+ public function postInsert(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before updating the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preUpdate(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after updating the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postUpdate(ConnectionInterface $con = null)
+ {
+
+ }
+
+ /**
+ * Code to be run before deleting the object in database
+ * @param ConnectionInterface $con
+ * @return boolean
+ */
+ public function preDelete(ConnectionInterface $con = null)
+ {
+ return true;
+ }
+
+ /**
+ * Code to be run after deleting the object in database
+ * @param ConnectionInterface $con
+ */
+ public function postDelete(ConnectionInterface $con = null)
+ {
+
+ }
+
+
+ /**
+ * Derived method to catches calls to undefined methods.
+ *
+ * Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
+ * Allows to define default __call() behavior if you overwrite __call()
+ *
+ * @param string $name
+ * @param mixed $params
+ *
+ * @return array|string
+ */
+ public function __call($name, $params)
+ {
+ if (0 === strpos($name, 'get')) {
+ $virtualColumn = substr($name, 3);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+
+ $virtualColumn = lcfirst($virtualColumn);
+ if ($this->hasVirtualColumn($virtualColumn)) {
+ return $this->getVirtualColumn($virtualColumn);
+ }
+ }
+
+ if (0 === strpos($name, 'from')) {
+ $format = substr($name, 4);
+
+ return $this->importFrom($format, reset($params));
+ }
+
+ if (0 === strpos($name, 'to')) {
+ $format = substr($name, 2);
+ $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
+
+ return $this->exportTo($format, $includeLazyLoadColumns);
+ }
+
+ throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
+ }
+
+}
diff --git a/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php b/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php
new file mode 100644
index 000000000..e5b6813d6
--- /dev/null
+++ b/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php
@@ -0,0 +1,607 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(array(12, 34), $con);
+ *
+ *
+ * @param array[$id, $locale] $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildModuleImageI18n|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = ModuleImageI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildModuleImageI18n A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM module_image_i18n WHERE ID = :p0 AND LOCALE = :p1';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
+ $stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildModuleImageI18n();
+ $obj->hydrate($row);
+ ModuleImageI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildModuleImageI18n|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+ $this->addUsingAlias(ModuleImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
+ $this->addUsingAlias(ModuleImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
+
+ return $this;
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+ if (empty($keys)) {
+ return $this->add(null, '1<>1', Criteria::CUSTOM);
+ }
+ foreach ($keys as $key) {
+ $cton0 = $this->getNewCriterion(ModuleImageI18nTableMap::ID, $key[0], Criteria::EQUAL);
+ $cton1 = $this->getNewCriterion(ModuleImageI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
+ $cton0->addAnd($cton1);
+ $this->addOr($cton0);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @see filterByModuleImage()
+ *
+ * @param mixed $id The value to use as filter.
+ * Use scalar values for equality.
+ * Use array values for in_array() equivalent.
+ * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(ModuleImageI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(ModuleImageI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the locale column
+ *
+ * Example usage:
+ *
+ * $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
+ * $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
+ *
+ *
+ * @param string $locale The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByLocale($locale = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($locale)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $locale)) {
+ $locale = str_replace('*', '%', $locale);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::LOCALE, $locale, $comparison);
+ }
+
+ /**
+ * Filter the query on the title column
+ *
+ * Example usage:
+ *
+ * $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
+ * $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
+ *
+ *
+ * @param string $title The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByTitle($title = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($title)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $title)) {
+ $title = str_replace('*', '%', $title);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::TITLE, $title, $comparison);
+ }
+
+ /**
+ * Filter the query on the description column
+ *
+ * Example usage:
+ *
+ * $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
+ * $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
+ *
+ *
+ * @param string $description The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByDescription($description = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($description)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $description)) {
+ $description = str_replace('*', '%', $description);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::DESCRIPTION, $description, $comparison);
+ }
+
+ /**
+ * Filter the query on the chapo column
+ *
+ * Example usage:
+ *
+ * $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
+ * $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
+ *
+ *
+ * @param string $chapo The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByChapo($chapo = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($chapo)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $chapo)) {
+ $chapo = str_replace('*', '%', $chapo);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::CHAPO, $chapo, $comparison);
+ }
+
+ /**
+ * Filter the query on the postscriptum column
+ *
+ * Example usage:
+ *
+ * $query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
+ * $query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
+ *
+ *
+ * @param string $postscriptum The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByPostscriptum($postscriptum = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($postscriptum)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $postscriptum)) {
+ $postscriptum = str_replace('*', '%', $postscriptum);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\ModuleImage object
+ *
+ * @param \Thelia\Model\ModuleImage|ObjectCollection $moduleImage The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function filterByModuleImage($moduleImage, $comparison = null)
+ {
+ if ($moduleImage instanceof \Thelia\Model\ModuleImage) {
+ return $this
+ ->addUsingAlias(ModuleImageI18nTableMap::ID, $moduleImage->getId(), $comparison);
+ } elseif ($moduleImage instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(ModuleImageI18nTableMap::ID, $moduleImage->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByModuleImage() only accepts arguments of type \Thelia\Model\ModuleImage or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the ModuleImage relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function joinModuleImage($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('ModuleImage');
+
+ // create a ModelJoin object for this join
+ $join = new ModelJoin();
+ $join->setJoinType($joinType);
+ $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
+ if ($previousJoin = $this->getPreviousJoin()) {
+ $join->setPreviousJoin($previousJoin);
+ }
+
+ // add the ModelJoin to the current object
+ if ($relationAlias) {
+ $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
+ $this->addJoinObject($join, $relationAlias);
+ } else {
+ $this->addJoinObject($join, 'ModuleImage');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the ModuleImage relation ModuleImage object
+ *
+ * @see useQuery()
+ *
+ * @param string $relationAlias optional alias for the relation,
+ * to be used as main alias in the secondary query
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return \Thelia\Model\ModuleImageQuery A secondary query class using the current class as primary query
+ */
+ public function useModuleImageQuery($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ return $this
+ ->joinModuleImage($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ModuleImage', '\Thelia\Model\ModuleImageQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildModuleImageI18n $moduleImageI18n Object to remove from the list of results
+ *
+ * @return ChildModuleImageI18nQuery The current query, for fluid interface
+ */
+ public function prune($moduleImageI18n = null)
+ {
+ if ($moduleImageI18n) {
+ $this->addCond('pruneCond0', $this->getAliasedColName(ModuleImageI18nTableMap::ID), $moduleImageI18n->getId(), Criteria::NOT_EQUAL);
+ $this->addCond('pruneCond1', $this->getAliasedColName(ModuleImageI18nTableMap::LOCALE), $moduleImageI18n->getLocale(), Criteria::NOT_EQUAL);
+ $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the module_image_i18n table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ ModuleImageI18nTableMap::clearInstancePool();
+ ModuleImageI18nTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildModuleImageI18n or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildModuleImageI18n object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(ModuleImageI18nTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ ModuleImageI18nTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ ModuleImageI18nTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+} // ModuleImageI18nQuery
diff --git a/core/lib/Thelia/Model/Base/ModuleImageQuery.php b/core/lib/Thelia/Model/Base/ModuleImageQuery.php
new file mode 100644
index 000000000..966e686ad
--- /dev/null
+++ b/core/lib/Thelia/Model/Base/ModuleImageQuery.php
@@ -0,0 +1,846 @@
+setModelAlias($modelAlias);
+ }
+ if ($criteria instanceof Criteria) {
+ $query->mergeWith($criteria);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Find object by primary key.
+ * Propel uses the instance pool to skip the database if the object exists.
+ * Go fast if the query is untouched.
+ *
+ *
+ * $obj = $c->findPk(12, $con);
+ *
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ChildModuleImage|array|mixed the result, formatted by the current formatter
+ */
+ public function findPk($key, $con = null)
+ {
+ if ($key === null) {
+ return null;
+ }
+ if ((null !== ($obj = ModuleImageTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
+ // the object is already in the instance pool
+ return $obj;
+ }
+ if ($con === null) {
+ $con = Propel::getServiceContainer()->getReadConnection(ModuleImageTableMap::DATABASE_NAME);
+ }
+ $this->basePreSelect($con);
+ if ($this->formatter || $this->modelAlias || $this->with || $this->select
+ || $this->selectColumns || $this->asColumns || $this->selectModifiers
+ || $this->map || $this->having || $this->joins) {
+ return $this->findPkComplex($key, $con);
+ } else {
+ return $this->findPkSimple($key, $con);
+ }
+ }
+
+ /**
+ * Find object by primary key using raw SQL to go fast.
+ * Bypass doSelect() and the object formatter by using generated code.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildModuleImage A model object, or null if the key is not found
+ */
+ protected function findPkSimple($key, $con)
+ {
+ $sql = 'SELECT ID, MODULE_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM module_image WHERE ID = :p0';
+ try {
+ $stmt = $con->prepare($sql);
+ $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
+ $stmt->execute();
+ } catch (Exception $e) {
+ Propel::log($e->getMessage(), Propel::LOG_ERR);
+ throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+ }
+ $obj = null;
+ if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+ $obj = new ChildModuleImage();
+ $obj->hydrate($row);
+ ModuleImageTableMap::addInstanceToPool($obj, (string) $key);
+ }
+ $stmt->closeCursor();
+
+ return $obj;
+ }
+
+ /**
+ * Find object by primary key.
+ *
+ * @param mixed $key Primary key to use for the query
+ * @param ConnectionInterface $con A connection object
+ *
+ * @return ChildModuleImage|array|mixed the result, formatted by the current formatter
+ */
+ protected function findPkComplex($key, $con)
+ {
+ // As the query uses a PK condition, no limit(1) is necessary.
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKey($key)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
+ }
+
+ /**
+ * Find objects by primary key
+ *
+ * $objs = $c->findPks(array(12, 56, 832), $con);
+ *
+ * @param array $keys Primary keys to use for the query
+ * @param ConnectionInterface $con an optional connection object
+ *
+ * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
+ */
+ public function findPks($keys, $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
+ }
+ $this->basePreSelect($con);
+ $criteria = $this->isKeepQuery() ? clone $this : $this;
+ $dataFetcher = $criteria
+ ->filterByPrimaryKeys($keys)
+ ->doSelect($con);
+
+ return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
+ }
+
+ /**
+ * Filter the query by primary key
+ *
+ * @param mixed $key Primary key to use for the query
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKey($key)
+ {
+
+ return $this->addUsingAlias(ModuleImageTableMap::ID, $key, Criteria::EQUAL);
+ }
+
+ /**
+ * Filter the query by a list of primary keys
+ *
+ * @param array $keys The list of primary key to use for the query
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByPrimaryKeys($keys)
+ {
+
+ return $this->addUsingAlias(ModuleImageTableMap::ID, $keys, Criteria::IN);
+ }
+
+ /**
+ * Filter the query on the id column
+ *
+ * Example usage:
+ *
+ * $query->filterById(1234); // WHERE id = 1234
+ * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
+ * $query->filterById(array('min' => 12)); // WHERE id > 12
+ *
+ *
+ * @param mixed $id The value to use as filter.
+ * Use scalar values for equality.
+ * Use array values for in_array() equivalent.
+ * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterById($id = null, $comparison = null)
+ {
+ if (is_array($id)) {
+ $useMinMax = false;
+ if (isset($id['min'])) {
+ $this->addUsingAlias(ModuleImageTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($id['max'])) {
+ $this->addUsingAlias(ModuleImageTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageTableMap::ID, $id, $comparison);
+ }
+
+ /**
+ * Filter the query on the module_id column
+ *
+ * Example usage:
+ *
+ * $query->filterByModuleId(1234); // WHERE module_id = 1234
+ * $query->filterByModuleId(array(12, 34)); // WHERE module_id IN (12, 34)
+ * $query->filterByModuleId(array('min' => 12)); // WHERE module_id > 12
+ *
+ *
+ * @see filterByModule()
+ *
+ * @param mixed $moduleId The value to use as filter.
+ * Use scalar values for equality.
+ * Use array values for in_array() equivalent.
+ * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByModuleId($moduleId = null, $comparison = null)
+ {
+ if (is_array($moduleId)) {
+ $useMinMax = false;
+ if (isset($moduleId['min'])) {
+ $this->addUsingAlias(ModuleImageTableMap::MODULE_ID, $moduleId['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($moduleId['max'])) {
+ $this->addUsingAlias(ModuleImageTableMap::MODULE_ID, $moduleId['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageTableMap::MODULE_ID, $moduleId, $comparison);
+ }
+
+ /**
+ * Filter the query on the file column
+ *
+ * Example usage:
+ *
+ * $query->filterByFile('fooValue'); // WHERE file = 'fooValue'
+ * $query->filterByFile('%fooValue%'); // WHERE file LIKE '%fooValue%'
+ *
+ *
+ * @param string $file The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByFile($file = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($file)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $file)) {
+ $file = str_replace('*', '%', $file);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageTableMap::FILE, $file, $comparison);
+ }
+
+ /**
+ * Filter the query on the position column
+ *
+ * Example usage:
+ *
+ * $query->filterByPosition(1234); // WHERE position = 1234
+ * $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
+ * $query->filterByPosition(array('min' => 12)); // WHERE position > 12
+ *
+ *
+ * @param mixed $position The value to use as filter.
+ * Use scalar values for equality.
+ * Use array values for in_array() equivalent.
+ * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByPosition($position = null, $comparison = null)
+ {
+ if (is_array($position)) {
+ $useMinMax = false;
+ if (isset($position['min'])) {
+ $this->addUsingAlias(ModuleImageTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($position['max'])) {
+ $this->addUsingAlias(ModuleImageTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageTableMap::POSITION, $position, $comparison);
+ }
+
+ /**
+ * Filter the query on the created_at column
+ *
+ * Example usage:
+ *
+ * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
+ * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
+ * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
+ *
+ *
+ * @param mixed $createdAt The value to use as filter.
+ * Values can be integers (unix timestamps), DateTime objects, or strings.
+ * Empty strings are treated as NULL.
+ * Use scalar values for equality.
+ * Use array values for in_array() equivalent.
+ * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByCreatedAt($createdAt = null, $comparison = null)
+ {
+ if (is_array($createdAt)) {
+ $useMinMax = false;
+ if (isset($createdAt['min'])) {
+ $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($createdAt['max'])) {
+ $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, $createdAt, $comparison);
+ }
+
+ /**
+ * Filter the query on the updated_at column
+ *
+ * Example usage:
+ *
+ * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
+ * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
+ * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
+ *
+ *
+ * @param mixed $updatedAt The value to use as filter.
+ * Values can be integers (unix timestamps), DateTime objects, or strings.
+ * Empty strings are treated as NULL.
+ * Use scalar values for equality.
+ * Use array values for in_array() equivalent.
+ * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByUpdatedAt($updatedAt = null, $comparison = null)
+ {
+ if (is_array($updatedAt)) {
+ $useMinMax = false;
+ if (isset($updatedAt['min'])) {
+ $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
+ $useMinMax = true;
+ }
+ if (isset($updatedAt['max'])) {
+ $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
+ $useMinMax = true;
+ }
+ if ($useMinMax) {
+ return $this;
+ }
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+ }
+
+ return $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, $updatedAt, $comparison);
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\Module object
+ *
+ * @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByModule($module, $comparison = null)
+ {
+ if ($module instanceof \Thelia\Model\Module) {
+ return $this
+ ->addUsingAlias(ModuleImageTableMap::MODULE_ID, $module->getId(), $comparison);
+ } elseif ($module instanceof ObjectCollection) {
+ if (null === $comparison) {
+ $comparison = Criteria::IN;
+ }
+
+ return $this
+ ->addUsingAlias(ModuleImageTableMap::MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison);
+ } else {
+ throw new PropelException('filterByModule() only accepts arguments of type \Thelia\Model\Module or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the Module relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function joinModule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('Module');
+
+ // create a ModelJoin object for this join
+ $join = new ModelJoin();
+ $join->setJoinType($joinType);
+ $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
+ if ($previousJoin = $this->getPreviousJoin()) {
+ $join->setPreviousJoin($previousJoin);
+ }
+
+ // add the ModelJoin to the current object
+ if ($relationAlias) {
+ $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
+ $this->addJoinObject($join, $relationAlias);
+ } else {
+ $this->addJoinObject($join, 'Module');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the Module relation Module object
+ *
+ * @see useQuery()
+ *
+ * @param string $relationAlias optional alias for the relation,
+ * to be used as main alias in the secondary query
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return \Thelia\Model\ModuleQuery A secondary query class using the current class as primary query
+ */
+ public function useModuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinModule($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'Module', '\Thelia\Model\ModuleQuery');
+ }
+
+ /**
+ * Filter the query by a related \Thelia\Model\ModuleImageI18n object
+ *
+ * @param \Thelia\Model\ModuleImageI18n|ObjectCollection $moduleImageI18n the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function filterByModuleImageI18n($moduleImageI18n, $comparison = null)
+ {
+ if ($moduleImageI18n instanceof \Thelia\Model\ModuleImageI18n) {
+ return $this
+ ->addUsingAlias(ModuleImageTableMap::ID, $moduleImageI18n->getId(), $comparison);
+ } elseif ($moduleImageI18n instanceof ObjectCollection) {
+ return $this
+ ->useModuleImageI18nQuery()
+ ->filterByPrimaryKeys($moduleImageI18n->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByModuleImageI18n() only accepts arguments of type \Thelia\Model\ModuleImageI18n or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the ModuleImageI18n relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function joinModuleImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('ModuleImageI18n');
+
+ // create a ModelJoin object for this join
+ $join = new ModelJoin();
+ $join->setJoinType($joinType);
+ $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
+ if ($previousJoin = $this->getPreviousJoin()) {
+ $join->setPreviousJoin($previousJoin);
+ }
+
+ // add the ModelJoin to the current object
+ if ($relationAlias) {
+ $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
+ $this->addJoinObject($join, $relationAlias);
+ } else {
+ $this->addJoinObject($join, 'ModuleImageI18n');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the ModuleImageI18n relation ModuleImageI18n object
+ *
+ * @see useQuery()
+ *
+ * @param string $relationAlias optional alias for the relation,
+ * to be used as main alias in the secondary query
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return \Thelia\Model\ModuleImageI18nQuery A secondary query class using the current class as primary query
+ */
+ public function useModuleImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
+ {
+ return $this
+ ->joinModuleImageI18n($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ModuleImageI18n', '\Thelia\Model\ModuleImageI18nQuery');
+ }
+
+ /**
+ * Exclude object from result
+ *
+ * @param ChildModuleImage $moduleImage Object to remove from the list of results
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function prune($moduleImage = null)
+ {
+ if ($moduleImage) {
+ $this->addUsingAlias(ModuleImageTableMap::ID, $moduleImage->getId(), Criteria::NOT_EQUAL);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Deletes all rows from the module_image table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public function doDeleteAll(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+ $affectedRows += parent::doDeleteAll($con);
+ // Because this db requires some delete cascade/set null emulation, we have to
+ // clear the cached instance *after* the emulation has happened (since
+ // instances get re-added by the select statement contained therein).
+ ModuleImageTableMap::clearInstancePool();
+ ModuleImageTableMap::clearRelatedInstancePool();
+
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $affectedRows;
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ChildModuleImage or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ChildModuleImage object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public function delete(ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
+ }
+
+ $criteria = $this;
+
+ // Set the correct dbName
+ $criteria->setDbName(ModuleImageTableMap::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->beginTransaction();
+
+
+ ModuleImageTableMap::removeInstanceFromPool($criteria);
+
+ $affectedRows += ModelCriteria::delete($con);
+ ModuleImageTableMap::clearRelatedInstancePool();
+ $con->commit();
+
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+ }
+
+ // timestampable behavior
+
+ /**
+ * Filter by the latest updated
+ *
+ * @param int $nbDays Maximum age of the latest update in days
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function recentlyUpdated($nbDays = 7)
+ {
+ return $this->addUsingAlias(ModuleImageTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Filter by the latest created
+ *
+ * @param int $nbDays Maximum age of in days
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function recentlyCreated($nbDays = 7)
+ {
+ return $this->addUsingAlias(ModuleImageTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
+ }
+
+ /**
+ * Order by update date desc
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function lastUpdatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(ModuleImageTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by update date asc
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function firstUpdatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(ModuleImageTableMap::UPDATED_AT);
+ }
+
+ /**
+ * Order by create date desc
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function lastCreatedFirst()
+ {
+ return $this->addDescendingOrderByColumn(ModuleImageTableMap::CREATED_AT);
+ }
+
+ /**
+ * Order by create date asc
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function firstCreatedFirst()
+ {
+ return $this->addAscendingOrderByColumn(ModuleImageTableMap::CREATED_AT);
+ }
+
+ // i18n behavior
+
+ /**
+ * Adds a JOIN clause to the query using the i18n relation
+ *
+ * @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ {
+ $relationName = $relationAlias ? $relationAlias : 'ModuleImageI18n';
+
+ return $this
+ ->joinModuleImageI18n($relationAlias, $joinType)
+ ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
+ }
+
+ /**
+ * Adds a JOIN clause to the query and hydrates the related I18n object.
+ * Shortcut for $c->joinI18n($locale)->with()
+ *
+ * @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
+ *
+ * @return ChildModuleImageQuery The current query, for fluid interface
+ */
+ public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
+ {
+ $this
+ ->joinI18n($locale, null, $joinType)
+ ->with('ModuleImageI18n');
+ $this->with['ModuleImageI18n']->setIsWithOneToMany(false);
+
+ return $this;
+ }
+
+ /**
+ * Use the I18n relation query object
+ *
+ * @see useQuery()
+ *
+ * @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
+ *
+ * @return ChildModuleImageI18nQuery A secondary query class using the current class as primary query
+ */
+ public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
+ {
+ return $this
+ ->joinI18n($locale, $relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ModuleImageI18n', '\Thelia\Model\ModuleImageI18nQuery');
+ }
+
+} // ModuleImageQuery
diff --git a/core/lib/Thelia/Model/Base/ModuleQuery.php b/core/lib/Thelia/Model/Base/ModuleQuery.php
index 0ed6c5293..4031a4f63 100644
--- a/core/lib/Thelia/Model/Base/ModuleQuery.php
+++ b/core/lib/Thelia/Model/Base/ModuleQuery.php
@@ -60,6 +60,10 @@ use Thelia\Model\Map\ModuleTableMap;
* @method ChildModuleQuery rightJoinGroupModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupModule relation
* @method ChildModuleQuery innerJoinGroupModule($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupModule relation
*
+ * @method ChildModuleQuery leftJoinModuleImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleImage relation
+ * @method ChildModuleQuery rightJoinModuleImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleImage relation
+ * @method ChildModuleQuery innerJoinModuleImage($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleImage relation
+ *
* @method ChildModuleQuery leftJoinModuleI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleI18n relation
* @method ChildModuleQuery rightJoinModuleI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleI18n relation
* @method ChildModuleQuery innerJoinModuleI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleI18n relation
@@ -861,6 +865,79 @@ abstract class ModuleQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'GroupModule', '\Thelia\Model\GroupModuleQuery');
}
+ /**
+ * Filter the query by a related \Thelia\Model\ModuleImage object
+ *
+ * @param \Thelia\Model\ModuleImage|ObjectCollection $moduleImage the related object to use as filter
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return ChildModuleQuery The current query, for fluid interface
+ */
+ public function filterByModuleImage($moduleImage, $comparison = null)
+ {
+ if ($moduleImage instanceof \Thelia\Model\ModuleImage) {
+ return $this
+ ->addUsingAlias(ModuleTableMap::ID, $moduleImage->getModuleId(), $comparison);
+ } elseif ($moduleImage instanceof ObjectCollection) {
+ return $this
+ ->useModuleImageQuery()
+ ->filterByPrimaryKeys($moduleImage->getPrimaryKeys())
+ ->endUse();
+ } else {
+ throw new PropelException('filterByModuleImage() only accepts arguments of type \Thelia\Model\ModuleImage or Collection');
+ }
+ }
+
+ /**
+ * Adds a JOIN clause to the query using the ModuleImage relation
+ *
+ * @param string $relationAlias optional alias for the relation
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return ChildModuleQuery The current query, for fluid interface
+ */
+ public function joinModuleImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ $tableMap = $this->getTableMap();
+ $relationMap = $tableMap->getRelation('ModuleImage');
+
+ // create a ModelJoin object for this join
+ $join = new ModelJoin();
+ $join->setJoinType($joinType);
+ $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
+ if ($previousJoin = $this->getPreviousJoin()) {
+ $join->setPreviousJoin($previousJoin);
+ }
+
+ // add the ModelJoin to the current object
+ if ($relationAlias) {
+ $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
+ $this->addJoinObject($join, $relationAlias);
+ } else {
+ $this->addJoinObject($join, 'ModuleImage');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Use the ModuleImage relation ModuleImage object
+ *
+ * @see useQuery()
+ *
+ * @param string $relationAlias optional alias for the relation,
+ * to be used as main alias in the secondary query
+ * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
+ *
+ * @return \Thelia\Model\ModuleImageQuery A secondary query class using the current class as primary query
+ */
+ public function useModuleImageQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
+ {
+ return $this
+ ->joinModuleImage($relationAlias, $joinType)
+ ->useQuery($relationAlias ? $relationAlias : 'ModuleImage', '\Thelia\Model\ModuleImageQuery');
+ }
+
/**
* Filter the query by a related \Thelia\Model\ModuleI18n object
*
diff --git a/core/lib/Thelia/Model/Map/ModuleImageI18nTableMap.php b/core/lib/Thelia/Model/Map/ModuleImageI18nTableMap.php
new file mode 100644
index 000000000..76c29e11c
--- /dev/null
+++ b/core/lib/Thelia/Model/Map/ModuleImageI18nTableMap.php
@@ -0,0 +1,497 @@
+ array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
+ self::TYPE_COLNAME => array(ModuleImageI18nTableMap::ID, ModuleImageI18nTableMap::LOCALE, ModuleImageI18nTableMap::TITLE, ModuleImageI18nTableMap::DESCRIPTION, ModuleImageI18nTableMap::CHAPO, ModuleImageI18nTableMap::POSTSCRIPTUM, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
+ self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
+ self::TYPE_COLNAME => array(ModuleImageI18nTableMap::ID => 0, ModuleImageI18nTableMap::LOCALE => 1, ModuleImageI18nTableMap::TITLE => 2, ModuleImageI18nTableMap::DESCRIPTION => 3, ModuleImageI18nTableMap::CHAPO => 4, ModuleImageI18nTableMap::POSTSCRIPTUM => 5, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('module_image_i18n');
+ $this->setPhpName('ModuleImageI18n');
+ $this->setClassName('\\Thelia\\Model\\ModuleImageI18n');
+ $this->setPackage('Thelia.Model');
+ $this->setUseIdGenerator(false);
+ // columns
+ $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'module_image', 'ID', true, null, null);
+ $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
+ $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
+ $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
+ $this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);
+ $this->addColumn('POSTSCRIPTUM', 'Postscriptum', 'LONGVARCHAR', false, null, null);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('ModuleImage', '\\Thelia\\Model\\ModuleImage', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
+ } // buildRelations()
+
+ /**
+ * Adds an object to the instance pool.
+ *
+ * Propel keeps cached copies of objects in an instance pool when they are retrieved
+ * from the database. In some cases you may need to explicitly add objects
+ * to the cache in order to ensure that the same objects are always returned by find*()
+ * and findPk*() calls.
+ *
+ * @param \Thelia\Model\ModuleImageI18n $obj A \Thelia\Model\ModuleImageI18n object.
+ * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
+ */
+ public static function addInstanceToPool($obj, $key = null)
+ {
+ if (Propel::isInstancePoolingEnabled()) {
+ if (null === $key) {
+ $key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
+ } // if key === null
+ self::$instances[$key] = $obj;
+ }
+ }
+
+ /**
+ * Removes an object from the instance pool.
+ *
+ * Propel keeps cached copies of objects in an instance pool when they are retrieved
+ * from the database. In some cases -- especially when you override doDelete
+ * methods in your stub classes -- you may need to explicitly remove objects
+ * from the cache in order to prevent returning objects that no longer exist.
+ *
+ * @param mixed $value A \Thelia\Model\ModuleImageI18n object or a primary key value.
+ */
+ public static function removeInstanceFromPool($value)
+ {
+ if (Propel::isInstancePoolingEnabled() && null !== $value) {
+ if (is_object($value) && $value instanceof \Thelia\Model\ModuleImageI18n) {
+ $key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
+
+ } elseif (is_array($value) && count($value) === 2) {
+ // assume we've been passed a primary key";
+ $key = serialize(array((string) $value[0], (string) $value[1]));
+ } elseif ($value instanceof Criteria) {
+ self::$instances = [];
+
+ return;
+ } else {
+ $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ModuleImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
+ throw $e;
+ }
+
+ unset(self::$instances[$key]);
+ }
+ }
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return $pks;
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? ModuleImageI18nTableMap::CLASS_DEFAULT : ModuleImageI18nTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (ModuleImageI18n object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = ModuleImageI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = ModuleImageI18nTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + ModuleImageI18nTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = ModuleImageI18nTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ ModuleImageI18nTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = ModuleImageI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = ModuleImageI18nTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ ModuleImageI18nTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::ID);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::LOCALE);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::TITLE);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::DESCRIPTION);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::CHAPO);
+ $criteria->addSelectColumn(ModuleImageI18nTableMap::POSTSCRIPTUM);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.LOCALE');
+ $criteria->addSelectColumn($alias . '.TITLE');
+ $criteria->addSelectColumn($alias . '.DESCRIPTION');
+ $criteria->addSelectColumn($alias . '.CHAPO');
+ $criteria->addSelectColumn($alias . '.POSTSCRIPTUM');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(ModuleImageI18nTableMap::DATABASE_NAME)->getTable(ModuleImageI18nTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(ModuleImageI18nTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(ModuleImageI18nTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new ModuleImageI18nTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ModuleImageI18n or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ModuleImageI18n object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \Thelia\Model\ModuleImageI18n) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(ModuleImageI18nTableMap::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ foreach ($values as $value) {
+ $criterion = $criteria->getNewCriterion(ModuleImageI18nTableMap::ID, $value[0]);
+ $criterion->addAnd($criteria->getNewCriterion(ModuleImageI18nTableMap::LOCALE, $value[1]));
+ $criteria->addOr($criterion);
+ }
+ }
+
+ $query = ModuleImageI18nQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { ModuleImageI18nTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { ModuleImageI18nTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the module_image_i18n table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return ModuleImageI18nQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a ModuleImageI18n or Criteria object.
+ *
+ * @param mixed $criteria Criteria or ModuleImageI18n object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageI18nTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from ModuleImageI18n object
+ }
+
+
+ // Set the correct dbName
+ $query = ModuleImageI18nQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // ModuleImageI18nTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+ModuleImageI18nTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/ModuleImageTableMap.php b/core/lib/Thelia/Model/Map/ModuleImageTableMap.php
new file mode 100644
index 000000000..718ac47c5
--- /dev/null
+++ b/core/lib/Thelia/Model/Map/ModuleImageTableMap.php
@@ -0,0 +1,475 @@
+ array('Id', 'ModuleId', 'File', 'Position', 'CreatedAt', 'UpdatedAt', ),
+ self::TYPE_STUDLYPHPNAME => array('id', 'moduleId', 'file', 'position', 'createdAt', 'updatedAt', ),
+ self::TYPE_COLNAME => array(ModuleImageTableMap::ID, ModuleImageTableMap::MODULE_ID, ModuleImageTableMap::FILE, ModuleImageTableMap::POSITION, ModuleImageTableMap::CREATED_AT, ModuleImageTableMap::UPDATED_AT, ),
+ self::TYPE_RAW_COLNAME => array('ID', 'MODULE_ID', 'FILE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
+ self::TYPE_FIELDNAME => array('id', 'module_id', 'file', 'position', 'created_at', 'updated_at', ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
+ */
+ protected static $fieldKeys = array (
+ self::TYPE_PHPNAME => array('Id' => 0, 'ModuleId' => 1, 'File' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
+ self::TYPE_STUDLYPHPNAME => array('id' => 0, 'moduleId' => 1, 'file' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
+ self::TYPE_COLNAME => array(ModuleImageTableMap::ID => 0, ModuleImageTableMap::MODULE_ID => 1, ModuleImageTableMap::FILE => 2, ModuleImageTableMap::POSITION => 3, ModuleImageTableMap::CREATED_AT => 4, ModuleImageTableMap::UPDATED_AT => 5, ),
+ self::TYPE_RAW_COLNAME => array('ID' => 0, 'MODULE_ID' => 1, 'FILE' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
+ self::TYPE_FIELDNAME => array('id' => 0, 'module_id' => 1, 'file' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
+ self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * Initialize the table attributes and columns
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('module_image');
+ $this->setPhpName('ModuleImage');
+ $this->setClassName('\\Thelia\\Model\\ModuleImage');
+ $this->setPackage('Thelia.Model');
+ $this->setUseIdGenerator(true);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addForeignKey('MODULE_ID', 'ModuleId', 'INTEGER', 'module', 'ID', true, null, null);
+ $this->addColumn('FILE', 'File', 'VARCHAR', true, 255, null);
+ $this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
+ $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
+ $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('Module', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('module_id' => 'id', ), 'CASCADE', 'RESTRICT');
+ $this->addRelation('ModuleImageI18n', '\\Thelia\\Model\\ModuleImageI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModuleImageI18ns');
+ } // buildRelations()
+
+ /**
+ *
+ * Gets the list of behaviors registered for this table
+ *
+ * @return array Associative array (name => parameters) of behaviors
+ */
+ public function getBehaviors()
+ {
+ return array(
+ 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
+ 'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
+ );
+ } // getBehaviors()
+ /**
+ * Method to invalidate the instance pool of all tables related to module_image * by a foreign key with ON DELETE CASCADE
+ */
+ public static function clearRelatedInstancePool()
+ {
+ // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
+ // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
+ ModuleImageI18nTableMap::clearInstancePool();
+ }
+
+ /**
+ * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
+ *
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, a serialize()d version of the primary key will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ */
+ public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ // If the PK cannot be derived from the row, return NULL.
+ if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
+ return null;
+ }
+
+ return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
+ }
+
+ /**
+ * Retrieves the primary key from the DB resultset row
+ * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
+ * a multi-column primary key, an array of the primary key columns will be returned.
+ *
+ * @param array $row resultset row.
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
+ *
+ * @return mixed The primary key of the row
+ */
+ public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+
+ return (int) $row[
+ $indexType == TableMap::TYPE_NUM
+ ? 0 + $offset
+ : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
+ ];
+ }
+
+ /**
+ * The class that the tableMap will make instances of.
+ *
+ * If $withPrefix is true, the returned path
+ * uses a dot-path notation which is translated into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @param boolean $withPrefix Whether or not to return the path with the class name
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass($withPrefix = true)
+ {
+ return $withPrefix ? ModuleImageTableMap::CLASS_DEFAULT : ModuleImageTableMap::OM_CLASS;
+ }
+
+ /**
+ * Populates an object of the default type or an object that inherit from the default.
+ *
+ * @param array $row row returned by DataFetcher->fetch().
+ * @param int $offset The 0-based offset for reading from the resultset row.
+ * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
+ One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
+ * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return array (ModuleImage object, last column rank)
+ */
+ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
+ {
+ $key = ModuleImageTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
+ if (null !== ($obj = ModuleImageTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, $offset, true); // rehydrate
+ $col = $offset + ModuleImageTableMap::NUM_HYDRATE_COLUMNS;
+ } else {
+ $cls = ModuleImageTableMap::OM_CLASS;
+ $obj = new $cls();
+ $col = $obj->hydrate($row, $offset, false, $indexType);
+ ModuleImageTableMap::addInstanceToPool($obj, $key);
+ }
+
+ return array($obj, $col);
+ }
+
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @param DataFetcherInterface $dataFetcher
+ * @return array
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(DataFetcherInterface $dataFetcher)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = static::getOMClass(false);
+ // populate the object(s)
+ while ($row = $dataFetcher->fetch()) {
+ $key = ModuleImageTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
+ if (null !== ($obj = ModuleImageTableMap::getInstanceFromPool($key))) {
+ // We no longer rehydrate the object, since this can cause data loss.
+ // See http://www.propelorm.org/ticket/509
+ // $obj->hydrate($row, 0, true); // rehydrate
+ $results[] = $obj;
+ } else {
+ $obj = new $cls();
+ $obj->hydrate($row);
+ $results[] = $obj;
+ ModuleImageTableMap::addInstanceToPool($obj, $key);
+ } // if key exists
+ }
+
+ return $results;
+ }
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param Criteria $criteria object containing the columns to add.
+ * @param string $alias optional table alias
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria, $alias = null)
+ {
+ if (null === $alias) {
+ $criteria->addSelectColumn(ModuleImageTableMap::ID);
+ $criteria->addSelectColumn(ModuleImageTableMap::MODULE_ID);
+ $criteria->addSelectColumn(ModuleImageTableMap::FILE);
+ $criteria->addSelectColumn(ModuleImageTableMap::POSITION);
+ $criteria->addSelectColumn(ModuleImageTableMap::CREATED_AT);
+ $criteria->addSelectColumn(ModuleImageTableMap::UPDATED_AT);
+ } else {
+ $criteria->addSelectColumn($alias . '.ID');
+ $criteria->addSelectColumn($alias . '.MODULE_ID');
+ $criteria->addSelectColumn($alias . '.FILE');
+ $criteria->addSelectColumn($alias . '.POSITION');
+ $criteria->addSelectColumn($alias . '.CREATED_AT');
+ $criteria->addSelectColumn($alias . '.UPDATED_AT');
+ }
+ }
+
+ /**
+ * Returns the TableMap related to this object.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getServiceContainer()->getDatabaseMap(ModuleImageTableMap::DATABASE_NAME)->getTable(ModuleImageTableMap::TABLE_NAME);
+ }
+
+ /**
+ * Add a TableMap instance to the database for this tableMap class.
+ */
+ public static function buildTableMap()
+ {
+ $dbMap = Propel::getServiceContainer()->getDatabaseMap(ModuleImageTableMap::DATABASE_NAME);
+ if (!$dbMap->hasTable(ModuleImageTableMap::TABLE_NAME)) {
+ $dbMap->addTableObject(new ModuleImageTableMap());
+ }
+ }
+
+ /**
+ * Performs a DELETE on the database, given a ModuleImage or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ModuleImage object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ // rename for clarity
+ $criteria = $values;
+ } elseif ($values instanceof \Thelia\Model\ModuleImage) { // it's a model object
+ // create criteria based on pk values
+ $criteria = $values->buildPkeyCriteria();
+ } else { // it's a primary key, or an array of pks
+ $criteria = new Criteria(ModuleImageTableMap::DATABASE_NAME);
+ $criteria->add(ModuleImageTableMap::ID, (array) $values, Criteria::IN);
+ }
+
+ $query = ModuleImageQuery::create()->mergeWith($criteria);
+
+ if ($values instanceof Criteria) { ModuleImageTableMap::clearInstancePool();
+ } elseif (!is_object($values)) { // it's a primary key, or an array of pks
+ foreach ((array) $values as $singleval) { ModuleImageTableMap::removeInstanceFromPool($singleval);
+ }
+ }
+
+ return $query->delete($con);
+ }
+
+ /**
+ * Deletes all rows from the module_image table.
+ *
+ * @param ConnectionInterface $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll(ConnectionInterface $con = null)
+ {
+ return ModuleImageQuery::create()->doDeleteAll($con);
+ }
+
+ /**
+ * Performs an INSERT on the database, given a ModuleImage or Criteria object.
+ *
+ * @param mixed $criteria Criteria or ModuleImage object containing data that is used to create the INSERT statement.
+ * @param ConnectionInterface $con the ConnectionInterface connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($criteria, ConnectionInterface $con = null)
+ {
+ if (null === $con) {
+ $con = Propel::getServiceContainer()->getWriteConnection(ModuleImageTableMap::DATABASE_NAME);
+ }
+
+ if ($criteria instanceof Criteria) {
+ $criteria = clone $criteria; // rename for clarity
+ } else {
+ $criteria = $criteria->buildCriteria(); // build Criteria from ModuleImage object
+ }
+
+ if ($criteria->containsKey(ModuleImageTableMap::ID) && $criteria->keyContainsValue(ModuleImageTableMap::ID) ) {
+ throw new PropelException('Cannot insert a value for auto-increment primary key ('.ModuleImageTableMap::ID.')');
+ }
+
+
+ // Set the correct dbName
+ $query = ModuleImageQuery::create()->mergeWith($criteria);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->beginTransaction();
+ $pk = $query->doInsert($con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollBack();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+} // ModuleImageTableMap
+// This is the static code needed to register the TableMap for this table with the main Propel class.
+//
+ModuleImageTableMap::buildTableMap();
diff --git a/core/lib/Thelia/Model/Map/ModuleTableMap.php b/core/lib/Thelia/Model/Map/ModuleTableMap.php
index 1a2f63692..788048e28 100644
--- a/core/lib/Thelia/Model/Map/ModuleTableMap.php
+++ b/core/lib/Thelia/Model/Map/ModuleTableMap.php
@@ -188,6 +188,7 @@ class ModuleTableMap extends TableMap
$this->addRelation('OrderRelatedByDeliveryModuleId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByDeliveryModuleId');
$this->addRelation('AreaDeliveryModule', '\\Thelia\\Model\\AreaDeliveryModule', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'CASCADE', 'RESTRICT', 'AreaDeliveryModules');
$this->addRelation('GroupModule', '\\Thelia\\Model\\GroupModule', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'GroupModules');
+ $this->addRelation('ModuleImage', '\\Thelia\\Model\\ModuleImage', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'ModuleImages');
$this->addRelation('ModuleI18n', '\\Thelia\\Model\\ModuleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModuleI18ns');
} // buildRelations()
@@ -213,6 +214,7 @@ class ModuleTableMap extends TableMap
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
AreaDeliveryModuleTableMap::clearInstancePool();
GroupModuleTableMap::clearInstancePool();
+ ModuleImageTableMap::clearInstancePool();
ModuleI18nTableMap::clearInstancePool();
}
diff --git a/core/lib/Thelia/Model/ModuleImage.php b/core/lib/Thelia/Model/ModuleImage.php
new file mode 100644
index 000000000..7ea5415bc
--- /dev/null
+++ b/core/lib/Thelia/Model/ModuleImage.php
@@ -0,0 +1,10 @@
+getModuleModel();
+ if($moduleModel->getActivate() == self::IS_NOT_ACTIVATED) {
+ $moduleModel->setActivate(self::IS_ACTIVATED);
+ $moduleModel->save();
+ try {
+ $this->afterActivation();
+ } catch(\Exception $e) {
+ $moduleModel->setActivate(self::IS_NOT_ACTIVATED);
+ $moduleModel->save();
+ throw $e;
+ }
+ }
}
public function hasContainer()
@@ -56,7 +76,88 @@ abstract class BaseModule extends ContainerAware
return $this->container;
}
+ public function deployImageFolder(Module $module, $folderPath)
+ {
+ try {
+ $directoryBrowser = new \DirectoryIterator($folderPath);
+ } catch(\UnexpectedValueException $e) {
+ throw $e;
+ }
+
+ $con = \Propel\Runtime\Propel::getConnection(
+ ModuleImageTableMap::DATABASE_NAME
+ );
+
+ /* browse the directory */
+ $imagePosition = 1;
+ foreach($directoryBrowser as $directoryContent) {
+ /* is it a file ? */
+ if ($directoryContent->isFile()) {
+
+ $fileName = $directoryContent->getFilename();
+ $filePath = $directoryContent->getPathName();
+
+ /* is it a picture ? */
+ if( Image::isImage($filePath) ) {
+
+ $con->beginTransaction();
+
+ $image = new ModuleImage();
+ $image->setModuleId($module->getId());
+ $image->setPosition($imagePosition);
+ $image->save();
+
+ $imageDirectory = sprintf("%s/../../../../local/media/images/module", __DIR__);
+ $imageFileName = sprintf("%s-%d-%s", $module->getCode(), $image->getId(), $fileName);
+
+ $increment = 0;
+ while(file_exists($imageDirectory . '/' . $imageFileName)) {
+ $imageFileName = sprintf("%s-%d-%d-%s", $module->getCode(), $image->getId(), $increment, $fileName);
+ $increment++;
+ }
+
+ $imagePath = sprintf('%s/%s', $imageDirectory, $imageFileName);
+
+ if (! is_dir($imageDirectory)) {
+ if(! @mkdir($imageDirectory, 0777, true)) {
+ $con->rollBack();
+ throw new ModuleException(sprintf("Cannot create directory : %s", $imageDirectory), ModuleException::CODE_NOT_FOUND);
+ }
+ }
+
+ if(! @copy($filePath, $imagePath)) {
+ $con->rollBack();
+ throw new ModuleException(sprintf("Cannot copy file : %s to : %s", $filePath, $imagePath), ModuleException::CODE_NOT_FOUND);
+ }
+
+ $image->setFile($imageFileName);
+ $image->save();
+
+ $con->commit();
+ $imagePosition++;
+ }
+ }
+ }
+ }
+
+ /**
+ * @return Module
+ * @throws \Thelia\Exception\ModuleException
+ */
+ public function getModuleModel()
+ {
+ $moduleModel = ModuleQuery::create()->findOneByCode($this->getCode());
+
+ if(null === $moduleModel) {
+ throw new ModuleException(sprintf("Module Code `%s` not found", $this->getCode()), ModuleException::CODE_NOT_FOUND);
+ }
+
+ return $moduleModel;
+ }
+
+ abstract public function getCode();
abstract public function install();
+ abstract public function afterActivation();
abstract public function destroy();
}
diff --git a/core/lib/Thelia/Module/PaymentModuleInterface.php b/core/lib/Thelia/Module/PaymentModuleInterface.php
new file mode 100644
index 000000000..d864ae50a
--- /dev/null
+++ b/core/lib/Thelia/Module/PaymentModuleInterface.php
@@ -0,0 +1,34 @@
+. */
+/* */
+/*************************************************************************************/
+
+namespace Thelia\Module;
+
+use Thelia\Model\Country;
+
+interface PaymentModuleInterface extends BaseModuleInterface
+{
+ /**
+ * @return mixed
+ */
+ public function pay();
+}
diff --git a/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php b/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php
new file mode 100755
index 000000000..e488e60ff
--- /dev/null
+++ b/core/lib/Thelia/Tests/Command/ModuleActivateCommandTest.php
@@ -0,0 +1,109 @@
+. */
+/* */
+/*************************************************************************************/
+namespace Thelia\Tests\Command;
+
+use Symfony\Component\Console\Tester\CommandTester;
+use Thelia\Command\ModuleActivateCommand;
+use Thelia\Core\Application;
+use Thelia\Model\ModuleQuery;
+use Thelia\Module\BaseModule;
+
+/**
+ * Class ModuleActivateCommandTest
+ *
+ * @package Thelia\Tests\Command
+ * @author Etienne Roudeix
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {loop name="folder_list" type="folder" visible="*" parent=$folder_id order=$folder_order backend_context="1" lang=$lang_id}
+
+ {admin_sortable_header
+ current_order=$folder_order
+ order='id'
+ reverse_order='id_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id}
+ request_parameter_name='folder_order'
+ label="{intl l='ID'}"
+ }
+
+
+
+
+
+ {admin_sortable_header
+ current_order=$folder_order
+ order='alpha'
+ reverse_order='alpha_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id}
+ request_parameter_name='folder_order'
+ label="{intl l='Folder title'}"
+ }
+
+
+ {module_include location='folder_list_header'}
+
+
+ {admin_sortable_header
+ current_order=$folder_order
+ order='visible'
+ reverse_order='visible_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id}
+ request_parameter_name='folder_order'
+ label="{intl l='Online'}"
+ }
+
+
+
+ {admin_sortable_header
+ current_order=$folder_order
+ order='manual'
+ reverse_order='manual_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id}
+ request_parameter_name='folder_order'
+ label="{intl l='Position'}"
+ }
+
+
+ {intl l='Actions'}
+
+
+ {/loop}
+
+ {/ifloop}
+
+ {elseloop rel="folder_list"}
+
+ {$ID}
+
+
+ {loop type="image" name="folder_image" source="folder" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
+
+
+
+ {/loop}
+
+
+ {$TITLE}
+
+
+
+ {module_include location='folder_list_row'}
+
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.folders.edit"}
+
+
+
+ {admin_position_block
+ permission="admin.folders.edit"
+ path={url path='admin/folders/update-position' folder_id=$ID}
+ url_parameter="folder_id"
+ in_place_edit_class="folderPositionChange"
+ position=$POSITION
+ id=$ID
+ }
+
+
+
+
+
+
+
+
+
+ {/elseloop}
+
+
+
+
+
+
+
+
+
+ {loop name="content_list" type="content" visible="*" folder_default=$folder_id order=$content_order}
+
+ {admin_sortable_header
+ current_order=$content_order
+ order='id'
+ reverse_order='id_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id target='contents'}
+ label="{intl l='ID'}"
+ }
+
+
+
+
+ {admin_sortable_header
+ current_order=$content_order
+ order='alpha'
+ reverse_order='alpha_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id target='contents'}
+ label="{intl l='Content title'}"
+ }
+
+ {module_include location='content_list_header'}
+
+
+ {admin_sortable_header
+ current_order=$content_order
+ order='visible'
+ reverse_order='visible_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id target='contents'}
+ label="{intl l='Online'}"
+ }
+
+
+
+ {admin_sortable_header
+ current_order=$content_order
+ order='manual'
+ reverse_order='manual_reverse'
+ path={url path='/admin/folders' id_folder=$folder_id target='contents'}
+ label="{intl l='Position'}"
+ }
+
+
+
+
+
+ {/loop}
+
+ {/ifloop}
+
+ {elseloop rel="content_list"}
+
+ {$ID}
+
+
+ {loop type="image" name="folder_image" source="content" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
+
+
+
+ {/loop}
+
+
{$TITLE}
+
+ {module_include location='content_list_row'}
+
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.contents.edit"}
+
+
+
+ {admin_position_block
+ permission="admin.content.edit"
+ path={url path='/admin/contents/update-position' content_id=$ID}
+ url_parameter="content_id"
+ in_place_edit_class="contentPositionChange"
+ position=$POSITION
+ id=$ID
+ }
+
+
+
+
+
+
+
+
+
+ {/elseloop}
+
+
+
+
+
+
+
+
+
+ {intl l="Name"}
+
+ {module_include location='shipping_zones_table_header'}
+
+ {intl l="Actions"}
+
+
+ So Colissimo
+
+ {module_include location='shipping_zones_table_row'}
+
+
+ {if ! $SECURED}
+
+ {else}
+
+ {/if}
+
+
+
+ Chronopost
+
+ {module_include location='shipping_zones_table_row'}
+
+
+ {if ! $SECURED}
+
+ {else}
+
+ {/if}
+
+
+
+
+ Kiala
+
+ {module_include location='shipping_zones_table_row'}
+
+
+ {if ! $SECURED}
+
+ {else}
+
+ {/if}
+
+
]*>)+?|)"+n+">|
$","i").test(t)}var m,d=e.settings,f=tinymce.util.LocalStorage,h=e.id;d.autosave_interval=t(d.autosave_interval,"30s"),d.autosave_retention=t(d.autosave_retention,"20m"),e.addButton("restoredraft",{title:"Restore last draft",onclick:l,onPostRender:s}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:l,onPostRender:s,context:"file"}),e.settings.autosave_restore_when_empty!==!1&&(e.on("init",function(){n()&&c()&&r()}),e.on("saveContent",function(){i()})),window.onbeforeunload=u,this.hasDraft=n,this.storeDraft=a,this.restoreDraft=r,this.removeDraft=i,this.isEmpty=c});
\ No newline at end of file
diff --git a/web/tinymce/plugins/bbcode/plugin.min.js b/web/tinymce/plugins/bbcode/plugin.min.js
new file mode 100755
index 000000000..70a88a7d6
--- /dev/null
+++ b/web/tinymce/plugins/bbcode/plugin.min.js
@@ -0,0 +1 @@
+!function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(e){var t=this,n=e.getParam("bbcode_dialect","punbb").toLowerCase();e.on("beforeSetContent",function(e){e.content=t["_"+n+"_bbcode2html"](e.content)}),e.on("postProcess",function(e){e.set&&(e.content=t["_"+n+"_bbcode2html"](e.content)),e.get&&(e.content=t["_"+n+"_html2bbcode"](e.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/]*>/gi,"[quote]"),t(/<\/blockquote>/gi,"[/quote]"),t(/
/gi,"\n"),t(/
/gi,"\n"),t(/
/gi,"\n"),t(/
"),t(/\[b\]/gi,""),t(/\[\/b\]/gi,""),t(/\[i\]/gi,""),t(/\[\/i\]/gi,""),t(/\[u\]/gi,""),t(/\[\/u\]/gi,""),t(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),t(/\[url\](.*?)\[\/url\]/gi,'$1'),t(/\[img\](.*?)\[\/img\]/gi,''),t(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),t(/\[code\](.*?)\[\/code\]/gi,'$1 '),t(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),e}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}();
\ No newline at end of file
diff --git a/web/tinymce/plugins/charmap/plugin.min.js b/web/tinymce/plugins/charmap/plugin.min.js
new file mode 100755
index 000000000..dff18e6e5
--- /dev/null
+++ b/web/tinymce/plugins/charmap/plugin.min.js
@@ -0,0 +1 @@
+tinymce.PluginManager.add("charmap",function(e){function t(){function t(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var i,a,r,o;i='
';var s=25;for(r=0;10>r;r++){for(i+="
";var u={type:"container",html:i,onclick:function(t){var n=t.target;"DIV"==n.nodeName&&e.execCommand("mceInsertContent",!1,n.firstChild.nodeValue)},onmouseover:function(e){var n=t(e.target);n&&o.find("#preview").text(n.firstChild.firstChild.data)}};o=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[u,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){o.close()}}]})}var n=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];e.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:t}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:t,context:"insert"})});
\ No newline at end of file
diff --git a/web/tinymce/plugins/code/plugin.min.js b/web/tinymce/plugins/code/plugin.min.js
new file mode 100755
index 000000000..4f16d6415
--- /dev/null
+++ b/web/tinymce/plugins/code/plugin.min.js
@@ -0,0 +1 @@
+tinymce.PluginManager.add("code",function(e){function o(){e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e.getParam("code_dialog_width",600),minHeight:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),value:e.getContent({source_view:!0}),spellcheck:!1},onSubmit:function(o){e.undoManager.transact(function(){e.setContent(o.data.code)}),e.nodeChanged()}})}e.addCommand("mceCodeEditor",o),e.addButton("code",{icon:"code",tooltip:"Source code",onclick:o}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:o})});
\ No newline at end of file
diff --git a/web/tinymce/plugins/contextmenu/plugin.min.js b/web/tinymce/plugins/contextmenu/plugin.min.js
new file mode 100755
index 000000000..4aabc7062
--- /dev/null
+++ b/web/tinymce/plugins/contextmenu/plugin.min.js
@@ -0,0 +1 @@
+tinymce.PluginManager.add("contextmenu",function(e){var t;e.on("contextmenu",function(n){var i;if(n.preventDefault(),i=e.settings.contextmenu||"link image inserttable | cell row column deletetable",t)t.show();else{var o=[];tinymce.each(i.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"==t&&(n={text:t}),n&&(n.shortcut="",o.push(n))});for(var a=0;a",a=0;s>a;a++){var l=n[r*s+a],c="g"+(r*s+a);i+=' "}i+=" "}i+=" '}),e+=""}),e+=""}var i=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];e.addButton("emoticons",{type:"panelbutton",popoverAlign:"bc-tl",panel:{autohide:!0,html:n,onclick:function(t){var n=e.dom.getParent(t.target,"a");n&&(e.insertContent(''),this.hide())}},tooltip:"Emoticons"})});
\ No newline at end of file
diff --git a/web/tinymce/plugins/example/plugin.min.js b/web/tinymce/plugins/example/plugin.min.js
new file mode 100755
index 000000000..1ff20b46b
--- /dev/null
+++ b/web/tinymce/plugins/example/plugin.min.js
@@ -0,0 +1 @@
+tinymce.PluginManager.add("example",function(t){t.addButton("example",{text:"My button",icon:!1,onclick:function(){t.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(e){t.insertContent("Title: "+e.data.title)}})}}),t.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){t.windowManager.open({title:"TinyMCE site",url:"http://www.tinymce.com",width:800,height:600,buttons:[{text:"Close",onclick:"close"}]})}})});
\ No newline at end of file
diff --git a/web/tinymce/plugins/example_dependency/plugin.min.js b/web/tinymce/plugins/example_dependency/plugin.min.js
new file mode 100755
index 000000000..e61bf473a
--- /dev/null
+++ b/web/tinymce/plugins/example_dependency/plugin.min.js
@@ -0,0 +1 @@
+tinymce.PluginManager.add("example_dependency",function(){},["example"]);
\ No newline at end of file
diff --git a/web/tinymce/plugins/filemanager/ajax_calls.php b/web/tinymce/plugins/filemanager/ajax_calls.php
new file mode 100755
index 000000000..92c503023
--- /dev/null
+++ b/web/tinymce/plugins/filemanager/ajax_calls.php
@@ -0,0 +1,212 @@
+open($path) === true) {
+ //make all the folders
+ for($i = 0; $i < $zip->numFiles; $i++)
+ {
+ $OnlyFileName = $zip->getNameIndex($i);
+ $FullFileName = $zip->statIndex($i);
+ if ($FullFileName['name'][strlen($FullFileName['name'])-1] =="/")
+ {
+ create_folder($base_folder.$FullFileName['name']);
+ }
+ }
+ //unzip into the folders
+ for($i = 0; $i < $zip->numFiles; $i++)
+ {
+ $OnlyFileName = $zip->getNameIndex($i);
+ $FullFileName = $zip->statIndex($i);
+
+ if (!($FullFileName['name'][strlen($FullFileName['name'])-1] =="/"))
+ {
+ $fileinfo = pathinfo($OnlyFileName);
+ if(in_array($fileinfo['extension'],$ext))
+ {
+ copy('zip://'. $path .'#'. $OnlyFileName , $base_folder.$FullFileName['name'] );
+ }
+ }
+ }
+ $zip->close();
+ }else {
+ echo 'failed to open file';
+ }
+ break;
+ case "gz":
+ $p = new PharData($path);
+ $p->decompress(); // creates files.tar
+ break;
+ case "tar":
+ // unarchive from the tar
+ $phar = new PharData($path);
+ $phar->decompressFiles();
+ $files=array();
+ foreach ($phar as $file) {
+ $files[]=($base_folder.$file->getFileName());
+ }
+ $phar->extractTo($current_path.fix_dirname($_POST['path'])."/");
+ foreach($files as $file) check_files_extensions_on_path($file,$ext);
+ break;
+ }
+ break;
+ case 'media_preview':
+
+$preview_file = $_GET["file"];
+$info = pathinfo($preview_file);
+?>
+
+
+
+ ">
+
+
.jpg" alt="folder" />
+
.jpg" alt="folder" />
+
">">
+ " class=" " src="">
+
" class=" " src="">
+
+
">
+
+
+
+
+
diff --git a/web/tinymce/plugins/filemanager/execute.php b/web/tinymce/plugins/filemanager/execute.php
new file mode 100755
index 000000000..04d4602f1
--- /dev/null
+++ b/web/tinymce/plugins/filemanager/execute.php
@@ -0,0 +1,155 @@
+$path){
+ if($path!="" && $path[strlen($path)-1]!="/") $path.="/";
+ if(file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension'])){
+ unlink($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']);
+ }
+ }
+ }
+
+ if($fixed_image_creation){
+ foreach($fixed_path_from_filemanager as $k=>$path){
+ if($path!="" && $path[strlen($path)-1]!="/") $path.="/";
+ $base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
+ if(file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])){
+ unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']);
+ }
+ }
+ }
+ }
+ break;
+ case 'delete_folder':
+ if($delete_folders){
+ if(is_dir($path_thumb))
+ deleteDir($path_thumb);
+ if(is_dir($path)){
+ deleteDir($path);
+ if($fixed_image_creation){
+ foreach($fixed_path_from_filemanager as $k=>$paths){
+ if($paths!="" && $paths[strlen($paths)-1]!="/") $paths.="/";
+ $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
+ if(is_dir($base_dir))
+ deleteDir($base_dir);
+ }
+ }
+ }
+ }
+ break;
+ case 'create_folder':
+ if($create_folders){
+ create_folder(fix_path($path),fix_path($path_thumb));
+ }
+ break;
+ case 'rename_folder':
+ if($rename_folders){
+ $name=fix_filename($name);
+ if(!empty($name)){
+ if(!rename_folder($path,$name))
+ die(lang_Rename_existing_folder);
+ rename_folder($path_thumb,$name);
+ if($fixed_image_creation){
+ foreach($fixed_path_from_filemanager as $k=>$paths){
+ if($paths!="" && $paths[strlen($paths)-1]!="/") $paths.="/";
+ $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
+ rename_folder($base_dir,$name);
+ }
+ }
+ }else{
+ die(lang_Empty_name);
+ }
+ }
+ break;
+ case 'rename_file':
+ if($rename_files){
+ $name=fix_filename($name);
+ if(!empty($name)){
+ if(!rename_file($path,$name))
+ die(lang_Rename_existing_file);
+ rename_file($path_thumb,$name);
+ if($fixed_image_creation){
+ $info=pathinfo($path);
+ foreach($fixed_path_from_filemanager as $k=>$paths){
+ if($paths!="" && $paths[strlen($paths)-1]!="/") $paths.="/";
+ $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
+ if(file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'])){
+ rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]);
+ }
+ }
+ }
+ }else{
+ die(lang_Empty_name);
+ }
+ }
+ break;
+ default:
+ die('wrong action');
+ break;
+ }
+
+}
+
+
+
+?>
diff --git a/web/tinymce/plugins/filemanager/force_download.php b/web/tinymce/plugins/filemanager/force_download.php
new file mode 100755
index 000000000..cb6ff4df9
--- /dev/null
+++ b/web/tinymce/plugins/filemanager/force_download.php
@@ -0,0 +1,29 @@
+
\ No newline at end of file
diff --git a/web/tinymce/plugins/filemanager/img/cut.png b/web/tinymce/plugins/filemanager/img/cut.png
new file mode 100755
index 000000000..f215d6f6b
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/cut.png differ
diff --git a/web/tinymce/plugins/filemanager/img/date.png b/web/tinymce/plugins/filemanager/img/date.png
new file mode 100755
index 000000000..85482c9e6
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/date.png differ
diff --git a/web/tinymce/plugins/filemanager/img/dimension.png b/web/tinymce/plugins/filemanager/img/dimension.png
new file mode 100755
index 000000000..cb46270fd
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/dimension.png differ
diff --git a/web/tinymce/plugins/filemanager/img/door.png b/web/tinymce/plugins/filemanager/img/door.png
new file mode 100755
index 000000000..369fc46ed
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/door.png differ
diff --git a/web/tinymce/plugins/filemanager/img/down.png b/web/tinymce/plugins/filemanager/img/down.png
new file mode 100755
index 000000000..f975a7ac5
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/down.png differ
diff --git a/web/tinymce/plugins/filemanager/img/download.png b/web/tinymce/plugins/filemanager/img/download.png
new file mode 100755
index 000000000..bb0547842
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/download.png differ
diff --git a/web/tinymce/plugins/filemanager/img/edit_img.png b/web/tinymce/plugins/filemanager/img/edit_img.png
new file mode 100755
index 000000000..658ef6233
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/edit_img.png differ
diff --git a/web/tinymce/plugins/filemanager/img/glyphicons-halflings-white.png b/web/tinymce/plugins/filemanager/img/glyphicons-halflings-white.png
new file mode 100755
index 000000000..d62c3e7f4
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/glyphicons-halflings-white.png differ
diff --git a/web/tinymce/plugins/filemanager/img/glyphicons-halflings.png b/web/tinymce/plugins/filemanager/img/glyphicons-halflings.png
new file mode 100755
index 000000000..4fe3f723d
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/glyphicons-halflings.png differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/ac3.jpg b/web/tinymce/plugins/filemanager/img/ico/ac3.jpg
new file mode 100755
index 000000000..cc3f32039
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/ac3.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/accdb.jpg b/web/tinymce/plugins/filemanager/img/ico/accdb.jpg
new file mode 100755
index 000000000..c79958e9f
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/accdb.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/ade.jpg b/web/tinymce/plugins/filemanager/img/ico/ade.jpg
new file mode 100755
index 000000000..df68f4dd4
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/ade.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/adp.jpg b/web/tinymce/plugins/filemanager/img/ico/adp.jpg
new file mode 100755
index 000000000..c79958e9f
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/adp.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/ai.jpg b/web/tinymce/plugins/filemanager/img/ico/ai.jpg
new file mode 100755
index 000000000..dbae61d67
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/ai.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/aiff.jpg b/web/tinymce/plugins/filemanager/img/ico/aiff.jpg
new file mode 100755
index 000000000..04ce9743d
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/aiff.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/avi.jpg b/web/tinymce/plugins/filemanager/img/ico/avi.jpg
new file mode 100755
index 000000000..a6b1004ca
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/avi.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/bmp.jpg b/web/tinymce/plugins/filemanager/img/ico/bmp.jpg
new file mode 100755
index 000000000..cbf874a28
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/bmp.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/css.jpg b/web/tinymce/plugins/filemanager/img/ico/css.jpg
new file mode 100755
index 000000000..d8633f735
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/css.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/csv.jpg b/web/tinymce/plugins/filemanager/img/ico/csv.jpg
new file mode 100755
index 000000000..5a129fffa
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/csv.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/default.jpg b/web/tinymce/plugins/filemanager/img/ico/default.jpg
new file mode 100755
index 000000000..82756170e
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/default.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/dmg.jpg b/web/tinymce/plugins/filemanager/img/ico/dmg.jpg
new file mode 100755
index 000000000..f46d540cf
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/dmg.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/doc.jpg b/web/tinymce/plugins/filemanager/img/ico/doc.jpg
new file mode 100755
index 000000000..0673c2995
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/doc.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/docx.jpg b/web/tinymce/plugins/filemanager/img/ico/docx.jpg
new file mode 100755
index 000000000..0673c2995
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/docx.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/favicon.ico b/web/tinymce/plugins/filemanager/img/ico/favicon.ico
new file mode 100755
index 000000000..73837074b
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/favicon.ico differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/fla.jpg b/web/tinymce/plugins/filemanager/img/ico/fla.jpg
new file mode 100755
index 000000000..060ee92b0
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/fla.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/flv.jpg b/web/tinymce/plugins/filemanager/img/ico/flv.jpg
new file mode 100755
index 000000000..133623761
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/flv.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/folder copia.png b/web/tinymce/plugins/filemanager/img/ico/folder copia.png
new file mode 100755
index 000000000..0a0edcb29
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/folder copia.png differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/folder.jpg b/web/tinymce/plugins/filemanager/img/ico/folder.jpg
new file mode 100755
index 000000000..dd1270ee6
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/folder.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/folder.png b/web/tinymce/plugins/filemanager/img/ico/folder.png
new file mode 100755
index 000000000..9b1b91e4a
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/folder.png differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/folder2.png b/web/tinymce/plugins/filemanager/img/ico/folder2.png
new file mode 100755
index 000000000..160ff8137
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/folder2.png differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/folder_back.jpg b/web/tinymce/plugins/filemanager/img/ico/folder_back.jpg
new file mode 100755
index 000000000..53340ce12
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/folder_back.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/folder_back.png b/web/tinymce/plugins/filemanager/img/ico/folder_back.png
new file mode 100755
index 000000000..de3c8a65b
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/folder_back.png differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/folder_return.png b/web/tinymce/plugins/filemanager/img/ico/folder_return.png
new file mode 100755
index 000000000..67fbd5134
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/folder_return.png differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/gif.jpg b/web/tinymce/plugins/filemanager/img/ico/gif.jpg
new file mode 100755
index 000000000..af8b6a43a
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/gif.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/gz.jpg b/web/tinymce/plugins/filemanager/img/ico/gz.jpg
new file mode 100755
index 000000000..1b3bc1229
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/gz.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/html.jpg b/web/tinymce/plugins/filemanager/img/ico/html.jpg
new file mode 100755
index 000000000..fc0d68f30
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/html.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/iso.jpg b/web/tinymce/plugins/filemanager/img/ico/iso.jpg
new file mode 100755
index 000000000..7a4f9177a
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/iso.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/jpeg.jpg b/web/tinymce/plugins/filemanager/img/ico/jpeg.jpg
new file mode 100755
index 000000000..cbf874a28
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/jpeg.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/jpg.jpg b/web/tinymce/plugins/filemanager/img/ico/jpg.jpg
new file mode 100755
index 000000000..d677547e6
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/jpg.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/log.jpg b/web/tinymce/plugins/filemanager/img/ico/log.jpg
new file mode 100755
index 000000000..82756170e
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/log.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/m4a.jpg b/web/tinymce/plugins/filemanager/img/ico/m4a.jpg
new file mode 100755
index 000000000..90c2f02ad
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/m4a.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/mdb.jpg b/web/tinymce/plugins/filemanager/img/ico/mdb.jpg
new file mode 100755
index 000000000..c79958e9f
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/mdb.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/mid.jpg b/web/tinymce/plugins/filemanager/img/ico/mid.jpg
new file mode 100755
index 000000000..e9541d479
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/mid.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/mov.jpg b/web/tinymce/plugins/filemanager/img/ico/mov.jpg
new file mode 100755
index 000000000..ea901baea
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/mov.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/mp3.jpg b/web/tinymce/plugins/filemanager/img/ico/mp3.jpg
new file mode 100755
index 000000000..5802b8912
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/mp3.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/mp4.jpg b/web/tinymce/plugins/filemanager/img/ico/mp4.jpg
new file mode 100755
index 000000000..98723f073
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/mp4.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/mpeg.jpg b/web/tinymce/plugins/filemanager/img/ico/mpeg.jpg
new file mode 100755
index 000000000..e61f735e9
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/mpeg.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/mpg.jpg b/web/tinymce/plugins/filemanager/img/ico/mpg.jpg
new file mode 100755
index 000000000..37350eb68
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/mpg.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/odb.jpg b/web/tinymce/plugins/filemanager/img/ico/odb.jpg
new file mode 100755
index 000000000..6bf1556ac
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/odb.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/odf.jpg b/web/tinymce/plugins/filemanager/img/ico/odf.jpg
new file mode 100755
index 000000000..7317ae1bc
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/odf.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/odg.jpg b/web/tinymce/plugins/filemanager/img/ico/odg.jpg
new file mode 100755
index 000000000..6db2e776f
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/odg.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/odp.jpg b/web/tinymce/plugins/filemanager/img/ico/odp.jpg
new file mode 100755
index 000000000..2520ac077
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/odp.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/ods.jpg b/web/tinymce/plugins/filemanager/img/ico/ods.jpg
new file mode 100755
index 000000000..7317ae1bc
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/ods.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/odt.jpg b/web/tinymce/plugins/filemanager/img/ico/odt.jpg
new file mode 100755
index 000000000..c0ed0e4ad
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/odt.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/ogg.jpg b/web/tinymce/plugins/filemanager/img/ico/ogg.jpg
new file mode 100755
index 000000000..da6178c6b
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/ogg.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/otg.jpg b/web/tinymce/plugins/filemanager/img/ico/otg.jpg
new file mode 100755
index 000000000..7317ae1bc
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/otg.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/otp.jpg b/web/tinymce/plugins/filemanager/img/ico/otp.jpg
new file mode 100755
index 000000000..dfabc3a74
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/otp.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/ots.jpg b/web/tinymce/plugins/filemanager/img/ico/ots.jpg
new file mode 100755
index 000000000..6db2e776f
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/ots.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/ott.jpg b/web/tinymce/plugins/filemanager/img/ico/ott.jpg
new file mode 100755
index 000000000..6db2e776f
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/ott.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/pdf.jpg b/web/tinymce/plugins/filemanager/img/ico/pdf.jpg
new file mode 100755
index 000000000..3849ebeb6
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/pdf.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/png.jpg b/web/tinymce/plugins/filemanager/img/ico/png.jpg
new file mode 100755
index 000000000..634c68025
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/png.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/ppt.jpg b/web/tinymce/plugins/filemanager/img/ico/ppt.jpg
new file mode 100755
index 000000000..72853055d
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/ppt.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/pptx.jpg b/web/tinymce/plugins/filemanager/img/ico/pptx.jpg
new file mode 100755
index 000000000..72853055d
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/pptx.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/psd.jpg b/web/tinymce/plugins/filemanager/img/ico/psd.jpg
new file mode 100755
index 000000000..3191792f5
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/psd.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/rar.jpg b/web/tinymce/plugins/filemanager/img/ico/rar.jpg
new file mode 100755
index 000000000..497ac396f
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/rar.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/rtf.jpg b/web/tinymce/plugins/filemanager/img/ico/rtf.jpg
new file mode 100755
index 000000000..0673c2995
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/rtf.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/sql.jpg b/web/tinymce/plugins/filemanager/img/ico/sql.jpg
new file mode 100755
index 000000000..44eb81c01
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/sql.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/svg.jpg b/web/tinymce/plugins/filemanager/img/ico/svg.jpg
new file mode 100755
index 000000000..a58bf082f
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/svg.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/tar.jpg b/web/tinymce/plugins/filemanager/img/ico/tar.jpg
new file mode 100755
index 000000000..a7df7b14c
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/tar.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/tiff.jpg b/web/tinymce/plugins/filemanager/img/ico/tiff.jpg
new file mode 100755
index 000000000..bc0012914
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/tiff.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/txt.jpg b/web/tinymce/plugins/filemanager/img/ico/txt.jpg
new file mode 100755
index 000000000..82756170e
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/txt.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/wav.jpg b/web/tinymce/plugins/filemanager/img/ico/wav.jpg
new file mode 100755
index 000000000..da6178c6b
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/wav.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/webm.jpg b/web/tinymce/plugins/filemanager/img/ico/webm.jpg
new file mode 100755
index 000000000..a6b1004ca
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/webm.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/wma.jpg b/web/tinymce/plugins/filemanager/img/ico/wma.jpg
new file mode 100755
index 000000000..a6b1004ca
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/wma.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/xhtml.jpg b/web/tinymce/plugins/filemanager/img/ico/xhtml.jpg
new file mode 100755
index 000000000..d2f9daf68
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/xhtml.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/xls.jpg b/web/tinymce/plugins/filemanager/img/ico/xls.jpg
new file mode 100755
index 000000000..5a129fffa
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/xls.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/xlsx.jpg b/web/tinymce/plugins/filemanager/img/ico/xlsx.jpg
new file mode 100755
index 000000000..5a129fffa
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/xlsx.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/xml.jpg b/web/tinymce/plugins/filemanager/img/ico/xml.jpg
new file mode 100755
index 000000000..82756170e
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/xml.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/ico/zip.jpg b/web/tinymce/plugins/filemanager/img/ico/zip.jpg
new file mode 100755
index 000000000..a7df7b14c
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/ico/zip.jpg differ
diff --git a/web/tinymce/plugins/filemanager/img/info.png b/web/tinymce/plugins/filemanager/img/info.png
new file mode 100755
index 000000000..dfb3971d0
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/info.png differ
diff --git a/web/tinymce/plugins/filemanager/img/label.png b/web/tinymce/plugins/filemanager/img/label.png
new file mode 100755
index 000000000..f5b5b200f
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/label.png differ
diff --git a/web/tinymce/plugins/filemanager/img/loading.gif b/web/tinymce/plugins/filemanager/img/loading.gif
new file mode 100755
index 000000000..6fba77609
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/loading.gif differ
diff --git a/web/tinymce/plugins/filemanager/img/logo.png b/web/tinymce/plugins/filemanager/img/logo.png
new file mode 100755
index 000000000..2a9a0dea9
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/logo.png differ
diff --git a/web/tinymce/plugins/filemanager/img/page_white_add.png b/web/tinymce/plugins/filemanager/img/page_white_add.png
new file mode 100755
index 000000000..a70de096e
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/page_white_add.png differ
diff --git a/web/tinymce/plugins/filemanager/img/page_white_copy.png b/web/tinymce/plugins/filemanager/img/page_white_copy.png
new file mode 100755
index 000000000..a9f31a278
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/page_white_copy.png differ
diff --git a/web/tinymce/plugins/filemanager/img/page_white_delete.png b/web/tinymce/plugins/filemanager/img/page_white_delete.png
new file mode 100755
index 000000000..7bb3d9562
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/page_white_delete.png differ
diff --git a/web/tinymce/plugins/filemanager/img/page_white_edit.png b/web/tinymce/plugins/filemanager/img/page_white_edit.png
new file mode 100755
index 000000000..b93e77600
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/page_white_edit.png differ
diff --git a/web/tinymce/plugins/filemanager/img/page_white_paste.png b/web/tinymce/plugins/filemanager/img/page_white_paste.png
new file mode 100755
index 000000000..5b2cbb3fd
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/page_white_paste.png differ
diff --git a/web/tinymce/plugins/filemanager/img/preview.png b/web/tinymce/plugins/filemanager/img/preview.png
new file mode 100755
index 000000000..07af08039
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/preview.png differ
diff --git a/web/tinymce/plugins/filemanager/img/processing.gif b/web/tinymce/plugins/filemanager/img/processing.gif
new file mode 100755
index 000000000..7c99504e1
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/processing.gif differ
diff --git a/web/tinymce/plugins/filemanager/img/rename.png b/web/tinymce/plugins/filemanager/img/rename.png
new file mode 100755
index 000000000..82d9f13f6
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/rename.png differ
diff --git a/web/tinymce/plugins/filemanager/img/size.png b/web/tinymce/plugins/filemanager/img/size.png
new file mode 100755
index 000000000..abbc74487
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/size.png differ
diff --git a/web/tinymce/plugins/filemanager/img/sort.png b/web/tinymce/plugins/filemanager/img/sort.png
new file mode 100755
index 000000000..d741e10f5
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/sort.png differ
diff --git a/web/tinymce/plugins/filemanager/img/spritemap.png b/web/tinymce/plugins/filemanager/img/spritemap.png
new file mode 100755
index 000000000..9f2131454
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/spritemap.png differ
diff --git a/web/tinymce/plugins/filemanager/img/spritemap@2x.png b/web/tinymce/plugins/filemanager/img/spritemap@2x.png
new file mode 100755
index 000000000..e877eea6a
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/spritemap@2x.png differ
diff --git a/web/tinymce/plugins/filemanager/img/spritemap@2x_hu_HU.png b/web/tinymce/plugins/filemanager/img/spritemap@2x_hu_HU.png
new file mode 100755
index 000000000..97e2c5507
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/spritemap@2x_hu_HU.png differ
diff --git a/web/tinymce/plugins/filemanager/img/spritemap_hu_HU.png b/web/tinymce/plugins/filemanager/img/spritemap_hu_HU.png
new file mode 100755
index 000000000..b2ec8ee9c
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/spritemap_hu_HU.png differ
diff --git a/web/tinymce/plugins/filemanager/img/storing_animation.gif b/web/tinymce/plugins/filemanager/img/storing_animation.gif
new file mode 100755
index 000000000..eca3a53c7
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/storing_animation.gif differ
diff --git a/web/tinymce/plugins/filemanager/img/up.png b/web/tinymce/plugins/filemanager/img/up.png
new file mode 100755
index 000000000..d7b3925c0
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/up.png differ
diff --git a/web/tinymce/plugins/filemanager/img/url.png b/web/tinymce/plugins/filemanager/img/url.png
new file mode 100755
index 000000000..e0db55199
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/url.png differ
diff --git a/web/tinymce/plugins/filemanager/img/zip.png b/web/tinymce/plugins/filemanager/img/zip.png
new file mode 100755
index 000000000..95355ce77
Binary files /dev/null and b/web/tinymce/plugins/filemanager/img/zip.png differ
diff --git a/web/tinymce/plugins/filemanager/include/php_image_magician.php b/web/tinymce/plugins/filemanager/include/php_image_magician.php
new file mode 100755
index 000000000..28bf50fb6
--- /dev/null
+++ b/web/tinymce/plugins/filemanager/include/php_image_magician.php
@@ -0,0 +1,3320 @@
+ resizeImage(150, 100, 0);
+ # $magicianObj -> saveImage('images/car_small.jpg', 100);
+ #
+ # - See end of doc for more examples -
+ #
+ # Supported file types include: jpg, png, gif, bmp, psd (read)
+ #
+ #
+ #
+ # The following functions are taken from phpThumb() [available from
+ # http://phpthumb.sourceforge.net], and are used with written permission
+ # from James Heinrich.
+ # - GD2BMPstring
+ # - GetPixelColor
+ # - LittleEndian2String
+ #
+ # The following functions are from Marc Hibbins and are used with written
+ # permission (are also under the Attribution-ShareAlike
+ # [http://creativecommons.org/licenses/by-sa/3.0/] license.
+ # -
+ #
+ # PhpPsdReader is used with written permission from Tim de Koning.
+ # [http://www.kingsquare.nl/phppsdreader]
+ #
+ #
+ #
+ # Modificatoin history
+ # Date Initials Ver Description
+ # 10-05-11 J.C.O 0.0 Initial build
+ # 01-06-11 J.C.O 0.1.1 * Added reflections
+ # * Added Rounded corners
+ # * You can now use PNG interlacing
+ # * Added shadow
+ # * Added caption box
+ # * Added vintage filter
+ # * Added dynamic image resizing (resize on the fly)
+ # * minor bug fixes
+ # 05-06-11 J.C.O 0.1.1.1 * Fixed undefined variables
+ # 17-06-11 J.C.O 0.1.2 * Added image_batch_class.php class
+ # * Minor bug fixes
+ # 26-07-11 J.C.O 0.1.4 * Added support for external images
+ # * Can now set the crop poisition
+ # 03-08-11 J.C.O 0.1.5 * Added reset() method to reset resource to
+ # original input file.
+ # * Added method addTextToCaptionBox() to
+ # simplify adding text to a caption box.
+ # * Added experimental writeIPTC. (not finished)
+ # * Added experimental readIPTC. (not finished)
+ # 11-08-11 J.C.O * Added initial border presets.
+ # 30-08-11 J.C.O * Added 'auto' crop option to crop portrait
+ # images near the top.
+ # 08-09-11 J.C.O * Added cropImage() method to allow standalone
+ # cropping.
+ # 17-09-11 J.C.O * Added setCropFromTop() set method - set the
+ # percentage to crop from the top when using
+ # crop 'auto' option.
+ # * Added setTransparency() set method - allows you
+ # to turn transparency off (like when saving
+ # as a jpg).
+ # * Added setFillColor() set method - set the
+ # background color to use instead of transparency.
+ # 05-11-11 J.C.O 0.1.5.1 * Fixed interlacing option
+ # 0-07-12 J.C.O 1.0
+ #
+ # Known issues & Limitations:
+ # -------------------------------
+ # Not so much an issue, the image is destroyed on the deconstruct rather than
+ # when we have finished with it. The reason for this is that we don't know
+ # when we're finished with it as you can both save the image and display
+ # it directly to the screen (imagedestroy($this->imageResized))
+ #
+ # Opening BMP files is slow. A test with 884 bmp files processed in a loop
+ # takes forever - over 5 min. This test inlcuded opening the file, then
+ # getting and displaying its width and height.
+ #
+ # $forceStretch:
+ # -------------------------------
+ # On by default.
+ # $forceStretch can be disabled by calling method setForceStretch with false
+ # parameter. If disabled, if an images original size is smaller than the size
+ # specified by the user, the original size will be used. This is useful when
+ # dealing with small images.
+ #
+ # If enabled, images smaller than the size specified will be stretched to
+ # that size.
+ #
+ # Tips:
+ # -------------------------------
+ # * If you're resizing a transparent png and saving it as a jpg, set
+ # $keepTransparency to false with: $magicianObj->setTransparency(false);
+ #
+ # FEATURES:
+ # * EASY TO USE
+ # * BMP SUPPORT (read & write)
+ # * PSD (photoshop) support (read)
+ # * RESIZE IMAGES
+ # - Preserve transparency (png, gif)
+ # - Apply sharpening (jpg) (requires PHP >= 5.1.0)
+ # - Set image quality (jpg, png)
+ # - Resize modes:
+ # - exact size
+ # - resize by width (auto height)
+ # - resize by height (auto width)
+ # - auto (automatically determine the best of the above modes to use)
+ # - crop - resize as best as it can then crop the rest
+ # - Force stretching of smaller images (upscale)
+ # * APPLY FILTERS
+ # - Convert to grey scale
+ # - Convert to black and white
+ # - Convert to sepia
+ # - Convert to negative
+ # * ROTATE IMAGES
+ # - Rotate using predefined "left", "right", or "180"; or any custom degree amount
+ # * EXTRACT EXIF DATA (requires exif module)
+ # - make
+ # - model
+ # - date
+ # - exposure
+ # - aperture
+ # - f-stop
+ # - iso
+ # - focal length
+ # - exposure program
+ # - metering mode
+ # - flash status
+ # - creator
+ # - copyright
+ # * ADD WATERMARK
+ # - Specify exact x, y placement
+ # - Or, specify using one of the 9 pre-defined placements such as "tl"
+ # (for top left), "m" (for middle), "br" (for bottom right)
+ # - also specify padding from edge amount (optional).
+ # - Set opacity of watermark (png).
+ # * ADD BORDER
+ # * USE HEX WHEN SPECIFYING COLORS (eg: #ffffff)
+ # * SAVE IMAGE OR OUTPUT TO SCREEN
+ #
+ #
+ # ========================================================================#
+
+
+class imageLib
+{
+
+ private $fileName;
+ private $image;
+ protected $imageResized;
+ private $widthOriginal; # Always be the original width
+ private $heightOriginal;
+ private $width; # Current width (width after resize)
+ private $height;
+ private $imageSize;
+ private $fileExtension;
+
+ private $debug = true;
+ private $errorArray = array();
+
+ private $forceStretch = true;
+ private $aggresiveSharpening = false;
+
+ private $transparentArray = array('.png', '.gif');
+ private $keepTransparency = true;
+ private $fillColorArray = array('r'=>255, 'g'=>255, 'b'=>255);
+
+ private $sharpenArray = array('jpg');
+
+ private $psdReaderPath;
+ private $filterOverlayPath;
+
+ private $isInterlace;
+
+ private $captionBoxPositionArray = array();
+
+ private $fontDir = 'fonts';
+
+ private $cropFromTopPercent = 10;
+
+
+## --------------------------------------------------------
+
+ function __construct($fileName)
+ # Author: Jarrod Oberto
+ # Date: 27-02-08
+ # Purpose: Constructor
+ # Param in: $fileName: File name and path.
+ # Param out: n/a
+ # Reference:
+ # Notes:
+ #
+ {
+ if (!$this->testGDInstalled()) { if ($this->debug) { throw new Exception('The GD Library is not installed.'); }else{ throw new Exception(); }};
+
+ $this->initialise();
+
+ // *** Save the image file name. Only store this incase you want to display it
+ $this->fileName = $fileName;
+ $this->fileExtension = mb_strtolower(strrchr($fileName, '.'));
+
+ // *** Open up the file
+ $this->image = $this->openImage($fileName);
+
+
+ // *** Assign here so we don't modify the original
+ $this->imageResized = $this->image;
+
+ // *** If file is an image
+ if ($this->testIsImage($this->image))
+ {
+ // *** Get width and height
+ $this->width = imagesx($this->image);
+ $this->widthOriginal = imagesx($this->image);
+ $this->height = imagesy($this->image);
+ $this->heightOriginal = imagesy($this->image);
+
+
+ /* Added 15-09-08
+ * Get the filesize using this build in method.
+ * Stores an array of size
+ *
+ * $this->imageSize[1] = width
+ * $this->imageSize[2] = height
+ * $this->imageSize[3] = width x height
+ *
+ */
+ $this->imageSize = getimagesize($this->fileName);
+
+ } else {
+ $this->errorArray[] = 'File is not an image';
+ }
+ }
+
+## --------------------------------------------------------
+
+ private function initialise () {
+
+ $this->psdReaderPath = dirname(__FILE__) . '/classPhpPsdReader.php';
+ $this->filterOverlayPath = dirname(__FILE__) . '/filters';
+
+ // *** Set if image should be interlaced or not.
+ $this->isInterlace = false;
+ }
+
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Resize
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+
+ public function resizeImage($newWidth, $newHeight, $option = 0, $sharpen = false, $autoRotate = false)
+ # Author: Jarrod Oberto
+ # Date: 27-02-08
+ # Purpose: Resizes the image
+ # Param in: $newWidth:
+ # $newHeight:
+ # $option: 0 / exact = defined size;
+ # 1 / portrait = keep aspect set height;
+ # 2 / landscape = keep aspect set width;
+ # 3 / auto = auto;
+ # 4 / crop= resize and crop;
+ #
+ # $option can also be an array containing options for
+ # cropping. E.G., array('crop', 'r')
+ #
+ # This array only applies to 'crop' and the 'r' refers to
+ # "crop right". Other value include; tl, t, tr, l, m (default),
+ # r, bl, b, br, or you can specify your own co-ords (which
+ # isn't recommended.
+ #
+ # $sharpen: true: sharpen (jpg only);
+ # false: don't sharpen
+ # Param out: n/a
+ # Reference:
+ # Notes: To clarify the $option input:
+ # 0 = The exact height and width dimensions you set.
+ # 1 = Whatever height is passed in will be the height that
+ # is set. The width will be calculated and set automatically
+ # to a the value that keeps the original aspect ratio.
+ # 2 = The same but based on the width. We try make the image the
+ # biggest size we can while stil fitting inside the box size
+ # 3 = Depending whether the image is landscape or portrait, this
+ # will automatically determine whether to resize via
+ # dimension 1,2 or 0
+ # 4 = Will resize and then crop the image for best fit
+ #
+ # forceStretch can be applied to options 1,2,3 and 4
+ #
+ {
+
+ // *** We can pass in an array of options to change the crop position
+ $cropPos = 'm';
+ if (is_array($option) && mb_strtolower($option[0]) == 'crop') {
+ $cropPos = $option[1]; # get the crop option
+ } else if (strpos($option, '-') !== false) {
+ // *** Or pass in a hyphen seperated option
+ $optionPiecesArray = explode('-', $option);
+ $cropPos = end($optionPiecesArray);
+ }
+
+ // *** Check the option is valid
+ $option = $this->prepOption($option);
+
+ // *** Make sure the file passed in is valid
+ if (!$this->image) { if ($this->debug) { throw new Exception('file ' . $this->getFileName() .' is missing or invalid'); }else{ throw new Exception(); }};
+
+ // *** Get optimal width and height - based on $option
+ $dimensionsArray = $this->getDimensions($newWidth, $newHeight, $option);
+
+ $optimalWidth = $dimensionsArray['optimalWidth'];
+ $optimalHeight = $dimensionsArray['optimalHeight'];
+
+ // *** Resample - create image canvas of x, y size
+ $this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);
+ $this->keepTransparancy($optimalWidth, $optimalHeight, $this->imageResized);
+ imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);
+
+
+ // *** If '4', then crop too
+ if ($option == 4 || $option == 'crop') {
+
+ if (($optimalWidth >= $newWidth && $optimalHeight >= $newHeight)) {
+ $this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos);
+ }
+ }
+
+ // *** If Rotate.
+ if ($autoRotate) {
+
+ $exifData = $this->getExif(false);
+ if (count($exifData) > 0) {
+
+ switch($exifData['orientation']) {
+ case 8:
+ $this->imageResized = imagerotate($this->imageResized,90,0);
+ break;
+ case 3:
+ $this->imageResized = imagerotate($this->imageResized,180,0);
+ break;
+ case 6:
+ $this->imageResized = imagerotate($this->imageResized,-90,0);
+ break;
+ }
+ }
+ }
+
+ // *** Sharpen image (if jpg and the user wishes to do so)
+ if ($sharpen && in_array($this->fileExtension, $this->sharpenArray)) {
+
+ // *** Sharpen
+ $this->sharpen();
+ }
+ }
+
+## --------------------------------------------------------
+
+ public function cropImage($newWidth, $newHeight, $cropPos = 'm')
+ # Author: Jarrod Oberto
+ # Date: 08-09-11
+ # Purpose: Crops the image
+ # Param in: $newWidth: crop with
+ # $newHeight: crop height
+ # $cropPos: Can be any of the following:
+ # tl, t, tr, l, m, r, bl, b, br, auto
+ # Or:
+ # a custom position such as '30x50'
+ # Param out: n/a
+ # Reference:
+ # Notes:
+ #
+ {
+
+ // *** Make sure the file passed in is valid
+ if (!$this->image) { if ($this->debug) { throw new Exception('file ' . $this->getFileName() .' is missing or invalid'); }else{ throw new Exception(); }};
+
+ $this->imageResized = $this->image;
+ $this->crop($this->width, $this->height, $newWidth, $newHeight, $cropPos);
+
+ }
+
+## --------------------------------------------------------
+
+ private function keepTransparancy($width, $height, $im)
+ # Author: Jarrod Oberto
+ # Date: 08-04-11
+ # Purpose: Keep transparency for png and gif image
+ # Param in:
+ # Param out: n/a
+ # Reference:
+ # Notes:
+ #
+ {
+ // *** If PNG, perform some transparency retention actions (gif untested)
+ if (in_array($this->fileExtension, $this->transparentArray) && $this->keepTransparency) {
+ imagealphablending($im, false);
+ imagesavealpha($im, true);
+ $transparent = imagecolorallocatealpha($im, 255, 255, 255, 127);
+ imagefilledrectangle($im, 0, 0, $width, $height, $transparent);
+ } else {
+ $color = imagecolorallocate($im, $this->fillColorArray['r'], $this->fillColorArray['g'], $this->fillColorArray['b']);
+ imagefilledrectangle($im, 0, 0, $width, $height, $color);
+ }
+ }
+
+## --------------------------------------------------------
+
+ private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos)
+ # Author: Jarrod Oberto
+ # Date: 15-09-08
+ # Purpose: Crops the image
+ # Param in: $newWidth:
+ # $newHeight:
+ # Param out: n/a
+ # Reference:
+ # Notes:
+ #
+ {
+
+ // *** Get cropping co-ordinates
+ $cropArray = $this->getCropPlacing($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos);
+ $cropStartX = $cropArray['x'];
+ $cropStartY = $cropArray['y'];
+
+ // *** Crop this bad boy
+ $crop = imagecreatetruecolor($newWidth , $newHeight);
+ $this->keepTransparancy($optimalWidth, $optimalHeight, $crop);
+ imagecopyresampled($crop, $this->imageResized, 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight);
+
+ $this->imageResized = $crop;
+
+ // *** Set new width and height to our variables
+ $this->width = $newWidth;
+ $this->height = $newHeight;
+
+ }
+
+## --------------------------------------------------------
+
+ private function getCropPlacing($optimalWidth, $optimalHeight, $newWidth, $newHeight, $pos='m')
+ #
+ # Author: Jarrod Oberto
+ # Date: July 11
+ # Purpose: Set the cropping area.
+ # Params in:
+ # Params out: (array) the crop x and y co-ordinates.
+ # Notes: When specifying the exact pixel crop position (eg 10x15), be
+ # very careful as it's easy to crop out of the image leaving
+ # black borders.
+ #
+ {
+ $pos = mb_strtolower($pos);
+
+ // *** If co-ords have been entered
+ if (strstr($pos, 'x')) {
+ $pos = str_replace(' ', '', $pos);
+
+ $xyArray = explode('x', $pos);
+ list($cropStartX, $cropStartY) = $xyArray;
+
+ } else {
+
+ switch ($pos) {
+ case 'tl':
+ $cropStartX = 0;
+ $cropStartY = 0;
+ break;
+
+ case 't':
+ $cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
+ $cropStartY = 0;
+ break;
+
+ case 'tr':
+ $cropStartX = $optimalWidth - $newWidth;
+ $cropStartY = 0;
+ break;
+
+ case 'l':
+ $cropStartX = 0;
+ $cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
+ break;
+
+ case 'm':
+ $cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
+ $cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
+ break;
+
+ case 'r':
+ $cropStartX = $optimalWidth - $newWidth;
+ $cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
+ break;
+
+ case 'bl':
+ $cropStartX = 0;
+ $cropStartY = $optimalHeight - $newHeight;
+ break;
+
+ case 'b':
+ $cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
+ $cropStartY = $optimalHeight - $newHeight;
+ break;
+
+ case 'br':
+ $cropStartX = $optimalWidth - $newWidth;
+ $cropStartY = $optimalHeight - $newHeight;
+ break;
+
+ case 'auto':
+ // *** If image is a portrait crop from top, not center. v1.5
+ if ($optimalHeight > $optimalWidth) {
+ $cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
+ $cropStartY = ($this->cropFromTopPercent /100) * $optimalHeight;
+ } else {
+
+ // *** Else crop from the center
+ $cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
+ $cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
+ }
+ break;
+
+ default:
+ // *** Default to center
+ $cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
+ $cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
+ break;
+ }
+ }
+
+ return array('x' => $cropStartX, 'y' => $cropStartY);
+ }
+
+## --------------------------------------------------------
+
+ private function getDimensions($newWidth, $newHeight, $option)
+ # Author: Jarrod Oberto
+ # Date: 17-11-09
+ # Purpose: Get new image dimensions based on user specificaions
+ # Param in: $newWidth:
+ # $newHeight:
+ # Param out: Array of new width and height values
+ # Reference:
+ # Notes: If $option = 3 then this function is call recursivly
+ #
+ # To clarify the $option input:
+ # 0 = The exact height and width dimensions you set.
+ # 1 = Whatever height is passed in will be the height that
+ # is set. The width will be calculated and set automatically
+ # to a the value that keeps the original aspect ratio.
+ # 2 = The same but based on the width.
+ # 3 = Depending whether the image is landscape or portrait, this
+ # will automatically determine whether to resize via
+ # dimension 1,2 or 0.
+ # 4 = Resize the image as much as possible, then crop the
+ # remainder.
+ {
+
+ switch (strval($option))
+ {
+ case '0':
+ case 'exact':
+ $optimalWidth = $newWidth;
+ $optimalHeight= $newHeight;
+ break;
+ case '1':
+ case 'portrait':
+ $dimensionsArray = $this->getSizeByFixedHeight($newWidth, $newHeight);
+ $optimalWidth = $dimensionsArray['optimalWidth'];
+ $optimalHeight = $dimensionsArray['optimalHeight'];
+ break;
+ case '2':
+ case 'landscape':
+ $dimensionsArray = $this->getSizeByFixedWidth($newWidth, $newHeight);
+ $optimalWidth = $dimensionsArray['optimalWidth'];
+ $optimalHeight = $dimensionsArray['optimalHeight'];
+ break;
+ case '3':
+ case 'auto':
+ $dimensionsArray = $this->getSizeByAuto($newWidth, $newHeight);
+ $optimalWidth = $dimensionsArray['optimalWidth'];
+ $optimalHeight = $dimensionsArray['optimalHeight'];
+ break;
+ case '4':
+ case 'crop':
+ $dimensionsArray = $this->getOptimalCrop($newWidth, $newHeight);
+ $optimalWidth = $dimensionsArray['optimalWidth'];
+ $optimalHeight = $dimensionsArray['optimalHeight'];
+ break;
+ }
+
+ return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
+ }
+
+## --------------------------------------------------------
+
+ private function getSizeByFixedHeight($newWidth, $newHeight)
+ {
+ // *** If forcing is off...
+ if (!$this->forceStretch) {
+
+ // *** ...check if actual height is less than target height
+ if ($this->height < $newHeight) {
+ return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height);
+ }
+ }
+
+ $ratio = $this->width / $this->height;
+
+ $newWidth = $newHeight * $ratio;
+
+ //return $newWidth;
+ return array('optimalWidth' => $newWidth, 'optimalHeight' => $newHeight);
+ }
+
+## --------------------------------------------------------
+
+ private function getSizeByFixedWidth($newWidth, $newHeight)
+ {
+ // *** If forcing is off...
+ if (!$this->forceStretch) {
+
+ // *** ...check if actual width is less than target width
+ if ($this->width < $newWidth) {
+ return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height);
+ }
+ }
+
+ $ratio = $this->height / $this->width;
+
+ $newHeight = $newWidth * $ratio;
+
+ //return $newHeight;
+ return array('optimalWidth' => $newWidth, 'optimalHeight' => $newHeight);
+ }
+
+## --------------------------------------------------------
+
+ private function getSizeByAuto($newWidth, $newHeight)
+ # Author: Jarrod Oberto
+ # Date: 19-08-08
+ # Purpose: Depending on the height, choose to resize by 0, 1, or 2
+ # Param in: The new height and new width
+ # Notes:
+ #
+ {
+ // *** If forcing is off...
+ if (!$this->forceStretch) {
+
+ // *** ...check if actual size is less than target size
+ if ($this->width < $newWidth && $this->height < $newHeight) {
+ return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height);
+ }
+ }
+
+ if ($this->height < $this->width)
+ // *** Image to be resized is wider (landscape)
+ {
+ //$optimalWidth = $newWidth;
+ //$optimalHeight= $this->getSizeByFixedWidth($newWidth);
+
+ $dimensionsArray = $this->getSizeByFixedWidth($newWidth, $newHeight);
+ $optimalWidth = $dimensionsArray['optimalWidth'];
+ $optimalHeight = $dimensionsArray['optimalHeight'];
+ }
+ elseif ($this->height > $this->width)
+ // *** Image to be resized is taller (portrait)
+ {
+ //$optimalWidth = $this->getSizeByFixedHeight($newHeight);
+ //$optimalHeight= $newHeight;
+
+ $dimensionsArray = $this->getSizeByFixedHeight($newWidth, $newHeight);
+ $optimalWidth = $dimensionsArray['optimalWidth'];
+ $optimalHeight = $dimensionsArray['optimalHeight'];
+ }
+ else
+ // *** Image to be resizerd is a square
+ {
+
+ if ($newHeight < $newWidth) {
+ //$optimalWidth = $newWidth;
+ //$optimalHeight= $this->getSizeByFixedWidth($newWidth);
+ $dimensionsArray = $this->getSizeByFixedWidth($newWidth, $newHeight);
+ $optimalWidth = $dimensionsArray['optimalWidth'];
+ $optimalHeight = $dimensionsArray['optimalHeight'];
+ } else if ($newHeight > $newWidth) {
+ //$optimalWidth = $this->getSizeByFixedHeight($newHeight);
+ //$optimalHeight= $newHeight;
+ $dimensionsArray = $this->getSizeByFixedHeight($newWidth, $newHeight);
+ $optimalWidth = $dimensionsArray['optimalWidth'];
+ $optimalHeight = $dimensionsArray['optimalHeight'];
+ } else {
+ // *** Sqaure being resized to a square
+ $optimalWidth = $newWidth;
+ $optimalHeight= $newHeight;
+ }
+ }
+
+ return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
+ }
+
+## --------------------------------------------------------
+
+ private function getOptimalCrop($newWidth, $newHeight)
+ # Author: Jarrod Oberto
+ # Date: 17-11-09
+ # Purpose: Get optimal crop dimensions
+ # Param in: width and height as requested by user (fig 3)
+ # Param out: Array of optimal width and height (fig 2)
+ # Reference:
+ # Notes: The optimal width and height return are not the same as the
+ # same as the width and height passed in. For example:
+ #
+ #
+ # |-----------------| |------------| |-------|
+ # | | => |**| |**| => | |
+ # | | |**| |**| | |
+ # | | |------------| |-------|
+ # |-----------------|
+ # original optimal crop
+ # size size size
+ # Fig 1 2 3
+ #
+ # 300 x 250 150 x 125 150 x 100
+ #
+ # The optimal size is the smallest size (that is closest to the crop size)
+ # while retaining proportion/ratio.
+ #
+ # The crop size is the optimal size that has been cropped on one axis to
+ # make the image the exact size specified by the user.
+ #
+ # * represent cropped area
+ #
+ {
+
+ // *** If forcing is off...
+ if (!$this->forceStretch) {
+
+ // *** ...check if actual size is less than target size
+ if ($this->width < $newWidth && $this->height < $newHeight) {
+ return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height);
+ }
+ }
+
+ $heightRatio = $this->height / $newHeight;
+ $widthRatio = $this->width / $newWidth;
+
+ if ($heightRatio < $widthRatio) {
+ $optimalRatio = $heightRatio;
+ } else {
+ $optimalRatio = $widthRatio;
+ }
+
+ $optimalHeight = round( $this->height / $optimalRatio );
+ $optimalWidth = round( $this->width / $optimalRatio );
+
+ return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
+ }
+
+## --------------------------------------------------------
+
+ private function sharpen()
+ # Author: Jarrod Oberto
+ # Date: 08 04 2011
+ # Purpose: Sharpen image
+ # Param in: n/a
+ # Param out: n/a
+ # Reference:
+ # Notes:
+ # Credit: Incorporates Joe Lencioni (August 6, 2008) code
+ {
+
+ if (version_compare(PHP_VERSION, '5.1.0') >= 0) {
+
+ // ***
+ if ($this->aggresiveSharpening) { # A more aggressive sharpening solution
+
+ $sharpenMatrix = array( array( -1, -1, -1 ),
+ array( -1, 16, -1 ),
+ array( -1, -1, -1 ) );
+ $divisor = 8;
+ $offset = 0;
+
+ imageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset);
+ }
+ else # More subtle and personally more desirable
+ {
+ $sharpness = $this->findSharp($this->widthOriginal, $this->width);
+
+ $sharpenMatrix = array(
+ array(-1, -2, -1),
+ array(-2, $sharpness + 12, -2), //Lessen the effect of a filter by increasing the value in the center cell
+ array(-1, -2, -1)
+ );
+ $divisor = $sharpness; // adjusts brightness
+ $offset = 0;
+ imageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset);
+ }
+ }
+ else
+ {
+ if ($this->debug) { throw new Exception('Sharpening required PHP 5.1.0 or greater.'); }
+ }
+ }
+
+ ## --------------------------------------------------------
+
+ private function sharpen2($level)
+ {
+ $sharpenMatrix = array(
+ array($level, $level, $level),
+ array($level, (8*$level)+1, $level), //Lessen the effect of a filter by increasing the value in the center cell
+ array($level, $level, $level)
+ );
+
+ }
+
+## --------------------------------------------------------
+
+ private function findSharp($orig, $final)
+ # Author: Ryan Rud (http://adryrun.com)
+ # Purpose: Find optimal sharpness
+ # Param in: n/a
+ # Param out: n/a
+ # Reference:
+ # Notes:
+ #
+ {
+ $final = $final * (750.0 / $orig);
+ $a = 52;
+ $b = -0.27810650887573124;
+ $c = .00047337278106508946;
+
+ $result = $a + $b * $final + $c * $final * $final;
+
+ return max(round($result), 0);
+ }
+
+## --------------------------------------------------------
+
+ private function prepOption($option)
+ # Author: Jarrod Oberto
+ # Purpose: Prep option like change the passed in option to lowercase
+ # Param in: (str/int) $option: eg. 'exact', 'crop'. 0, 4
+ # Param out: lowercase string
+ # Reference:
+ # Notes:
+ #
+ {
+ if (is_array($option)) {
+ if (mb_strtolower($option[0]) == 'crop' && count($option) == 2) {
+ return 'crop';
+ } else {
+ throw new Exception('Crop resize option array is badly formatted.');
+ }
+ } else if (strpos($option, 'crop') !== false) {
+ return 'crop';
+ }
+
+ if (is_string($option)) {
+ return mb_strtolower($option);
+ }
+
+ return $option;
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Presets
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+#
+# Preset are pre-defined templates you can apply to your image.
+#
+# These are inteded to be applied to thumbnail images.
+#
+
+
+ public function borderPreset($preset)
+ {
+ switch ($preset)
+ {
+
+ case 'simple':
+ $this->addBorder(7, '#fff');
+ $this->addBorder(6, '#f2f1f0');
+ $this->addBorder(2, '#fff');
+ $this->addBorder(1, '#ccc');
+ break;
+ default:
+ break;
+ }
+
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Draw border
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function addBorder($thickness = 1, $rgbArray = array(255, 255, 255))
+ # Author: Jarrod Oberto
+ # Date: 05-05-11
+ # Purpose: Add a border to the image
+ # Param in:
+ # Param out:
+ # Reference:
+ # Notes: This border is added to the INSIDE of the image
+ #
+ {
+ if ($this->imageResized) {
+
+ $rgbArray = $this->formatColor($rgbArray);
+ $r = $rgbArray['r'];
+ $g = $rgbArray['g'];
+ $b = $rgbArray['b'];
+
+
+ $x1 = 0;
+ $y1 = 0;
+ $x2 = ImageSX($this->imageResized) - 1;
+ $y2 = ImageSY($this->imageResized) - 1;
+
+ $rgbArray = ImageColorAllocate($this->imageResized, $r, $g, $b);
+
+
+ for($i = 0; $i < $thickness; $i++) {
+ ImageRectangle($this->imageResized, $x1++, $y1++, $x2--, $y2--, $rgbArray);
+ }
+ }
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Gray Scale
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function greyScale()
+ # Author: Jarrod Oberto
+ # Date: 07-05-2011
+ # Purpose: Make image greyscale
+ # Param in: n/a
+ # Param out:
+ # Reference:
+ # Notes:
+ #
+ {
+ if ($this->imageResized) {
+ imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE);
+ }
+
+ }
+
+ ## --------------------------------------------------------
+
+ public function greyScaleEnhanced()
+ # Author: Jarrod Oberto
+ # Date: 07-05-2011
+ # Purpose: Make image greyscale
+ # Param in: n/a
+ # Param out:
+ # Reference:
+ # Notes:
+ #
+ {
+ if ($this->imageResized) {
+ imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE);
+ imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -15);
+ imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, 2);
+ $this->sharpen($this->width);
+ }
+ }
+
+ ## --------------------------------------------------------
+
+ public function greyScaleDramatic()
+ # Alias of gd_filter_monopin
+ {
+ $this->gd_filter_monopin();
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Black 'n White
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function blackAndWhite()
+ # Author: Jarrod Oberto
+ # Date: 07-05-2011
+ # Purpose: Make image black and white
+ # Param in: n/a
+ # Param out:
+ # Reference:
+ # Notes:
+ #
+ {
+ if ($this->imageResized) {
+
+ imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE);
+ imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -1000);
+ }
+
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Negative
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function negative()
+ # Author: Jarrod Oberto
+ # Date: 07-05-2011
+ # Purpose: Make image negative
+ # Param in: n/a
+ # Param out:
+ # Reference:
+ # Notes:
+ #
+ {
+ if ($this->imageResized) {
+
+ imagefilter($this->imageResized, IMG_FILTER_NEGATE);
+ }
+
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Sepia
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function sepia()
+ # Author: Jarrod Oberto
+ # Date: 07-05-2011
+ # Purpose: Make image sepia
+ # Param in: n/a
+ # Param out:
+ # Reference:
+ # Notes:
+ #
+ {
+ if ($this->imageResized) {
+ imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE);
+ imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, -10);
+ imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -20);
+ imagefilter($this->imageResized, IMG_FILTER_COLORIZE, 60, 30, -15);
+ }
+ }
+
+ ## --------------------------------------------------------
+
+ public function sepia2()
+
+ {
+ if ($this->imageResized) {
+
+ $total = imagecolorstotal( $this->imageResized );
+ for ( $i = 0; $i < $total; $i++ ) {
+ $index = imagecolorsforindex( $this->imageResized, $i );
+ $red = ( $index["red"] * 0.393 + $index["green"] * 0.769 + $index["blue"] * 0.189 ) / 1.351;
+ $green = ( $index["red"] * 0.349 + $index["green"] * 0.686 + $index["blue"] * 0.168 ) / 1.203;
+ $blue = ( $index["red"] * 0.272 + $index["green"] * 0.534 + $index["blue"] * 0.131 ) / 2.140;
+ imagecolorset( $this->imageResized, $i, $red, $green, $blue );
+ }
+
+
+ }
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Vintage
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function vintage()
+ # Alias of gd_filter_monopin
+ {
+ $this->gd_filter_vintage();
+ }
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Presets By Marc Hibbins
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+
+ /** Apply 'Monopin' preset */
+ public function gd_filter_monopin()
+ {
+
+ if ($this->imageResized) {
+ imagefilter($this->imageResized, IMG_FILTER_GRAYSCALE);
+ imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, -15);
+ imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -15);
+ $this->imageResized = $this->gd_apply_overlay($this->imageResized, 'vignette', 100);
+ }
+ }
+
+ ## --------------------------------------------------------
+
+ public function gd_filter_vintage()
+ {
+ if ($this->imageResized) {
+ $this->imageResized = $this->gd_apply_overlay($this->imageResized, 'vignette', 45);
+ imagefilter($this->imageResized, IMG_FILTER_BRIGHTNESS, 20);
+ imagefilter($this->imageResized, IMG_FILTER_CONTRAST, -35);
+ imagefilter($this->imageResized, IMG_FILTER_COLORIZE, 60, -10, 35);
+ imagefilter($this->imageResized, IMG_FILTER_SMOOTH, 7);
+ $this->imageResized = $this->gd_apply_overlay($this->imageResized, 'scratch', 10);
+ }
+ }
+
+ ## --------------------------------------------------------
+
+ /** Apply a PNG overlay */
+ private function gd_apply_overlay($im, $type, $amount)
+ #
+ # Original Author: Marc Hibbins
+ # License: Attribution-ShareAlike 3.0
+ # Purpose:
+ # Params in:
+ # Params out:
+ # Notes:
+ #
+ {
+ $width = imagesx($im);
+ $height = imagesy($im);
+ $filter = imagecreatetruecolor($width, $height);
+
+ imagealphablending($filter, false);
+ imagesavealpha($filter, true);
+
+ $transparent = imagecolorallocatealpha($filter, 255, 255, 255, 127);
+ imagefilledrectangle($filter, 0, 0, $width, $height, $transparent);
+
+ // *** Resize overlay
+ $overlay = $this->filterOverlayPath . '/' . $type . '.png';
+ $png = imagecreatefrompng($overlay);
+ imagecopyresampled($filter, $png, 0, 0, 0, 0, $width, $height, imagesx($png), imagesy($png));
+
+ $comp = imagecreatetruecolor($width, $height);
+ imagecopy($comp, $im, 0, 0, 0, 0, $width, $height);
+ imagecopy($comp, $filter, 0, 0, 0, 0, $width, $height);
+ imagecopymerge($im, $comp, 0, 0, 0, 0, $width, $height, $amount);
+
+ imagedestroy($comp);
+ return $im;
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Colorise
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function image_colorize($rgb) {
+ imageTrueColorToPalette($this->imageResized,true,256);
+ $numColors = imageColorsTotal($this->imageResized);
+
+ for ($x = 0; $x < $numColors; $x++) {
+ list($r,$g,$b) = array_values(imageColorsForIndex($this->imageResized,$x));
+
+ // calculate grayscale in percent
+ $grayscale = ($r + $g + $b) / 3 / 0xff;
+
+ imageColorSet($this->imageResized,$x,
+ $grayscale * $rgb[0],
+ $grayscale * $rgb[1],
+ $grayscale * $rgb[2]
+ );
+
+ }
+
+ return true;
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Reflection
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function addReflection($reflectionHeight = 50, $startingTransparency = 30, $inside = false, $bgColor = '#fff', $stretch=false, $divider = 0)
+ {
+
+ // *** Convert color
+ $rgbArray = $this->formatColor($bgColor);
+ $r = $rgbArray['r'];
+ $g = $rgbArray['g'];
+ $b = $rgbArray['b'];
+
+ $im = $this->imageResized;
+ $li = imagecreatetruecolor($this->width, 1);
+
+ $bgc = imagecolorallocate($li, $r, $g, $b);
+ imagefilledrectangle($li, 0, 0, $this->width, 1, $bgc);
+
+ $bg = imagecreatetruecolor($this->width, $reflectionHeight);
+ $wh = imagecolorallocate($im, 255, 255, 255);
+
+ $im = imagerotate($im, -180, $wh);
+ imagecopyresampled($bg, $im, 0, 0, 0, 0, $this->width, $this->height, $this->width, $this->height);
+
+ $im = $bg;
+
+ $bg = imagecreatetruecolor($this->width, $reflectionHeight);
+
+ for ($x = 0; $x < $this->width; $x++) {
+ imagecopy($bg, $im, $x, 0, $this->width-$x -1, 0, 1, $reflectionHeight);
+ }
+ $im = $bg;
+
+ $transaprencyAmount = $this->invertTransparency($startingTransparency, 100);
+
+
+ // *** Fade
+ if ($stretch) {
+ $step = 100/($reflectionHeight + $startingTransparency);
+ } else{
+ $step = 100/$reflectionHeight;
+ }
+ for($i=0; $i<=$reflectionHeight; $i++){
+
+ if($startingTransparency>100) $startingTransparency = 100;
+ if($startingTransparency< 1) $startingTransparency = 1;
+ imagecopymerge($bg, $li, 0, $i, 0, 0, $this->width, 1, $startingTransparency);
+ $startingTransparency+=$step;
+ }
+
+ // *** Apply fade
+ imagecopymerge($im, $li, 0, 0, 0, 0, $this->width, $divider, 100); // Divider
+
+
+ // *** width, height of reflection.
+ $x = imagesx($im);
+ $y = imagesy($im);
+
+
+ // *** Determines if the reflection should be displayed inside or outside the image
+ if ($inside) {
+
+ // Create new blank image with sizes.
+ $final = imagecreatetruecolor($this->width, $this->height);
+
+ imagecopymerge ($final, $this->imageResized, 0, 0, 0, $reflectionHeight, $this->width, $this->height - $reflectionHeight, 100);
+ imagecopymerge ($final, $im, 0, $this->height - $reflectionHeight, 0, 0, $x, $y, 100);
+
+ } else {
+
+ // Create new blank image with sizes.
+ $final = imagecreatetruecolor($this->width, $this->height + $y);
+
+ imagecopymerge ($final, $this->imageResized, 0, 0, 0, 0, $this->width, $this->height, 100);
+ imagecopymerge ($final, $im, 0, $this->height, 0, 0, $x, $y, 100);
+ }
+
+ $this->imageResized = $final;
+
+ imagedestroy($li);
+ imagedestroy($im);
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Rotate
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function rotate($value = 90, $bgColor = 'transparent')
+ # Author: Jarrod Oberto
+ # Date: 07-05-2011
+ # Purpose: Rotate image
+ # Param in: (mixed) $degrees: (int) number of degress to rotate image
+ # (str) param "left": rotate left
+ # (str) param "right": rotate right
+ # (str) param "upside": upside-down image
+ # Param out:
+ # Reference:
+ # Notes: The default direction of imageRotate() is counter clockwise.
+ #
+ {
+ if ($this->imageResized) {
+
+ if (is_integer($value)) {
+ $degrees = $value;
+ }
+
+ // *** Convert color
+ $rgbArray = $this->formatColor($bgColor);
+ $r = $rgbArray['r'];
+ $g = $rgbArray['g'];
+ $b = $rgbArray['b'];
+ if (isset($rgbArray['a'])) {$a = $rgbArray['a']; }
+
+ if (is_string($value)) {
+
+ $value = mb_strtolower($value);
+
+ switch ($value) {
+ case 'left':
+ $degrees = 90;
+ break;
+ case 'right':
+ $degrees = 270;
+ break;
+ case 'upside':
+ $degrees = 180;
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ // *** The default direction of imageRotate() is counter clockwise
+ // * This makes it clockwise
+ $degrees = 360 - $degrees;
+
+ // *** Create background color
+ $bg = ImageColorAllocateAlpha($this->imageResized, $r, $g, $b, $a);
+
+ // *** Fill with background
+ ImageFill($this->imageResized, 0, 0 , $bg);
+
+ // *** Rotate
+ $this->imageResized = imagerotate($this->imageResized, $degrees, $bg); // Rotate 45 degrees and allocated the transparent colour as the one to make transparent (obviously)
+
+ // Ensure alpha transparency
+ ImageSaveAlpha($this->imageResized,true);
+
+ }
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Round corners
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function roundCorners($radius = 5, $bgColor = 'transparent')
+ # Author: Jarrod Oberto
+ # Date: 19-05-2011
+ # Purpose: Create rounded corners on your image
+ # Param in: (int) radius = the amount of curvature
+ # (mixed) $bgColor = the corner background color
+ # Param out: n/a
+ # Reference:
+ # Notes:
+ #
+ {
+
+ // *** Check if the user wants transparency
+ $isTransparent = false;
+ if (!is_array($bgColor)) {
+ if (mb_strtolower($bgColor) == 'transparent') {
+ $isTransparent = true;
+ }
+ }
+
+
+ // *** If we use transparency, we need to color our curved mask with a unique color
+ if ($isTransparent) {
+ $bgColor = $this->findUnusedGreen();
+ }
+
+ // *** Convert color
+ $rgbArray = $this->formatColor($bgColor);
+ $r = $rgbArray['r'];
+ $g = $rgbArray['g'];
+ $b = $rgbArray['b'];
+ if (isset($rgbArray['a'])) {$a = $rgbArray['a']; }
+
+
+
+ // *** Create top-left corner mask (square)
+ $cornerImg = imagecreatetruecolor($radius, $radius);
+ //$cornerImg = imagecreate($radius, $radius);
+
+ //imagealphablending($cornerImg, true);
+ //imagesavealpha($cornerImg, true);
+
+ //imagealphablending($this->imageResized, false);
+ //imagesavealpha($this->imageResized, true);
+
+ // *** Give it a color
+ $maskColor = imagecolorallocate($cornerImg, 0, 0, 0);
+
+
+
+ // *** Replace the mask color (black) to transparent
+ imagecolortransparent($cornerImg, $maskColor);
+
+
+
+ // *** Create the image background color
+ $imagebgColor = imagecolorallocate($cornerImg, $r, $g, $b);
+
+
+
+ // *** Fill the corner area to the user defined color
+ imagefill($cornerImg, 0, 0, $imagebgColor);
+
+
+ imagefilledellipse($cornerImg, $radius, $radius, $radius * 2, $radius * 2, $maskColor );
+
+
+ // *** Map to top left corner
+ imagecopymerge($this->imageResized, $cornerImg, 0, 0, 0, 0, $radius, $radius, 100); #tl
+
+ // *** Map rounded corner to other corners by rotating and applying the mask
+ $cornerImg = imagerotate($cornerImg, 90, 0);
+ imagecopymerge($this->imageResized, $cornerImg, 0, $this->height - $radius, 0, 0, $radius, $radius, 100); #bl
+
+ $cornerImg = imagerotate($cornerImg, 90, 0);
+ imagecopymerge($this->imageResized, $cornerImg, $this->width - $radius, $this->height - $radius, 0, 0, $radius, $radius, 100); #br
+
+ $cornerImg = imagerotate($cornerImg, 90, 0);
+ imagecopymerge($this->imageResized, $cornerImg, $this->width - $radius, 0, 0, 0, $radius, $radius, 100); #tr
+
+
+ // *** If corners are to be transparent, we fill our chromakey color as transparent.
+ if ($isTransparent) {
+ //imagecolortransparent($this->imageResized, $imagebgColor);
+ $this->imageResized = $this->transparentImage($this->imageResized);
+ imagesavealpha($this->imageResized, true);
+ }
+
+ }
+
+
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
+ Shadow
+*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
+
+ public function addShadow($shadowAngle=45, $blur=15, $bgColor='transparent')
+ #
+ # Author: Jarrod Oberto (Adapted from Pascal Naidon)
+ # Ref: http://www.les-stooges.org/pascal/webdesign/vignettes/index.php?la=en
+ # Purpose: Add a drop shadow to your image
+ # Params in: (int) $angle: the angle of the shadow
+ # (int) $blur: the blur distance
+ # (mixed) $bgColor: the color of the background
+ # Params out:
+ # Notes:
+ #
+ {
+ // *** A higher number results in a smoother shadow
+ define('STEPS', $blur*2);
+
+ // *** Set the shadow distance
+ $shadowDistance = $blur*0.25;
+
+ // *** Set blur width and height
+ $blurWidth = $blurHeight = $blur;
+
+
+ if ($shadowAngle == 0) {
+ $distWidth = 0;
+ $distHeight = 0;
+ } else {
+ $distWidth = $shadowDistance * cos(deg2rad($shadowAngle));
+ $distHeight = $shadowDistance * sin(deg2rad($shadowAngle));
+ }
+
+
+ // *** Convert color
+ if (mb_strtolower($bgColor) != 'transparent') {
+ $rgbArray = $this->formatColor($bgColor);
+ $r0 = $rgbArray['r'];
+ $g0 = $rgbArray['g'];
+ $b0 = $rgbArray['b'];
+ }
+
+
+ $image = $this->imageResized;
+ $width = $this->width;
+ $height = $this->height;
+
+
+ $newImage = imagecreatetruecolor($width, $height);
+ imagecopyresampled($newImage, $image, 0, 0, 0, 0, $width, $height, $width, $height);
+
+
+ // *** RGB
+ $rgb = imagecreatetruecolor($width+$blurWidth,$height+$blurHeight);
+ $colour = imagecolorallocate($rgb, 0, 0, 0);
+ imagefilledrectangle($rgb, 0, 0, $width+$blurWidth, $height+$blurHeight, $colour);
+ $colour = imagecolorallocate($rgb, 255, 255, 255);
+ //imagefilledrectangle($rgb, $blurWidth*0.5-$distWidth, $blurHeight*0.5-$distHeight, $width+$blurWidth*0.5-$distWidth, $height+$blurWidth*0.5-$distHeight, $colour);
+ imagefilledrectangle($rgb, $blurWidth*0.5-$distWidth, $blurHeight*0.5-$distHeight, $width+$blurWidth*0.5-$distWidth, $height+$blurWidth*0.5-$distHeight, $colour);
+ //imagecopymerge($rgb, $newImage, 1+$blurWidth*0.5-$distWidth, 1+$blurHeight*0.5-$distHeight, 0,0, $width, $height, 100);
+ imagecopymerge($rgb, $newImage, $blurWidth*0.5-$distWidth, $blurHeight*0.5-$distHeight, 0,0, $width+$blurWidth, $height+$blurHeight, 100);
+
+
+ // *** Shadow (alpha)
+ $shadow = imagecreatetruecolor($width+$blurWidth,$height+$blurHeight);
+ imagealphablending($shadow, false);
+ $colour = imagecolorallocate($shadow, 0, 0, 0);
+ imagefilledrectangle($shadow, 0, 0, $width+$blurWidth, $height+$blurHeight, $colour);
+
+
+ for($i=0;$i<=STEPS;$i++) {
+
+ $t = ((1.0*$i)/STEPS);
+ $intensity = 255*$t*$t;
+
+ $colour = imagecolorallocate($shadow, $intensity, $intensity, $intensity);
+ $points = array(
+ $blurWidth*$t, $blurHeight, // Point 1 (x, y)
+ $blurWidth, $blurHeight*$t, // Point 2 (x, y)
+ $width, $blurHeight*$t, // Point 3 (x, y)
+ $width+$blurWidth*(1-$t), $blurHeight, // Point 4 (x, y)
+ $width+$blurWidth*(1-$t), $height, // Point 5 (x, y)
+ $width, $height+$blurHeight*(1-$t), // Point 6 (x, y)
+ $blurWidth, $height+$blurHeight*(1-$t), // Point 7 (x, y)
+ $blurWidth*$t, $height // Point 8 (x, y)
+ );
+ imagepolygon($shadow, $points, 8, $colour);
+ }
+
+ for($i=0;$i<=STEPS;$i++) {
+
+ $t = ((1.0*$i)/STEPS);
+ $intensity = 255*$t*$t;
+
+ $colour = imagecolorallocate($shadow, $intensity, $intensity, $intensity);
+ imagefilledarc($shadow, $blurWidth-1, $blurHeight-1, 2*(1-$t)*$blurWidth, 2*(1-$t)*$blurHeight, 180, 268, $colour, IMG_ARC_PIE);
+ imagefilledarc($shadow, $width, $blurHeight-1, 2*(1-$t)*$blurWidth, 2*(1-$t)*$blurHeight, 270, 358, $colour, IMG_ARC_PIE);
+ imagefilledarc($shadow, $width, $height, 2*(1-$t)*$blurWidth, 2*(1-$t)*$blurHeight, 0, 90, $colour, IMG_ARC_PIE);
+ imagefilledarc($shadow, $blurWidth-1, $height, 2*(1-$t)*$blurWidth, 2*(1-$t)*$blurHeight, 90, 180, $colour, IMG_ARC_PIE);
+ }
+
+
+ $colour = imagecolorallocate($shadow, 255, 255, 255);
+ imagefilledrectangle($shadow, $blurWidth, $blurHeight, $width, $height, $colour);
+ imagefilledrectangle($shadow, $blurWidth*0.5-$distWidth, $blurHeight*0.5-$distHeight, $width+$blurWidth*0.5-1-$distWidth, $height+$blurHeight*0.5-1-$distHeight, $colour);
+
+
+ // *** The magic
+ imagealphablending($rgb, false);
+
+ for ($theX=0;$theX
jPlayer events that have occurred over the past 1 second:'
+ + '
(Backgrounds: Never occurred Occurred before Occurred Multiple occurrences reset)
Update jPlayer Inspector
' + + '' + + 'This jPlayer instance is running in your browser where:
"
+
+ for(i = 0; i < $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions.length; i++) {
+ var solution = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions[i];
+ jPlayerInfo += " jPlayer's " + solution + " solution is";
+ if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].used) {
+ jPlayerInfo += " being used and will support:";
+ for(format in $(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support) {
+ if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support[format]) {
+ jPlayerInfo += " " + format;
+ }
+ }
+ jPlayerInfo += "
";
+ } else {
+ jPlayerInfo += " not required
";
+ }
+ }
+ jPlayerInfo += "
status.formatType = '" + formatType + "'
";
+ if(formatType) {
+ jPlayerInfo += "Browser canPlay('" + $.jPlayer.prototype.format[formatType].codec + "')";
+ } else {
+ jPlayerInfo += "
status.src = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src + "'
status.media = {
";
+ for(prop in $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media) {
+ jPlayerInfo += " " + prop + ": " + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media[prop] + "
"; // Some are strings
+ }
+ jPlayerInfo += "};
";
+ jPlayerInfo += "status.videoWidth = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoWidth + "'";
+ jPlayerInfo += " | status.videoHeight = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.videoHeight + "'";
+ jPlayerInfo += "status.width = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.width + "'";
+ jPlayerInfo += " | status.height = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.height + "'";
+ jPlayerInfo += "
Raw browser test for HTML5 support. Should equal a function if HTML5 is available.
";
+ if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available) {
+ jPlayerInfo += "htmlElement.audio.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType) +"
"
+ }
+ if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.video.available) {
+ jPlayerInfo += "htmlElement.video.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.video.canPlayType) +"";
+ }
+ jPlayerInfo += "
This instance is using the constructor options:
"
+ + "$('#" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").internal.self.id + "').jPlayer({
"
+
+ + " swfPath: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "swfPath") + "',
"
+
+ + " solution: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "solution") + "',
"
+
+ + " supplied: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "supplied") + "',
"
+
+ + " preload: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "preload") + "',
"
+
+ + " volume: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "volume") + ",
"
+
+ + " muted: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "muted") + ",
"
+
+ + " backgroundColor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "backgroundColor") + "',
"
+
+ + " cssSelectorAncestor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelectorAncestor") + "',
"
+
+ + " cssSelector: {";
+
+ var cssSelector = $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector");
+ for(prop in cssSelector) {
+
+ // jPlayerInfo += "
" + prop + ": '" + cssSelector[prop] + "'," // This works too of course, but want to use option method for deep keys.
+ jPlayerInfo += "
" + prop + ": '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector." + prop) + "',"
+ }
+
+ jPlayerInfo = jPlayerInfo.slice(0, -1); // Because the sloppy comma was bugging me.
+
+ jPlayerInfo += "
},
"
+
+ + " errorAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "errorAlerts") + ",
"
+
+ + " warningAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "warningAlerts") + "
"
+
+ + "});
jPlayer is " + + ($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.paused ? "paused" : "playing") + + " at time: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentTime*10)/10 + "s." + + " (d: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.duration*10)/10 + "s" + + ", sp: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.seekPercent) + "%" + + ", cpr: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentRelative) + "%" + + ", cpa: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentAbsolute) + "%)
" + ); + return this; + } + }; + $.fn.jPlayerInspector = function( method ) { + // Method calling logic + if ( methods[method] ) { + return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object' || ! method ) { + return methods.init.apply( this, arguments ); + } else { + $.error( 'Method ' + method + ' does not exist on jQuery.jPlayerInspector' ); + } + }; +})(jQuery); diff --git a/web/tinymce/plugins/filemanager/jPlayer/jquery.jplayer.min.js b/web/tinymce/plugins/filemanager/jPlayer/jquery.jplayer.min.js new file mode 100755 index 000000000..ecd3ab514 --- /dev/null +++ b/web/tinymce/plugins/filemanager/jPlayer/jquery.jplayer.min.js @@ -0,0 +1,107 @@ +/* + * jPlayer Plugin for jQuery JavaScript Library + * http://www.jplayer.org + * + * Copyright (c) 2009 - 2013 Happyworm Ltd + * Licensed under the MIT license. + * http://opensource.org/licenses/MIT + * + * Author: Mark J Panaghiston + * Version: 2.4.0 + * Date: 5th June 2013 + */ + +(function(b,f){"function"===typeof define&&define.amd?define(["jquery"],f):b.jQuery?f(b.jQuery):f(b.Zepto)})(this,function(b,f){b.fn.jPlayer=function(a){var c="string"===typeof a,d=Array.prototype.slice.call(arguments,1),e=this;a=!c&&d.length?b.extend.apply(null,[!0,a].concat(d)):a;if(c&&"_"===a.charAt(0))return e;c?this.each(function(){var c=b(this).data("jPlayer"),h=c&&b.isFunction(c[a])?c[a].apply(c,d):c;if(h!==c&&h!==f)return e=h,!1}):this.each(function(){var c=b(this).data("jPlayer");c?c.option(a|| +{}):b(this).data("jPlayer",new b.jPlayer(a,this))});return e};b.jPlayer=function(a,c){if(arguments.length){this.element=b(c);this.options=b.extend(!0,{},this.options,a);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()});this._init()}};"function"!==typeof b.fn.stop&&(b.fn.stop=function(){});b.jPlayer.emulateMethods="load play pause";b.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";b.jPlayer.emulateOptions="muted volume";b.jPlayer.reservedEvent= +"ready flashreset resize repeat error warning";b.jPlayer.event={};b.each("ready flashreset resize repeat click error warning loadstart progress suspend abort emptied stalled play pause loadedmetadata loadeddata waiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange".split(" "),function(){b.jPlayer.event[this]="jPlayer_"+this});b.jPlayer.htmlEvent="loadstart abort emptied stalled loadedmetadata loadeddata canplay canplaythrough ratechange".split(" "); +b.jPlayer.pause=function(){b.each(b.jPlayer.prototype.instances,function(a,c){c.data("jPlayer").status.srcSet&&c.jPlayer("pause")})};b.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};var l=function(){this.init()};l.prototype={init:function(){this.options={timeFormat:b.jPlayer.timeFormat}},time:function(a){var c=new Date(1E3*(a&&"number"===typeof a?a:0)),b=c.getUTCHours();a=this.options.timeFormat.showHour?c.getUTCMinutes():c.getUTCMinutes()+ +60*b;c=this.options.timeFormat.showMin?c.getUTCSeconds():c.getUTCSeconds()+60*a;b=this.options.timeFormat.padHour&&10>b?"0"+b:b;a=this.options.timeFormat.padMin&&10>a?"0"+a:a;c=this.options.timeFormat.padSec&&10>c?"0"+c:c;b=""+(this.options.timeFormat.showHour?b+this.options.timeFormat.sepHour:"");b+=this.options.timeFormat.showMin?a+this.options.timeFormat.sepMin:"";return b+=this.options.timeFormat.showSec?c+this.options.timeFormat.sepSec:""}};var m=new l;b.jPlayer.convertTime=function(a){return m.time(a)}; +b.jPlayer.uaBrowser=function(a){a=a.toLowerCase();var b=/(opera)(?:.*version)?[ \/]([\w.]+)/,d=/(msie) ([\w.]+)/,e=/(mozilla)(?:.*? rv:([\w.]+))?/;a=/(webkit)[ \/]([\w.]+)/.exec(a)||b.exec(a)||d.exec(a)||0>a.indexOf("compatible")&&e.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}};b.jPlayer.uaPlatform=function(a){var b=a.toLowerCase(),d=/(android)/,e=/(mobile)/;a=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(b)||[];b=/(ipad|playbook)/.exec(b)||!e.exec(b)&&d.exec(b)|| +[];a[1]&&(a[1]=a[1].replace(/\s/g,"_"));return{platform:a[1]||"",tablet:b[1]||""}};b.jPlayer.browser={};b.jPlayer.platform={};var j=b.jPlayer.uaBrowser(navigator.userAgent);j.browser&&(b.jPlayer.browser[j.browser]=!0,b.jPlayer.browser.version=j.version);j=b.jPlayer.uaPlatform(navigator.userAgent);j.platform&&(b.jPlayer.platform[j.platform]=!0,b.jPlayer.platform.mobile=!j.tablet,b.jPlayer.platform.tablet=!!j.tablet);b.jPlayer.getDocMode=function(){var a;b.jPlayer.browser.msie&&(document.documentMode? +a=document.documentMode:(a=5,document.compatMode&&"CSS1Compat"===document.compatMode&&(a=7)));return a};b.jPlayer.browser.documentMode=b.jPlayer.getDocMode();b.jPlayer.nativeFeatures={init:function(){var a=document,b=a.createElement("video"),d={w3c:"fullscreenEnabled fullscreenElement requestFullscreen exitFullscreen fullscreenchange fullscreenerror".split(" "),moz:"mozFullScreenEnabled mozFullScreenElement mozRequestFullScreen mozCancelFullScreen mozfullscreenchange mozfullscreenerror".split(" "), +webkit:" webkitCurrentFullScreenElement webkitRequestFullScreen webkitCancelFullScreen webkitfullscreenchange ".split(" "),webkitVideo:"webkitSupportsFullscreen webkitDisplayingFullscreen webkitEnterFullscreen webkitExitFullscreen ".split(" ")},e=["w3c","moz","webkit","webkitVideo"],g,h;this.fullscreen=b={support:{w3c:!!a[d.w3c[0]],moz:!!a[d.moz[0]],webkit:"function"===typeof a[d.webkit[3]],webkitVideo:"function"===typeof b[d.webkitVideo[2]]},used:{}};g=0;for(h=e.length;g"+this.options.dictFallbackText+"
"),d+='
RESPONSIVE filemanager v.'+version+'
responsivefilemanager.com
Copyright © Tecrail - Alberto Peripolli. All rights reserved.
License
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.

RESPONSIVE filemanager v.'+version+'
responsivefilemanager.com
Copyright © Tecrail - Alberto Peripolli. All rights reserved.
License
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.