mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-06-10 10:12:27 +00:00
CS
This commit is contained in:
parent
3883eafa37
commit
d007d1d29d
|
@ -146,14 +146,17 @@ class WeblinksHelper extends JHelperContent
|
||||||
{
|
{
|
||||||
$item->count_published = $weblink->count;
|
$item->count_published = $weblink->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($weblink->state == 0)
|
if ($weblink->state == 0)
|
||||||
{
|
{
|
||||||
$item->count_unpublished = $weblink->count;
|
$item->count_unpublished = $weblink->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($weblink->state == 2)
|
if ($weblink->state == 2)
|
||||||
{
|
{
|
||||||
$item->count_archived = $weblink->count;
|
$item->count_archived = $weblink->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($weblink->state == -2)
|
if ($weblink->state == -2)
|
||||||
{
|
{
|
||||||
$item->count_trashed = $weblink->count;
|
$item->count_trashed = $weblink->count;
|
||||||
|
|
|
@ -65,7 +65,8 @@ class JFormFieldModal_Weblink extends JFormField
|
||||||
function jSelectWeblink_" . $this->id . "(id, title, catid, object, url, language) {
|
function jSelectWeblink_" . $this->id . "(id, title, catid, object, url, language) {
|
||||||
window.processModalSelect('Weblink', '" . $this->id . "', id, title, catid, object, url, language);
|
window.processModalSelect('Weblink', '" . $this->id . "', id, title, catid, object, url, language);
|
||||||
}
|
}
|
||||||
");
|
"
|
||||||
|
);
|
||||||
$scriptSelect[$this->id] = true;
|
$scriptSelect[$this->id] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,6 +95,7 @@ class JFormFieldModal_Weblink extends JFormField
|
||||||
->from($db->quoteName('#__weblinks'))
|
->from($db->quoteName('#__weblinks'))
|
||||||
->where($db->quoteName('id') . ' = ' . (int) $value);
|
->where($db->quoteName('id') . ' = ' . (int) $value);
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$title = $db->loadResult();
|
$title = $db->loadResult();
|
||||||
|
@ -103,6 +105,7 @@ class JFormFieldModal_Weblink extends JFormField
|
||||||
JError::raiseWarning(500, $e->getMessage());
|
JError::raiseWarning(500, $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = empty($title) ? JText::_('COM_WEBLINKS_SELECT_A_WEBLINK') : htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
|
$title = empty($title) ? JText::_('COM_WEBLINKS_SELECT_A_WEBLINK') : htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
|
||||||
|
|
||||||
// The current weblink display field.
|
// The current weblink display field.
|
||||||
|
@ -122,6 +125,7 @@ class JFormFieldModal_Weblink extends JFormField
|
||||||
. '<span class="icon-file" aria-hidden="true"></span> ' . JText::_('JSELECT')
|
. '<span class="icon-file" aria-hidden="true"></span> ' . JText::_('JSELECT')
|
||||||
. '</a>';
|
. '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// New weblink button
|
// New weblink button
|
||||||
if ($allowNew)
|
if ($allowNew)
|
||||||
{
|
{
|
||||||
|
@ -135,6 +139,7 @@ class JFormFieldModal_Weblink extends JFormField
|
||||||
. '<span class="icon-new" aria-hidden="true"></span> ' . JText::_('JACTION_CREATE')
|
. '<span class="icon-new" aria-hidden="true"></span> ' . JText::_('JACTION_CREATE')
|
||||||
. '</a>';
|
. '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Edit weblink button
|
// Edit weblink button
|
||||||
if ($allowEdit)
|
if ($allowEdit)
|
||||||
{
|
{
|
||||||
|
@ -148,6 +153,7 @@ class JFormFieldModal_Weblink extends JFormField
|
||||||
. '<span class="icon-edit" aria-hidden="true"></span> ' . JText::_('JACTION_EDIT')
|
. '<span class="icon-edit" aria-hidden="true"></span> ' . JText::_('JACTION_EDIT')
|
||||||
. '</a>';
|
. '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear weblink button
|
// Clear weblink button
|
||||||
if ($allowClear)
|
if ($allowClear)
|
||||||
{
|
{
|
||||||
|
@ -159,6 +165,7 @@ class JFormFieldModal_Weblink extends JFormField
|
||||||
. '<span class="icon-remove" aria-hidden="true"></span>' . JText::_('JCLEAR')
|
. '<span class="icon-remove" aria-hidden="true"></span>' . JText::_('JCLEAR')
|
||||||
. '</a>';
|
. '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= '</span>';
|
$html .= '</span>';
|
||||||
|
|
||||||
// Select weblink modal
|
// Select weblink modal
|
||||||
|
@ -236,10 +243,12 @@ class JFormFieldModal_Weblink extends JFormField
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: class='required' for client side validation.
|
// Note: class='required' for client side validation.
|
||||||
$class = $this->required ? ' class="required modal-value"' : '';
|
$class = $this->required ? ' class="required modal-value"' : '';
|
||||||
$html .= '<input type="hidden" id="' . $this->id . '_id" ' . $class . ' data-required="' . (int) $this->required . '" name="' . $this->name
|
$html .= '<input type="hidden" id="' . $this->id . '_id" ' . $class . ' data-required="' . (int) $this->required . '" name="' . $this->name
|
||||||
. '" data-text="' . htmlspecialchars(JText::_('COM_WEBLINKS_SELECT_A_WEBLINK', true), ENT_COMPAT, 'UTF-8') . '" value="' . $value . '" />';
|
. '" data-text="' . htmlspecialchars(JText::_('COM_WEBLINKS_SELECT_A_WEBLINK', true), ENT_COMPAT, 'UTF-8') . '" value="' . $value . '" />';
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,8 @@ class Com_WeblinksInstallerScript
|
||||||
. $db->quote('com_weblinks.weblink') . ', '
|
. $db->quote('com_weblinks.weblink') . ', '
|
||||||
. $db->quote(
|
. $db->quote(
|
||||||
'{"special":{"dbtable":"#__weblinks","key":"id","type":"Weblink","prefix":"WeblinksTable","config":"array()"},
|
'{"special":{"dbtable":"#__weblinks","key":"id","type":"Weblink","prefix":"WeblinksTable","config":"array()"},
|
||||||
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}') . ', '
|
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'
|
||||||
|
) . ', '
|
||||||
. $db->quote('') . ', '
|
. $db->quote('') . ', '
|
||||||
. $db->quote(
|
. $db->quote(
|
||||||
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias",
|
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias",
|
||||||
|
@ -161,7 +162,8 @@ class Com_WeblinksInstallerScript
|
||||||
"core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params",
|
"core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params",
|
||||||
"core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"url",
|
"core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"url",
|
||||||
"core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc",
|
"core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc",
|
||||||
"core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}, "special":{}}') . ', '
|
"core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}, "special":{}}'
|
||||||
|
) . ', '
|
||||||
. $db->quote('WeblinksHelperRoute::getWeblinkRoute') . ', '
|
. $db->quote('WeblinksHelperRoute::getWeblinkRoute') . ', '
|
||||||
. $db->quote(
|
. $db->quote(
|
||||||
'{"formFile":"administrator\\/components\\/com_weblinks\\/models\\/forms\\/weblink.xml",
|
'{"formFile":"administrator\\/components\\/com_weblinks\\/models\\/forms\\/weblink.xml",
|
||||||
|
@ -170,7 +172,8 @@ class Com_WeblinksInstallerScript
|
||||||
"ordering"], "displayLookup":[{"sourceColumn":"catid","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"},
|
"ordering"], "displayLookup":[{"sourceColumn":"catid","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"},
|
||||||
{"sourceColumn":"created_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},
|
{"sourceColumn":"created_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},
|
||||||
{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},
|
{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},
|
||||||
{"sourceColumn":"modified_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"} ]}')
|
{"sourceColumn":"modified_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"} ]}'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
|
@ -189,7 +192,8 @@ class Com_WeblinksInstallerScript
|
||||||
. $db->quote('com_weblinks.category') . ', '
|
. $db->quote('com_weblinks.category') . ', '
|
||||||
. $db->quote('
|
. $db->quote('
|
||||||
{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},
|
{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},
|
||||||
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}') . ', '
|
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'
|
||||||
|
) . ', '
|
||||||
. $db->quote('') . ', '
|
. $db->quote('') . ', '
|
||||||
. $db->quote('
|
. $db->quote('
|
||||||
{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias",
|
{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias",
|
||||||
|
@ -198,7 +202,8 @@ class Com_WeblinksInstallerScript
|
||||||
"core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language",
|
"core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language",
|
||||||
"core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey",
|
"core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey",
|
||||||
"core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"},
|
"core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"},
|
||||||
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}') . ', '
|
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}'
|
||||||
|
) . ', '
|
||||||
. $db->quote('WeblinksHelperRoute::getCategoryRoute') . ', '
|
. $db->quote('WeblinksHelperRoute::getCategoryRoute') . ', '
|
||||||
. $db->quote('
|
. $db->quote('
|
||||||
{"formFile":"administrator\\/components\\/com_categories\\/models\\/forms\\/category.xml",
|
{"formFile":"administrator\\/components\\/com_categories\\/models\\/forms\\/category.xml",
|
||||||
|
@ -209,7 +214,8 @@ class Com_WeblinksInstallerScript
|
||||||
"displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id",
|
"displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id",
|
||||||
"displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id",
|
"displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id",
|
||||||
"displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id",
|
"displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id",
|
||||||
"displayColumn":"title"}]}')
|
"displayColumn":"title"}]}'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
|
|
|
@ -38,7 +38,7 @@ class WeblinksTableWeblink extends JTable
|
||||||
// Set the published column alias
|
// Set the published column alias
|
||||||
$this->setColumnAlias('published', 'state');
|
$this->setColumnAlias('published', 'state');
|
||||||
|
|
||||||
if (version_compare(JVERSION, '4.0', '<' ) == 1)
|
if (version_compare(JVERSION, '4.0', '<') == 1)
|
||||||
{
|
{
|
||||||
JTableObserverTags::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
|
JTableObserverTags::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
|
||||||
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
|
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
|
||||||
|
@ -130,6 +130,7 @@ class WeblinksTableWeblink extends JTable
|
||||||
if (trim($this->title) == '')
|
if (trim($this->title) == '')
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('COM_WEBLINKS_ERR_TABLES_TITLE'));
|
$this->setError(JText::_('COM_WEBLINKS_ERR_TABLES_TITLE'));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ class WeblinksViewWeblinks extends JViewLegacy
|
||||||
if (count($errors = $this->get('Errors')))
|
if (count($errors = $this->get('Errors')))
|
||||||
{
|
{
|
||||||
JError::raiseError(500, implode("\n", $errors));
|
JError::raiseError(500, implode("\n", $errors));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class WeblinksRouter extends JComponentRouterBase
|
||||||
}
|
}
|
||||||
|
|
||||||
// Are we dealing with an weblink that is attached to a menu item?
|
// Are we dealing with an weblink that is attached to a menu item?
|
||||||
if (isset($query['view']) && ($mView == $query['view']) and (isset($query['id'])) and ($mId == (int) $query['id']))
|
if (isset($query['view']) && ($mView == $query['view']) && (isset($query['id'])) && ($mId == (int) $query['id']))
|
||||||
{
|
{
|
||||||
unset($query['view']);
|
unset($query['view']);
|
||||||
unset($query['catid']);
|
unset($query['catid']);
|
||||||
|
@ -74,7 +74,7 @@ class WeblinksRouter extends JComponentRouterBase
|
||||||
return $segments;
|
return $segments;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($view) and ($view == 'category' or $view == 'weblink'))
|
if (isset($view) && ($view == 'category' || $view == 'weblink'))
|
||||||
{
|
{
|
||||||
if ($mId != (int) $query['id'] || $mView != $view)
|
if ($mId != (int) $query['id'] || $mView != $view)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,6 +53,7 @@ class WeblinksViewCategories extends JViewCategories
|
||||||
if (count($errors = $this->get('Errors')))
|
if (count($errors = $this->get('Errors')))
|
||||||
{
|
{
|
||||||
JError::raiseWarning(500, implode("\n", $errors));
|
JError::raiseWarning(500, implode("\n", $errors));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class WeblinksViewCategory extends JViewCategory
|
||||||
|
|
||||||
$temp = new JRegistry;
|
$temp = new JRegistry;
|
||||||
$temp->loadString($item->params);
|
$temp->loadString($item->params);
|
||||||
$item->params = clone($this->params);
|
$item->params = clone $this->params;
|
||||||
$item->params->merge($temp);
|
$item->params->merge($temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ class PlgFinderWeblinks extends FinderIndexerAdapter
|
||||||
public function onFinderAfterSave($context, $row, $isNew)
|
public function onFinderAfterSave($context, $row, $isNew)
|
||||||
{
|
{
|
||||||
// We only want to handle web links here. We need to handle front end and back end editing.
|
// We only want to handle web links here. We need to handle front end and back end editing.
|
||||||
if ($context == 'com_weblinks.weblink' || $context == 'com_weblinks.form' )
|
if ($context == 'com_weblinks.weblink' || $context == 'com_weblinks.form')
|
||||||
{
|
{
|
||||||
// Check if the access levels are different.
|
// Check if the access levels are different.
|
||||||
if (!$isNew && $this->old_access != $row->access)
|
if (!$isNew && $this->old_access != $row->access)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user