Add option to simplify image filters
Default on (at least for the test), needs new language constants
This commit is contained in:
parent
7a9d867fd1
commit
94f1198fe3
@ -1959,47 +1959,61 @@ function serendipity_getimagesize($file, $ft_mime = '', $suf = '') {
|
|||||||
function serendipity_getImageFields() {
|
function serendipity_getImageFields() {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
$x = array(
|
if ($serendipity['simpleImageFilters'] !== false) {
|
||||||
'i.date' => array('desc' => SORT_ORDER_DATE,
|
$x = array(
|
||||||
'type' => 'date'
|
'i.date' => array('desc' => SORT_ORDER_DATE,
|
||||||
),
|
'type' => 'date'
|
||||||
|
),
|
||||||
|
|
||||||
'i.name' => array('desc' => SORT_ORDER_NAME
|
'i.extension' => array('desc' => SORT_ORDER_EXTENSION
|
||||||
),
|
),
|
||||||
|
|
||||||
'i.authorid' => array('desc' => AUTHOR,
|
);
|
||||||
'type' => 'authors'
|
|
||||||
),
|
|
||||||
|
|
||||||
'i.extension' => array('desc' => SORT_ORDER_EXTENSION
|
} else {
|
||||||
),
|
|
||||||
|
|
||||||
'i.size' => array('desc' => SORT_ORDER_SIZE,
|
$x = array(
|
||||||
'type' => 'intrange'
|
'i.date' => array('desc' => SORT_ORDER_DATE,
|
||||||
),
|
'type' => 'date'
|
||||||
|
),
|
||||||
|
|
||||||
'i.dimensions_width' => array('desc' => SORT_ORDER_WIDTH,
|
'i.name' => array('desc' => SORT_ORDER_NAME
|
||||||
'type' => 'intrange'
|
),
|
||||||
),
|
|
||||||
|
|
||||||
'i.dimensions_height' => array('desc' => SORT_ORDER_HEIGHT,
|
'i.authorid' => array('desc' => AUTHOR,
|
||||||
'type' => 'intrange'
|
'type' => 'authors'
|
||||||
)
|
),
|
||||||
);
|
|
||||||
|
|
||||||
$addProp = explode(';', $serendipity['mediaProperties']);
|
'i.extension' => array('desc' => SORT_ORDER_EXTENSION
|
||||||
foreach($addProp AS $prop) {
|
),
|
||||||
$parts = explode(':', $prop);
|
|
||||||
$name = $parts[0];
|
'i.size' => array('desc' => SORT_ORDER_SIZE,
|
||||||
$x['bp.' . $name] = array('desc' => (defined('MEDIA_PROPERTY_' . $name) ? constant('MEDIA_PROPERTY_' . $name) : htmlspecialchars($name)));
|
'type' => 'intrange'
|
||||||
if (preg_match('@date@i', $name)) {
|
),
|
||||||
$x['bp.' . $name]['type'] = 'date';
|
|
||||||
}
|
'i.dimensions_width' => array('desc' => SORT_ORDER_WIDTH,
|
||||||
if (preg_match('@length@i', $name)) {
|
'type' => 'intrange'
|
||||||
$x['bp.' . $name]['type'] = 'intrange';
|
),
|
||||||
}
|
|
||||||
if (preg_match('@dpi@i', $name)) {
|
'i.dimensions_height' => array('desc' => SORT_ORDER_HEIGHT,
|
||||||
$x['bp.' . $name]['type'] = 'int';
|
'type' => 'intrange'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$addProp = explode(';', $serendipity['mediaProperties']);
|
||||||
|
foreach($addProp AS $prop) {
|
||||||
|
$parts = explode(':', $prop);
|
||||||
|
$name = $parts[0];
|
||||||
|
$x['bp.' . $name] = array('desc' => (defined('MEDIA_PROPERTY_' . $name) ? constant('MEDIA_PROPERTY_' . $name) : htmlspecialchars($name)));
|
||||||
|
if (preg_match('@date@i', $name)) {
|
||||||
|
$x['bp.' . $name]['type'] = 'date';
|
||||||
|
}
|
||||||
|
if (preg_match('@length@i', $name)) {
|
||||||
|
$x['bp.' . $name]['type'] = 'intrange';
|
||||||
|
}
|
||||||
|
if (preg_match('@dpi@i', $name)) {
|
||||||
|
$x['bp.' . $name]['type'] = 'int';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,6 +630,12 @@
|
|||||||
'type' => 'textarea',
|
'type' => 'textarea',
|
||||||
'permission' => 'blogConfiguration',
|
'permission' => 'blogConfiguration',
|
||||||
'default' => ''),
|
'default' => ''),
|
||||||
|
array('var' => 'simpleImageFilters',
|
||||||
|
'title' => SIMPLE_IMAGE_FILTERS, // i18n
|
||||||
|
'description' => SIMPLE_IMAGE_FILTERS_DESC, // i18n
|
||||||
|
'type' => 'bool',
|
||||||
|
'permission' => 'blogConfiguration',
|
||||||
|
'default' => true),
|
||||||
));
|
));
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user