Skip to content

Commit

Permalink
Update Windwalker
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed May 6, 2017
1 parent 288b58c commit 41de2ee
Show file tree
Hide file tree
Showing 92 changed files with 2,765 additions and 929 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,64 @@ public static function addSubmenu($vName)
$dispatcher->trigger('onAfterAddSubmenu', array('{{extension.element.lower}}', $vName));
}

/**
* Adds Count Items for Category Manager.
*
* @param stdClass[] &$items The banner category objects
*
* @return stdClass[]
*
* @throws \RuntimeException
*
* @since 1.0
*/
public static function countItems(&$items)
{
$db = JFactory::getDbo();

foreach ($items as $item)
{
$item->count_trashed = 0;
$item->count_archived = 0;
$item->count_unpublished = 0;
$item->count_published = 0;

$query = $db->getQuery(true);

$query->select('state, count(*) AS count')
->from($query->quoteName('#__{{extension.name.lower}}_{{controller.list.name.lower}}'))
->where('catid = ' . (int) $item->id)
->group('state');

$db->setQuery($query);

$elements = (array) $db->loadObjectList();

foreach ($elements as $element)
{
switch ($element->state) {
case 0:
$item->count_unpublished = $element->count;
break;

case 1:
$item->count_published = $element->count;
break;

case 2:
$item->count_archived = $element->count;
break;

case -2:
$item->count_trashed = $element->count;
break;
}
}
}

return $items;
}

/**
* Gets a list of the actions that can be performed.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</script>

<div id="{{extension.name.lower}}" class="windwalker {{controller.item.name.lower}} edit-form row-fluid">
<form action="<?php echo JUri::getInstance(); ?>" method="post" name="adminForm" id="adminForm"
<form action="<?php echo JURI::getInstance(); ?>" method="post" name="adminForm" id="adminForm"
class="form-validate" enctype="multipart/form-data">

<?php echo JHtmlBootstrap::startTabSet('{{controller.item.name.lower}}EditTab', array('active' => 'tab_basic')); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
*/
$container = $this->getContainer();
?>

<div id="{{extension.name.lower}}" class="windwalker {{controller.list.name.lower}} tablelist row-fluid">
<form action="<?php echo JUri::getInstance(); ?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
<form action="<?php echo JURI::getInstance(); ?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">

<?php if (!empty($this->data->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,15 @@ protected function populateState($ordering = null, $direction = null)

// Limitstart
// =====================================================================================
$this->set('list.start', $input->getInt('limitstart', 0));

$this->set('list.limit', $params->get('num_intro_articles', 15));
// Simple fix for current Joomla
// @see https://github.com/ventoviro/windwalker-joomla-rad/issues/203
$this->set('list.start', $input->getInt('start', $input->getInt('limitstart', 0)));
$this->set(
'list.limit',
$params->get('num_leading_articles', 0)
+ $params->get('num_intro_articles', 15)
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public function build(&$query)
if (!empty($query['_resource']))
{
$segments = $this->router->generate($query['_resource'], $query);

unset($query['view'], $query['_rawRoute']);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
option="{{extension.element.lower}}_{{controller.item.name.lower}}_view_default_option">
<help
key="JHELP_MENUS_MENU_ITEM_ARTICLE_SINGLE_ARTICLE"
/>
/>
<message>
<![CDATA[{{extension.element.lower}}_item_view_default_desc]]>
</message>
Expand All @@ -20,7 +20,7 @@
label="{{extension.element.upper}}_SELECT_{{controller.item.name.upper}}"
required="true"
description="C{{extension.element.upper}}_SELECT_{{controller.item.name.upper}}_DESC"
/>
/>
</fieldset>
</fields>

Expand All @@ -44,7 +44,7 @@
type="list"
description="JGLOBAL_LINKED_TITLES_DESC"
label="JGLOBAL_LINKED_TITLES_LABEL"
>
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
Expand All @@ -54,7 +54,7 @@
type="list"
description="{{extension.element.upper}}_LINKED_TITLES_IN_LIST_DESC"
label="{{extension.element.upper}}_LINKED_TITLES_IN_LIST"
>
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
Expand All @@ -64,7 +64,7 @@
type="list"
description="JGLOBAL_SHOW_INTRO_DESC"
label="JGLOBAL_SHOW_INTRO_LABEL"
>
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
Expand All @@ -74,7 +74,7 @@
type="list"
description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"
label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
>
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ protected function prepareData()
$this['params'] = $this->get('Params');
$this['category'] = $this->get('Category');

// Uncomment this to fix Joomla pagination routing
// $this['pagination']->setAdditionalUrlParam('_resource', '{{controller.list.name.lower}}');

// Set Data
// =====================================================================================
foreach ($this->data->items as &$item)
Expand Down
Loading

0 comments on commit 41de2ee

Please sign in to comment.