diff --git a/sql/mysql.sql b/sql/mysql.sql index be4c6d1..7c576f6 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -41,17 +41,19 @@ CREATE TABLE `{question}` ( ); CREATE TABLE `{project}` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `title` VARCHAR(255) NOT NULL DEFAULT '', - `slug` VARCHAR(255) NOT NULL DEFAULT '', - `text_description` TEXT, - `time_create` INT(10) UNSIGNED NOT NULL DEFAULT '0', - `time_update` INT(10) UNSIGNED NOT NULL DEFAULT '0', - `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - `seo_title` VARCHAR(255) NOT NULL DEFAULT '', - `seo_keywords` VARCHAR(255) NOT NULL DEFAULT '', - `seo_description` VARCHAR(255) NOT NULL DEFAULT '', - `manager` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `title` VARCHAR(255) NOT NULL DEFAULT '', + `slug` VARCHAR(255) NOT NULL DEFAULT '', + `text_description` TEXT, + `time_create` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `time_update` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + `seo_title` VARCHAR(255) NOT NULL DEFAULT '', + `seo_keywords` VARCHAR(255) NOT NULL DEFAULT '', + `seo_description` VARCHAR(255) NOT NULL DEFAULT '', + `manager` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `main_image` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `additional_images` TEXT, PRIMARY KEY (`id`), KEY `title` (`title`), KEY `status` (`status`), diff --git a/src/Form/AskFilter.php b/src/Form/AskFilter.php index 96c6f40..a07826e 100644 --- a/src/Form/AskFilter.php +++ b/src/Form/AskFilter.php @@ -45,6 +45,16 @@ public function __construct() ), ), )); + //main_image + $this->add(array( + 'name' => 'main_image', + 'required' => false, + )); + // additional_images + /* $this->add(array( + 'name' => 'additional_images', + 'required' => false, + )); */ // tag if (Pi::service('module')->isActive('tag')) { $this->add(array( diff --git a/src/Form/AskForm.php b/src/Form/AskForm.php index 2fec238..0291f39 100644 --- a/src/Form/AskForm.php +++ b/src/Form/AskForm.php @@ -59,6 +59,32 @@ public function init() 'description' => '', ) )); + // main_image + $this->add(array( + 'name' => 'main_image', + 'type' => 'Module\Media\Form\Element\Media', + 'options' => array( + 'label' => __('Main image'), + 'media_gallery' => false, + 'media_season' => false, + 'media_season_recommended' => false, + 'is_freemium' => true, + 'can_connect_lists' => false, + ), + )); + // additional_images + /* $this->add(array( + 'name' => 'additional_images', + 'type' => 'Module\Media\Form\Element\Media', + 'options' => array( + 'label' => __('Additional images'), + 'media_gallery' => true, + 'media_season' => false, + 'media_season_recommended' => false, + 'is_freemium' => true, + 'can_connect_lists' => false, + ), + )); */ // tag if (Pi::service('module')->isActive('tag')) { $this->add(array( diff --git a/src/Form/ProjectFilter.php b/src/Form/ProjectFilter.php index 3c766f9..8bb8356 100644 --- a/src/Form/ProjectFilter.php +++ b/src/Form/ProjectFilter.php @@ -61,6 +61,16 @@ public function __construct() ), ), )); + //main_image + $this->add(array( + 'name' => 'main_image', + 'required' => false, + )); + // additional_images + $this->add(array( + 'name' => 'additional_images', + 'required' => false, + )); // status $this->add(array( 'name' => 'status', diff --git a/src/Form/ProjectForm.php b/src/Form/ProjectForm.php index 9892d6a..8e0abfc 100644 --- a/src/Form/ProjectForm.php +++ b/src/Form/ProjectForm.php @@ -70,6 +70,32 @@ public function init() 'description' => '', ) )); + // main_image + $this->add(array( + 'name' => 'main_image', + 'type' => 'Module\Media\Form\Element\Media', + 'options' => array( + 'label' => __('Main image'), + 'media_gallery' => false, + 'media_season' => false, + 'media_season_recommended' => false, + 'is_freemium' => true, + 'can_connect_lists' => false, + ), + )); + // additional_images + $this->add(array( + 'name' => 'additional_images', + 'type' => 'Module\Media\Form\Element\Media', + 'options' => array( + 'label' => __('Additional images'), + 'media_gallery' => true, + 'media_season' => false, + 'media_season_recommended' => false, + 'is_freemium' => true, + 'can_connect_lists' => false, + ), + )); // status $this->add(array( 'name' => 'status', diff --git a/src/Model/Project.php b/src/Model/Project.php index 8e4d8d7..2ff16ac 100644 --- a/src/Model/Project.php +++ b/src/Model/Project.php @@ -32,5 +32,7 @@ class Project extends Model 'seo_keywords', 'seo_description', 'manager', + 'main_image', + 'additional_images', ); } diff --git a/template/front/question-list.phtml b/template/front/question-list.phtml index 206089b..1658b6f 100644 --- a/template/front/question-list.phtml +++ b/template/front/question-list.phtml @@ -16,6 +16,7 @@