Skip to content

Commit

Permalink
Reformat Code and fix Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdesign committed Apr 13, 2017
1 parent f29566e commit 732c601
Show file tree
Hide file tree
Showing 22 changed files with 1,708 additions and 1,588 deletions.
37 changes: 1 addition & 36 deletions packages/mod_junewsultra/assets/css/junewsultra.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,6 @@ div.current select { margin-top: 10px; margin-bottom: 5px; }
/* fields */
.spacer hr { border: 1px dotted #ccc; }

/*.label {
display: inline-block;
padding: 2px 3px;
font-size: 11px;
font-weight: bold;
line-height: 12px;
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
white-space: nowrap;
vertical-align: baseline;
background-color: #999999;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}*/

.fltrt a.label:hover{
color: #ffffff;
text-decoration: none;
cursor: pointer;
}



.tab-pane .span9,
.tab-pane {
background: #fafafa;
Expand Down Expand Up @@ -185,15 +161,4 @@ div.current select { margin-top: 10px; margin-bottom: 5px; }

#description {
overflow: hidden;
}

#jusocial {
position: absolute;
top: 310px;
right: 20px;
width: 30%;
min-height: 400px;

overflow: hidden;
}

}
42 changes: 25 additions & 17 deletions packages/mod_junewsultra/fields/article.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,38 @@ class JFormFieldModal_Article extends JFormField
/**
* The form field type.
*
* @var string
* @var string
* @since 1.6
*/
protected $type = 'Modal_Article';

/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @return string The field input markup.
*
* @since 1.6
*/
protected function getInput()
{
$allowEdit = ((string) $this->element['edit'] == 'true') ? true : false;
$allowClear = ((string) $this->element['clear'] != 'false') ? true : false;
$allowEdit = ((string) $this->element['edit'] == 'true') ? true : false;
$allowClear = ((string) $this->element['clear'] != 'false') ? true : false;

JFactory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR);
JHtml::_('behavior.modal', 'a.modal');

$script = array();
$script = array();
$script[] = ' function jSelectArticle_' . $this->id . '(id, title, catid, object) {';
$script[] = ' document.getElementById("' . $this->id . '_id").value = id;';
$script[] = ' document.getElementById("' . $this->id . '_name").value = title;';

if ($allowEdit) {
if ($allowEdit)
{
$script[] = ' jQuery("#' . $this->id . '_edit").removeClass("hidden");';
}

if ($allowClear) {
if ($allowClear)
{
$script[] = ' jQuery("#' . $this->id . '_clear").removeClass("hidden");';
}

Expand All @@ -75,8 +77,8 @@ protected function getInput()

JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));

$html = array();
$link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&function=jSelectArticle_' . $this->id;
$html = array();
$link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&function=jSelectArticle_' . $this->id;

if (isset($this->element['language']))
{
Expand All @@ -85,31 +87,35 @@ protected function getInput()

if ((int) $this->value > 0)
{
$db = JFactory::getDbo();
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__content'))
->where($db->quoteName('id') . ' = ' . (int) $this->value);
$db->setQuery($query);

try {
try
{
$title = $db->loadResult();
}
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage());
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}
}

if (empty($title)) {
if (empty($title))
{
$title = JText::_('COM_CONTENT_SELECT_AN_ARTICLE');
}
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');

if (0 == (int) $this->value) {
if (0 == (int) $this->value)
{
$value = '';
}
else {
else
{
$value = (int) $this->value;
}

Expand All @@ -118,7 +124,8 @@ protected function getInput()
$html[] = '<a class="modal btn hasTooltip" title="' . JHtml::tooltipText('COM_CONTENT_CHANGE_ARTICLE') . '" href="' . $link . '&amp;' . JSession::getFormToken() .
'=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('JSELECT') . '</a>';

if ($allowEdit) {
if ($allowEdit)
{
$html[] = '<a class="btn hasTooltip' . ($value ? '' : ' hidden') . '" href="index.php?option=com_content&layout=modal&tmpl=component&task=article.edit&id=' . $value . '" target="_blank" title="' . JHtml::tooltipText('COM_CONTENT_EDIT_ARTICLE') . '" ><span class="icon-edit"></span>' . JText::_('JACTION_EDIT') . '</a>';
}

Expand All @@ -131,7 +138,8 @@ protected function getInput()
$html[] = '</span>';

$class = '';
if ($this->required) {
if ($this->required)
{
$class = ' class="required modal-value"';
}

Expand Down
59 changes: 30 additions & 29 deletions packages/mod_junewsultra/fields/commentsradio.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
/**
* JUNewsUltra Pro
*
* @version 6.x
* @package UNewsUltra Pro
* @author Denys D. Nosov ([email protected])
* @copyright (C) 2007-2017 by Denys D. Nosov (http://joomla-ua.org)
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
* @version 6.x
* @package UNewsUltra Pro
* @author Denys D. Nosov ([email protected])
* @copyright (C) 2007-2017 by Denys D. Nosov (http://joomla-ua.org)
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
*
**/

Expand All @@ -28,44 +28,45 @@ protected function getInput()

$class = $this->element['class'] ? ' class="radio ' . (string) $this->element['class'] . '"' : ' class="radio"';

$html[] = '<fieldset id="' . $this->id . '"' . $class . '>';
$html[] = '<fieldset id="' . $this->id . '"' . $class . '>';

$options = $this->getOptions();

foreach ($options as $i => $option)
{
$checked = ((string) $option->value == (string) $this->value) ? ' checked="checked"' : '';
$class = !empty($option->class) ? ' class="' . $option->class . '"' : '';

$commets_system = htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8');
$comments = JPATH_SITE . '/components/com_'. $commets_system .'/'. $commets_system .'.php';

if (!file_exists($comments))
{
$disabled = ' disabled="disabled"';
$color = 'color: #999;';
$tips = ' <sup class="label label-inverse">'. JText::_('MOD_JUNEWS_NOTINSTALL') .'</sup>';
$check = '';
}
else {
$disabled = '';
$color = '';
$tips = '';
$check = $checked;
}
$checked = ((string) $option->value == (string) $this->value) ? ' checked="checked"' : '';
$class = !empty($option->class) ? ' class="' . $option->class . '"' : '';

$commets_system = htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8');
$comments = JPATH_SITE . '/components/com_' . $commets_system . '/' . $commets_system . '.php';

if (!file_exists($comments))
{
$disabled = ' disabled="disabled"';
$color = 'color: #999;';
$tips = ' <sup class="label label-inverse">' . JText::_('MOD_JUNEWS_NOTINSTALL') . '</sup>';
$check = '';
}
else
{
$disabled = '';
$color = '';
$tips = '';
$check = $checked;
}

$onclick = !empty($option->onclick) ? ' onclick="' . $option->onclick . '"' : '';

$html[] = '<input type="radio" id="' . $this->id . $i . '" name="' . $this->name . '"' . ' value="'
. htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8') . '"' . $check . $class . $onclick . $disabled . '/>';

$html[] = '<label for="' . $this->id . $i . '" id="' . $this->id . $i . '" style="'. $color .'">'
$html[] = '<label for="' . $this->id . $i . '" id="' . $this->id . $i . '" style="' . $color . '">'
. JText::alt($option->text, preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)) . $tips . '</label>';

$html[] = '<div style="clear: both;"></div>';
$html[] = '<div style="clear: both;"></div>';
}

$html[] = '</fieldset>';
$html[] = '</fieldset>';

return implode($html);
}
Expand All @@ -89,7 +90,7 @@ protected function getOptions()
((string) $option['disabled'] == 'true')
);

$tmp->class = (string) $option['class'];
$tmp->class = (string) $option['class'];
$tmp->onclick = (string) $option['onclick'];

$options[] = $tmp;
Expand Down
Loading

0 comments on commit 732c601

Please sign in to comment.