1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

Fixes #817 - error in gallery admin, and also fixes missing gallery images on fresh install when not logged in.

This commit is contained in:
Cameron
2015-02-04 14:37:34 -08:00
parent 5e56b4731d
commit 4beb3086fb
3 changed files with 35 additions and 6 deletions

View File

@@ -1957,6 +1957,34 @@ class e107plugin
}
}
function getPerm($type, $default = 'member')
{
if(empty($type))
{
$type = $default;
}
$plug_perm = array();
$plug_perm['everyone'] = e_UC_PUBLIC;
$plug_perm['guest'] = e_UC_GUEST;
$plug_perm['member'] = e_UC_MEMBER;
$plug_perm['mainadmin'] = e_UC_MAINADMIN;
$plug_perm['admin'] = e_UC_ADMIN;
$plug_perm['nobody'] = e_UC_NOBODY;
if(isset($plug_perm[$type]))
{
return $plug_perm[$type];
}
return $plug_perm[$default];
}
// Only 1 category per file-type allowed. ie. 1 for images, 1 for files.
function XmlMediaCategories($function, $tag)
{
@@ -1995,7 +2023,7 @@ class e107plugin
$data['title'] = $v['@value'];
$data['sef'] = vartrue($v['@attributes']['sef']);
// $data['type'] = $v['@attributes']['type']; //TODO
$data['class'] = 253;
$data['class'] = $this->getPerm($v['@attributes']['perm'], 'member');
$status = e107::getMedia()->createCategory($data) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$mes->add("Adding Media Category: {$data['category']}", $status);

View File

@@ -158,7 +158,7 @@ class gallery_cat_admin_ui extends e_admin_ui
// 'slideshow_circular' => array('title'=> 'Slide circular-mode', 'type' => 'boolean', 'data' => 'integer', 'help'=>'By default when the first/last slide is reached, calling prev/next does nothing. If you want the effect to continue enable this option.'), //
'slideshow_effect' => array('title'=> 'Slide effect', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of effect. '), //
// 'slideshow_transition' => array('title'=> 'Slide transition', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of transition. ') //
'perpage' => array('title'=> 'Images per page', 'type' => 'number', 'data' => 'int', 'help'=>'Number of images to be shown per page', 'validate' => 'required'), // 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'perpage' => array('title'=> 'Images per page', 'type' => 'number', 'data' => 'int', 'help'=>'Number of images to be shown per page'), // 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
);
@@ -180,10 +180,11 @@ class gallery_cat_admin_ui extends e_admin_ui
$this->prefs['slideshow_effect']['writeParms'] = $effects;
$this->prefs['slideshow_effect']['readParms'] = $effects;
//
// $transitions = array('sinoidal'=>'sinoidal','spring'=>'spring');
$transitions = array('sinoidal'=>'sinoidal','spring'=>'spring');
$this->prefs['slideshow_transition']['writeParms'] = $transitions;
$this->prefs['slideshow_transition']['readParms'] = $transitions;
// $this->prefs['slideshow_transition']['writeParms'] = $transitions;
// $this->prefs['slideshow_transition']['readParms'] = $transitions;
$categories = e107::getMedia()->getCategories('gallery');
$cats = array();

View File

@@ -12,7 +12,7 @@
<mainPrefs>
</mainPrefs>
<mediaCategories>
<category type="image" sef="gallery-1" image='{e_PLUGIN}gallery/images/butterfly.jpg'>Gallery 1</category>
<category type="image" sef="gallery-1" perm="everyone" image='{e_PLUGIN}gallery/images/butterfly.jpg'>Gallery 1</category>
</mediaCategories>
<pluginPrefs>
<pref name="popup_w">800</pref>