diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php
index 021398620..a2493218b 100644
--- a/e107_admin/newspost.php
+++ b/e107_admin/newspost.php
@@ -123,7 +123,7 @@ class news_cat_ui extends e_admin_ui
protected $fields = array(
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
'category_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readonly'=>TRUE),
- 'category_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60', 'writeParms' => 'glyphs=1', 'readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
+ 'category_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>array('legacy'=>'{e_IMAGE}icons/'), 'writeParms' => 'glyphs=1', 'readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE), // thumb=60&thumb_urlraw=0&thumb_aw=60
'category_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'validate' => true, 'writeParms'=>array('size'=>'xxlarge')),
'category_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'readonly'=>FALSE, 'writeParms'=>array('size'=>'xxlarge')),
diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php
index d99b23d1e..1f6c3744c 100644
--- a/e107_admin/plugin.php
+++ b/e107_admin/plugin.php
@@ -994,8 +994,20 @@ class pluginManager{
}
else
{
+ $eplug_folder = null;
+ $upgrade_alter_tables = null;
+ $upgrade_add_prefs = null;
+ $upgrade_remove_prefs = null;
+ $upgrade_add_array_pref = null;
+ $upgrade_remove_array_pref = null;
+ $eplug_version = null;
+
+
+
include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
+ $text = '';
+
$func = $eplug_folder.'_upgrade';
if (function_exists($func))
{
@@ -2178,6 +2190,7 @@ class pluginBuilder
var $tableCount = 0;
var $tableList = array();
var $createFiles = false;
+ private $buildTable = false;
private $debug = false;
function __construct()
@@ -2321,6 +2334,7 @@ class pluginBuilder
$frm = e107::getForm();
$ns = e107::getRender();
$mes = e107::getMessage();
+
$newplug = $_GET['newplugin'];
$this->pluginName = $newplug;
@@ -2340,6 +2354,12 @@ class pluginBuilder
$data = file_get_contents($sqlFile);
$ret = $dv->getTables($data);
}
+ else
+ {
+
+ // $ret = $this->buildTables();
+ // $this->buildTable = true;
+ }
$text = $frm->open('newplugin-step3','post', e_SELF.'?mode=create&newplugin='.$newplug.'&createFiles='.$this->createFiles.'&step=3');
@@ -2352,7 +2372,16 @@ class pluginBuilder
{
foreach($ret['tables'] as $key=>$table)
{
- $text .= "
Table: ".$table."";
+ if($this->buildTable == true)
+ {
+ $label = "".$frm->checkbox('buildTable',1,false)." Build Table";
+ }
+ else
+ {
+ $label = "Table: ".$table;
+ }
+
+ $text .= "".$label."";
$this->tableList[] = $table;
}
}
@@ -2414,6 +2443,40 @@ class pluginBuilder
}
+
+ private function buildTables()
+ {
+
+ $template = "plugin_id int(10) unsigned NOT NULL auto_increment,
+ plugin_datestamp int(10) unsigned NOT NULL default '0',
+ plugin_name varchar(255) NOT NULL default '',
+ plugin_text text NOT NULL,
+ plugin_boolean tinyint(1) unsigned NOT NULL default '0',
+ plugin_author int(10) unsigned default NULL,
+ plugin_visibility int(4) NOT NULL default '0',
+ plugin_tags varchar(255) NOT NULL default '',
+ plugin_order int(6) unsigned NOT NULL default '0',
+ PRIMARY KEY (plugin_id)";
+
+ $ret = array();
+
+ $ret['tables'] = array($this->pluginName);
+
+ $ret['data'] = array(0=> str_replace("plugin", $this->pluginName, $template) );
+
+ $ret['engine'] = array('0'=> 'InnoDB');
+
+ return $ret;
+
+ }
+
+
+
+
+
+
+
+
private function createAddons($list)
{
diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php
index 9acdf64be..dfe3ce6b3 100644
--- a/e107_core/shortcodes/batch/news_shortcodes.php
+++ b/e107_core/shortcodes/batch/news_shortcodes.php
@@ -833,7 +833,8 @@ class news_shortcodes extends e_shortcode
return e107::getUrl()->create('news/view/item', $this->news_item);
}
- function sc_newscaticon($parm = '')
+ /* @deprecated - use {NEWS_CATEGORY_ICON} instead */
+ function sc_newscaticon($parm = array())
{
// BC
$category_icon = str_replace('../', '', trim($this->news_item['category_icon']));
@@ -850,23 +851,29 @@ class news_shortcodes extends e_shortcode
$src = (is_readable(e_IMAGE_ABS."newspost_images/".$category_icon)) ? e_IMAGE_ABS."newspost_images/".$category_icon : e_IMAGE_ABS."icons/".$category_icon;
}
- $alt_text = e107::getParser()->toHTML($this->news_item['category_name'], FALSE ,'defs');
- //TODO - remove inline styles
- if($this->param['caticon'] == ''){$this->param['caticon'] = 'border:0px';}
+
+ // if($this->param['caticon'] == ''){$this->param['caticon'] = 'border:0px';}
+
+ $parm['alt'] = e107::getParser()->toHTML($this->news_item['category_name'], FALSE ,'defs');
+ $parm['legacy'] = array('{e_IMAGE}newspost_images/', '{e_IMAGE}icons/');
+ $parm['class'] = 'icon news_image news-category-icon';
+
+ $icon = e107::getParser()->toIcon($category_icon, $parm);
switch($parm)
{
+ /* @deprecated - Will cause issues with glyphs */
case 'src':
return $src;
break;
case 'tag':
- return "
";
+ return $icon;
break;
case 'url':
default:
- return "news_item)."'>
";
+ return "news_item)."'>".$icon."";
break;
}
}
diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php
index 3e7502822..acadee2e2 100644
--- a/e107_handlers/e_parse_class.php
+++ b/e107_handlers/e_parse_class.php
@@ -3565,7 +3565,7 @@ class e_parser
*/
public function toIcon($icon='',$parm = array())
{
-
+
if(!vartrue($icon))
{
return;
@@ -3598,20 +3598,29 @@ class e_parser
{
$path = $this->replaceConstants($icon,'full');
}
- elseif(vartrue($parm['legacy']))
+ elseif(!empty($parm['legacy']))
{
-
- $legacyPath = $parm['legacy'].$icon;
- $filePath = $this->replaceConstants($legacyPath,'rel');
-
- if(is_readable($filePath))
+ $legacyList = (!is_array($parm['legacy'])) ? array($parm['legacy']) : $parm['legacy'];
+
+ foreach($legacyList as $legPath)
{
- $path = $this->replaceConstants($legacyPath,'full');
+ $legacyPath = $legPath.$icon;
+ $filePath = $this->replaceConstants($legacyPath);
+
+ if(is_readable($filePath))
+ {
+ $path = $this->replaceConstants($legacyPath,'full');
+ break;
+ }
+
}
- else
+
+ if(empty($path))
{
$log = e107::getAdminLog();
- $log->addDebug('Broken Icon Path: '.$legacyPath."\n".print_r(debug_backtrace(null,2), true), false)->save('IMALAN_00');
+ $log->addDebug('Broken Icon Path: '.$icon."\n".print_r(debug_backtrace(null,2), true), false)->save('IMALAN_00');
+ e107::getDebug()->log('Broken Icon Path: '.$icon);
+ return null;
}
}
@@ -3621,9 +3630,10 @@ class e_parser
}
-
+ $alt = (!empty($parm['alt'])) ? $this->toAttribute($parm['alt']) : basename($path);
+ $class = (!empty($parm['class'])) ? $parm['class'] : 'icon';
- return "
";
+ return "
";
}
diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php
index 41a8cd171..adfcbc140 100644
--- a/e107_handlers/form_handler.php
+++ b/e107_handlers/form_handler.php
@@ -3775,8 +3775,9 @@ class e_form
break;
case 'icon':
-
- $value = $tp->toIcon($value,array('size'=>'2x'));
+
+ $parms['size'] = '2x';
+ $value = $tp->toIcon($value,$parms);
break;
diff --git a/e107_plugins/news/templates/news_template.php b/e107_plugins/news/templates/news_template.php
index e3cc1e7ff..a7c75e069 100644
--- a/e107_plugins/news/templates/news_template.php
+++ b/e107_plugins/news/templates/news_template.php
@@ -37,7 +37,7 @@ $NEWS_TEMPLATE['list']['item'] = '
- {NEWSSUMMARY}
+ {NEWS_SUMMARY}
'.LAN_READ_MORE.'
@@ -96,7 +96,7 @@ $NEWS_TEMPLATE['default']['item'] = '
{NEWSIMAGE: item=1}
-
{NEWSSUMMARY}
+
{NEWS_SUMMARY}
{NEWSVIDEO: item=1}
{NEWSBODY}
diff --git a/news.php b/news.php
index 5d6c5e88a..fe795552c 100644
--- a/news.php
+++ b/news.php
@@ -311,14 +311,38 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag']))
require_once(HEADERF);
$action = $currentNewsAction;
- if(vartrue($NEWSLISTSTYLE)) // Legacy v1.x
- {
- $template = array('start'=>'', 'item'=>$NEWSLISTSTYLE, 'end'=>'');
- }
- else // v2.x
+ if(deftrue('BOOTSTRAP')) // v2.x
{
$template = e107::getTemplate('news', 'news', 'list');
}
+ else // v1.x
+ {
+ if(empty($NEWSLISTSTYLE))
+ {
+ $NEWSLISTSTYLE = "
+
+
+
+
+ {NEWS_CATEGORY_ICON}
+ |
+ {NEWSTITLELINK=extend}
+
+ {NEWS_SUMMARY}
+
+ {NEWS_DATE}
+ {NEWSCOMMENTS}
+
+ |
+ {SETIMAGE: w=55&h=55&crop=1}
+ {NEWSTHUMBNAIL}
+ |
+
\n";
+ }
+
+ $template = array('start'=>'', 'item'=>$NEWSLISTSTYLE, 'end'=>'');
+
+ }
// Legacy Styling..
$param = array();