Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fix on media module #7

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 116 additions & 114 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,262 +12,264 @@
*
* @author Zongshu Lin <[email protected]>
*/
return array(
'category' => array(
array(
return [
'category' => [
[
'name' => 'general',
'title' => _t('General'),
),
array(
],
[
'name' => 'form',
'title' => _t('Form'),
),
array(
],
[
'name' => 'validator',
'title' => _t('Validator'),
),
array(
],
[
'name' => 'image',
'title' => _t('Image'),
),
),
],
],

'item' => array(
'item' => [
// General
'page_limit' => array(
'page_limit' => [
'category' => 'general',
'title' => _t('List page limit'),
'description' => _t('Maximum count of media resources on a list page.'),
'value' => 20,
'filter' => 'int',
),
'license_values' => array(
],
'license_values' => [
'category' => 'general',
'title' => _t('License values'),
'description' => _t('Use `|` as delimiter to separate license terms'),
'edit' => 'text',
'value' => '',
),
],
// Form
'form_description' => array(
'form_description' => [
'category' => 'form',
'title' => _t('Show description on form'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
),
'form_season' => array(
'value' => 1,
],
'form_season' => [
'category' => 'form',
'title' => _t('Show season on form'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
),
'form_license_type' => array(
'value' => 1,
],
'form_license_type' => [
'category' => 'form',
'title' => _t('Show license on form'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
),
'form_copyright' => array(
'value' => 1,
],
'form_copyright' => [
'category' => 'form',
'title' => _t('Show copyright on form'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
),
'value' => 1,
],
// Media
'extension' => array(
'extension' => [
'category' => 'validator',
'title' => _t('File extension'),
'description' => _t('Extensions for files allowed to upload.'),
'value' => 'jpg,jpeg,png,gif', //'pdf,rar,zip,doc,txt,docx,xls,xlsx,ppt,pptx,jpg,jpeg,png,gif',
),
'max_size' => array(
],
'max_size' => [
'category' => 'validator',
'title' => _t('Max file size'),
'description' => _t('Maximum size for files allowed to upload (in KB). Caution : on front side, max file size messages are displayed in octets (ko). Here you set in bytes (Kb) ! For 4Mo, you have to set 4 * 1024 = 4096 kb. Also, front limit is rounded to lower Mb integer after conversion, so 4096 Kb == 4Mo and 4095 kb == 3Mo'),
'description' => _t(
'Maximum size for files allowed to upload (in KB). Caution : on front side, max file size messages are displayed in octets (ko). Here you set in bytes (Kb) ! For 4Mo, you have to set 4 * 1024 = 4096 kb. Also, front limit is rounded to lower Mb integer after conversion, so 4096 Kb == 4Mo and 4095 kb == 3Mo'
),
'value' => 2048,
'filter' => 'int',
),
],
// Image
'image_maxw' => array(
'image_maxw' => [
'category' => 'image',
'title' => _t('Max Image width (upload)'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 2000
),
'image_maxh' => array(
'value' => 2000,
],
'image_maxh' => [
'category' => 'image',
'title' => _t('Max Image height (upload)'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 2000
),
'image_minw' => array(
'value' => 2000,
],
'image_minw' => [
'category' => 'image',
'title' => _t('Min Image width (upload)'),
'description' => 'This config can be overriden by custom module values',
'edit' => 'text',
'filter' => 'number_int',
'value' => 600
),
'image_minh' => array(
'value' => 600,
],
'image_minh' => [
'category' => 'image',
'title' => _t('Min Image height (upload)'),
'description' => 'This config can be overriden by custom module values',
'edit' => 'text',
'filter' => 'number_int',
'value' => 600
),
'image_quality' => array(
'value' => 600,
],
'image_quality' => [
'category' => 'image',
'title' => _t('Image quality'),
'description' => _t('Between 0 to 100 and support both of JPG and PNG, default is 75. Can be overridden by custom module config'),
'edit' => 'text',
'filter' => 'number_int',
'value' => 90
),
'image_ratio_w' => array(
'value' => 90,
],
'image_ratio_w' => [
'category' => 'image',
'title' => _t('Image ratio width'),
'description' => _t('Example : "3" for 3/2 ratio'),
'edit' => 'text',
'filter' => 'number_int',
'value' => 3
),
'image_ratio_h' => array(
'value' => 3,
],
'image_ratio_h' => [
'category' => 'image',
'title' => _t('Image ratio height'),
'description' => _t('Example : "2" for 3/2 ratio'),
'edit' => 'text',
'filter' => 'number_int',
'value' => 2
),
'image_watermark' => array(
'value' => 2,
],
'image_watermark' => [
'category' => 'image',
'title' => _t('Add Watermark'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 0
),
'image_watermark_source' => array(
'value' => 0,
],
'image_watermark_source' => [
'category' => 'image',
'title' => _t('Watermark Image'),
'description' => '',
'edit' => 'text',
'filter' => 'string',
'value' => ''
),
'image_watermark_position' => array(
'value' => '',
],
'image_watermark_position' => [
'title' => _t('Watermark Position'),
'description' => '',
'filter' => 'text',
'value' => 'bottom-right',
'category' => 'image',
'edit' => array(
'type' => 'select',
'options' => array(
'options' => array(
'edit' => [
'type' => 'select',
'options' => [
'options' => [
'top-left' => _t('Top Left'),
'top-right' => _t('Top Right'),
'bottom-left' => _t('Bottom Left'),
'bottom-right' => _t('Bottom Right'),
),
),
),
),
'image_default_copyright' => array(
'category' => 'image',
'title' => _t('Default copyright'),
'edit' => 'text',
'value' => '',
),
'freemium_max_gallery_images' => array(
'category' => 'image',
'title' => _t('Max gallery images for freemium related items'),
'edit' => 'text',
'filter' => 'number_int',
'value' => 2
),
'freemium_alert_msg' => array(
'category' => 'image',
'title' => _t('Alert message for freemium item'),
'edit' => 'text',
'value' => _t("Freemium item limitations... You can't do this action"),
),
'image_largew' => array(
],
],
],
],
'image_default_copyright' => [
'category' => 'image',
'title' => _t('Default copyright'),
'edit' => 'text',
'value' => '',
],
'freemium_max_gallery_images' => [
'category' => 'image',
'title' => _t('Max gallery images for freemium related items'),
'edit' => 'text',
'filter' => 'number_int',
'value' => 2,
],
'freemium_alert_msg' => [
'category' => 'image',
'title' => _t('Alert message for freemium item'),
'edit' => 'text',
'value' => _t("Freemium item limitations... You can't do this action"),
],
'image_largew' => [
'category' => 'image',
'title' => _t('Large Image width'),
'description' => 'This config can be overriden by custom module values. Used for min crop size.',
'edit' => 'text',
'filter' => 'number_int',
'value' => 1200
),
'image_largeh' => array(
'value' => 1200,
],
'image_largeh' => [
'category' => 'image',
'title' => _t('Large Image height'),
'description' => 'This config can be overriden by custom module values. Used for min crop size.',
'edit' => 'text',
'filter' => 'number_int',
'value' => 1200
),
'image_itemw' => array(
'value' => 1200,
],
'image_itemw' => [
'category' => 'image',
'title' => _a('Item Image width'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 800
),
'image_itemh' => array(
'value' => 800,
],
'image_itemh' => [
'category' => 'image',
'title' => _a('Item Image height'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 800
),
'image_mediumw' => array(
'value' => 800,
],
'image_mediumw' => [
'category' => 'image',
'title' => _a('Medium Image width'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 500
),
'image_mediumh' => array(
'value' => 500,
],
'image_mediumh' => [
'category' => 'image',
'title' => _a('Medium Image height'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 500
),
'image_thumbw' => array(
'value' => 500,
],
'image_thumbw' => [
'category' => 'image',
'title' => _a('Thumb Image width'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 250
),
'image_thumbh' => array(
'value' => 250,
],
'image_thumbh' => [
'category' => 'image',
'title' => _a('Thumb Image height'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 250
),
),
);
'value' => 250,
],
],
];
Loading