diff --git a/e107_admin/image.php b/e107_admin/image.php
index cf240a1d4..8964a13bb 100644
--- a/e107_admin/image.php
+++ b/e107_admin/image.php
@@ -129,7 +129,7 @@ class media_cat_ui extends e_admin_ui
'media_cat_diz' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=150&bb=1','readonly'=>FALSE), // Display name
'media_cat_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int'),
'media_cat_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => '5%', 'thclass' => 'right', 'class'=> 'right' ),
- 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center')
+ 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center')
);
function init()
@@ -203,6 +203,14 @@ class media_form_ui extends e_admin_form_ui
$this->cats[$cat] = $row['media_cat_title'];
}
asort($this->cats);*/
+
+ if(varset($_POST['multiselect']) && varset($_POST['e__execute_batch']) && (varset($_POST['etrigger_batch']) == 'options__rotate_cw' || varset($_POST['etrigger_batch']) == 'options__rotate_ccw'))
+ {
+ $type = str_replace('options__','',$_POST['etrigger_batch']);
+ $ids = implode(",",$_POST['multiselect']);
+ $this->rotateImages($ids,$type);
+ }
+
}
function resize_method($curval)
@@ -218,6 +226,43 @@ class media_form_ui extends e_admin_form_ui
return $frm->selectbox('resize_method',$options,$curval)."
".IMALAN_4."
";
}
+ private function rotateImages($ids,$type)
+ {
+ $sql = e107::getDb();
+ $tp = e107::getParser();
+ $mes = e107::getMessage();
+
+ $degrees = ($type == 'rotate_cw') ? 270 : 90;
+
+ // $mes->addDebug("Rotate Mode Set: ".$type);
+
+ //TODO GIF and PNG rotation.
+
+ if($sql->db_Select("core_media","media_url","media_id IN (".$ids.") AND media_type = 'image/jpeg' "))
+ {
+ while($row = $sql->db_Fetch())
+ {
+ $original = $tp->replaceConstants($row['media_url']);
+
+ $mes->addDebug("Attempting to rotate by {$degrees} degrees: ".basename($original));
+
+ $source = imagecreatefromjpeg($original);
+
+ $rotate = imagerotate($source, $degrees, 0);
+ $srch = array(".jpg",".jpeg");
+ $cacheFile = str_replace($srch,"",strtolower(basename($original)))."_(.*)\.cache\.bin";
+
+ if(imagejpeg($rotate,$original,100))
+ {
+ $mes->addSuccess("Rotated: ".basename($original));
+ e107::getCache()->clearAll('image',$cacheFile);
+ $mes->addDebug("Clearing Image cache with mask: ".$cacheFile);
+ }
+ }
+ }
+ }
+
+
function resize_dimensions($curval) // ie. never manually resize another image again!
{
$text = "";
@@ -255,7 +300,7 @@ class media_form_ui extends e_admin_form_ui
// $text .= $frm->text("resize_dimensions[{$key}]",$val, 5, array('size'=>'5')).$title."
";
}
- $text .= "
Warning: This feature is experimental.
";
+ // $text .= "
Warning: This feature is experimental.
";
return $text;
@@ -263,9 +308,22 @@ class media_form_ui extends e_admin_form_ui
}
- function options()
+ function options($parms, $value, $id)
{
//return print_a($_GET,true);
+ if($value == 'batch')
+ {
+ return array(
+ "rotate_cw" => "Rotate 90° cw",
+ "rotate_ccw" => "Rotate 90° ccw"
+ );
+ }
+
+ if($_GET['action'] == 'edit')
+ {
+ return;
+ }
+
$tagid = $_GET['tagid'];
$path = $this->getController()->getListModel()->get('media_url');
$title = $this->getController()->getListModel()->get('media_name');
@@ -275,7 +333,15 @@ class media_form_ui extends e_admin_form_ui
$bbcode = ($_GET['bbcode']=='file') ? "file" : "";
// $save = ($_GET['bbcode']!='file') ? "e-dialog-save" : "";
// e-dialog-close
- return "";
+ $text = $this->renderValue('options',$value,'',$id);
+
+ if($_GET['action'] == 'dialog')
+ {
+ $text .= "";
+ }
+
+ return $text;
+
}
@@ -360,7 +426,7 @@ class media_admin_ui extends e_admin_ui
'media_tags' => array('title'=> "Tags/Keywords", 'type' => 'text', 'data'=> 'str', 'width' => '10%', 'filter'=>TRUE,'batch'=>TRUE ),
'media_usedby' => array('title'=> '', 'type' => 'text', 'data'=> 'text', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'nolist'=>true, 'readonly'=>TRUE ),
- 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'data'=> null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center')
+ 'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'data'=> null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center', 'batch'=>true, 'noedit'=>true)
);
diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php
index b7aced76f..7d3be5ed5 100644
--- a/e107_admin/newspost.php
+++ b/e107_admin/newspost.php
@@ -1916,7 +1916,7 @@ class admin_newspost
".NWSLAN_12.": |
- post_toForm($_POST['news_title'])."\" class='tbox' style='width:90%' />
+ post_toForm($_POST['news_title'])."\" class='tbox' style='width:90%' required='required' />
".
// TOO short -> $frm->text('news_title', $tp->post_toForm($_POST['news_title']),200,array('size'=>300)).
"
diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php
index 32987b48c..32c8e71b0 100644
--- a/e107_admin/plugin.php
+++ b/e107_admin/plugin.php
@@ -37,13 +37,18 @@ if(e_AJAX_REQUEST && isset($_GET['src'])) // Ajax
echo 'There was a problem retrieving the file';
exit;
}
+// chmod(e_PLUGIN,0777);
+ chmod(e_UPLOAD.$localfile,0755);
require_once(e_HANDLER."pclzip.lib.php");
$archive = new PclZip(e_UPLOAD.$localfile);
- $unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_PLUGIN, PCLZIP_OPT_SET_CHMOD, 0666));
-
+ $unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_PLUGIN, PCLZIP_OPT_SET_CHMOD, 0755));
+// chmod(e_PLUGIN,0755);
$dir = basename($unarc[0]['filename']);
-
+// chmod(e_UPLOAD.$localfile,0666);
+
+
+
/* Cannot use this yet until 'folder' is included in feed.
if($dir != $p['plugin_folder'])
{
@@ -65,17 +70,20 @@ if(e_AJAX_REQUEST && isset($_GET['src'])) // Ajax
e107::getDb()->db_Select_gen("SELECT plugin_id FROM #plugin WHERE plugin_path = '".$plugPath."' LIMIT 1");
$row = e107::getDb()->db_Fetch(MYSQL_ASSOC);
$status = e107::getSingleton('e107plugin')->install_plugin($row['plugin_id']);
- unlink(e_UPLOAD.$localfile);
+ //unlink(e_UPLOAD.$localfile);
}
else
{
- print_a($unarc);
- $status = "There was a problem";
+ // print_a($fileList);
+ $status = "Error: Download Manually";
+ //echo $archive->errorInfo(true);
+ // $status = "There was a problem";
//unlink(e_UPLOAD.$localfile);
}
echo $status;
+ @unlink(e_UPLOAD.$localfile);
// echo "file=".$file;
exit;
@@ -95,6 +103,12 @@ require_once(e_HANDLER.'file_class.php');
require_once(e_HANDLER."form_handler.php");
require_once (e_HANDLER.'message_handler.php');
+if(isset($_POST['uninstall_cancel']))
+{
+ header("location:".e_SELF);
+ exit;
+}
+
$plugin = new e107plugin;
$pman = new pluginManager;
@@ -1209,10 +1223,14 @@ class pluginManager{
|
";
+
+ $text .= $frm->admin_button('uninstall_confirm',EPL_ADLAN_3,'submit');
+ $text .= $frm->admin_button('uninstall_cancel',EPL_ADLAN_62,'cancel');
+ /*
$text .= "
";
-
+ */
// $frm->admin_button($name, $value, $action = 'submit', $label = '', $options = array());
$text .= "
diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php
index 9f75a56ab..6e29ff5ab 100644
--- a/e107_admin/prefs.php
+++ b/e107_admin/prefs.php
@@ -282,7 +282,7 @@ $text .= "".$tp->parseTemplate("{IMAGESELECTOR={$parms
$sLogo = siteinfo_shortcodes::sc_logo();
-echo $sLogo;
+//echo $sLogo;
// $frm->imagepicker('sitelogo',$pref['sitelogo'],'_common')
diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php
index 3434d187a..2b52b483b 100644
--- a/e107_handlers/admin_ui.php
+++ b/e107_handlers/admin_ui.php
@@ -3675,6 +3675,11 @@ class e_admin_ui extends e_admin_controller_ui
$val = "'".$value."'";
}
+ if($field == 'options') // reserved field type. see: admin -> media-manager - batch rotate image.
+ {
+ return;
+ }
+
$cnt = $this->getTreeModel()->update($field, $val, $selected, $value, false);
if($cnt)
{
diff --git a/e107_handlers/cache_handler.php b/e107_handlers/cache_handler.php
index 4b8c74147..e86ba09a6 100644
--- a/e107_handlers/cache_handler.php
+++ b/e107_handlers/cache_handler.php
@@ -272,11 +272,9 @@ class ecache {
* @example clearAll('db');
*/
- function clearAll($type)
- {
-
+ function clearAll($type,$mask = null)
+ {
$path = null;
- $mask = null;
if($type =='content')
{
@@ -299,13 +297,13 @@ class ecache {
if($type == 'db')
{
$path = e_CACHE_DB;
- $mask = '*.php';
+ $mask = ($mask == null) ? '*.php' : $mask;
}
if($type == 'image')
{
$path = e_CACHE_IMAGE;
- $mask = '*.cache\.bin';
+ $mask = ($mask == null) ? '*.cache\.bin' : $mask;
}
if((null == $path) || (null == $mask))
@@ -315,7 +313,7 @@ class ecache {
$fl = e107::getFile(false);
$fl->mode = 'fname';
- $files = $fl->get_files($path, $fmask);
+ $files = $fl->get_files($path, $mask);
if($files)
{
foreach ($files as $file)