Skip to content

Commit

Permalink
closes #39 , closes #51
Browse files Browse the repository at this point in the history
  • Loading branch information
shoulders committed Oct 17, 2020
1 parent a0ba1a1 commit 38e4984
Show file tree
Hide file tree
Showing 86 changed files with 876 additions and 871 deletions.
8 changes: 4 additions & 4 deletions admin/access.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<access component="com_helloworld">
<access component="com_qwhelloworld">
<section name="component">
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
Expand All @@ -17,9 +17,9 @@
<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
<action name="core.edit.own" title="JACTION_EDITOWN" description="COM_CATEGORIES_ACCESS_EDITOWN_DESC" />
</section>
<section name="message">
<action name="core.delete" title="JACTION_DELETE" description="COM_HELLOWORLD_ACCESS_DELETE_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="COM_HELLOWORLD_ACCESS_EDIT_DESC" />
<section name="project">
<action name="core.delete" title="JACTION_DELETE" description="COM_QWHELLOWORLD_ACCESS_DELETE_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="COM_QWHELLOWORLD_ACCESS_EDIT_DESC" />
</section>
<section name="fieldgroup">
<action name="core.create" title="JACTION_CREATE" description="COM_FIELDS_GROUP_PERMISSION_CREATE_DESC" />
Expand Down
22 changes: 11 additions & 11 deletions admin/config.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<fieldset
name="greetings"
label="COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_LABEL"
description="COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_DESC"
name="projects"
label="COM_QWHELLOWORLD_CONFIG_PROJECT_SETTINGS_LABEL"
description="COM_QWHELLOWORLD_CONFIG_PROJECT_SETTINGS_DESC"
>
<field
name="show_category"
type="radio"
label="COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_LABEL"
description="COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_DESC"
label="COM_QWHELLOWORLD_PROJECT_FIELD_SHOW_CATEGORY_LABEL"
description="COM_QWHELLOWORLD_PROJECT_FIELD_SHOW_CATEGORY_DESC"
default="0"
>
<option value="0">JHIDE</option>
Expand All @@ -19,8 +19,8 @@
name="captcha"
type="plugins"
folder="captcha"
label="COM_HELLOWORLD_HELLOWORLD_FIELD_CAPTCHA_LABEL"
description="COM_HELLOWORLD_HELLOWORLD_FIELD_CAPTCHA_DESC"
label="COM_QWHELLOWORLD_PROJECT_FIELD_CAPTCHA_LABEL"
description="COM_QWHELLOWORLD_PROJECT_FIELD_CAPTCHA_DESC"
default="0"
filter="cmd"
>
Expand All @@ -30,8 +30,8 @@
<field
name="user_to_email"
type="user"
label="COM_HELLOWORLD_HELLOWORLD_FIELD_USER_TO_EMAIL_LABEL"
description="COM_HELLOWORLD_HELLOWORLD_FIELD_USER_TO_EMAIL_DESC"
label="COM_QWHELLOWORLD_PROJECT_FIELD_USER_TO_EMAIL_LABEL"
description="COM_QWHELLOWORLD_PROJECT_FIELD_USER_TO_EMAIL_DESC"
default="0"
>
</field>
Expand Down Expand Up @@ -60,7 +60,7 @@
</fieldset>
<fieldset name="integration"
label="JGLOBAL_INTEGRATION_LABEL"
description="COM_HELLOWORLD_CONFIG_INTEGRATION_SETTINGS_DESC"
description="COM_QWHELLOWORLD_CONFIG_INTEGRATION_SETTINGS_DESC"
>
<field
name="show_feed_link"
Expand All @@ -85,7 +85,7 @@
class="inputbox"
validate="rules"
filter="rules"
component="com_helloworld"
component="com_qwhelloworld"
section="component"
/>
</fieldset>
Expand Down
10 changes: 5 additions & 5 deletions admin/controller.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_helloworld
* @subpackage com_qwhelloworld
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
Expand All @@ -13,19 +13,19 @@
use Joomla\CMS\MVC\Controller\BaseController;

/**
* General Controller of HelloWorld component
* General Controller of Qwhelloworld component
*
* @package Joomla.Administrator
* @subpackage com_helloworld
* @subpackage com_qwhelloworld
* @since 0.0.7
*/
class HelloWorldController extends BaseController
class QwhelloworldController extends BaseController
{
/**
* The default view for the display method.
*
* @var string
* @since 12.2
*/
protected $default_view = 'helloworlds';
protected $default_view = 'projects';
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_helloworld
* @subpackage com_qwhelloworld
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
Expand All @@ -14,13 +14,13 @@
use Joomla\CMS\Uri\Uri;

/**
* HelloWorld Controller
* Project Controller
*
* @package Joomla.Administrator
* @subpackage com_helloworld
* @subpackage com_qwhelloworld
* @since 0.0.9
*/
class HelloWorldControllerHelloWorld extends FormController
class QwhelloworldControllerProject extends FormController
{
/**
* Implement to allowAdd or not
Expand Down Expand Up @@ -48,13 +48,13 @@ protected function allowEdit($data = array(), $key = 'id')
$id = isset( $data[ $key ] ) ? $data[ $key ] : 0;
if( !empty( $id ) )
{
return Factory::getUser()->authorise( "core.edit", "com_helloworld.helloworld." . $id );
return Factory::getUser()->authorise( "core.edit", "com_qwhelloworld.project." . $id );
}
}

public function batch($model = null)
{
$model = $this->getModel('helloworld');
$model = $this->getModel('project');
$this->setRedirect((string)Uri::getInstance());
return parent::batch($model);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_helloworld
* @subpackage com_qwhelloworld
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
Expand All @@ -12,11 +12,11 @@
use Joomla\CMS\MVC\Controller\AdminController;

/**
* HelloWorlds Controller
* Projects Controller
*
* @since 0.0.1
*/
class HelloWorldControllerHelloWorlds extends AdminController
class QwhelloworldControllerProjects extends AdminController
{
/**
* Proxy for getModel.
Expand All @@ -29,7 +29,7 @@ class HelloWorldControllerHelloWorlds extends AdminController
*
* @since 1.6
*/
public function getModel($name = 'HelloWorld', $prefix = 'HelloWorldModel', $config = array('ignore_request' => true))
public function getModel($name = 'Project', $prefix = 'QwhelloworldModel', $config = array('ignore_request' => true))
{
$model = parent::getModel($name, $prefix, $config);

Expand Down
26 changes: 13 additions & 13 deletions admin/helpers/associations.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* The Helloworld helper file for Multilingual Associations
* The Qwhelloworld helper file for Multilingual Associations
*/

defined('_JEXEC') or die;
Expand All @@ -11,17 +11,17 @@

Table::addIncludePath(__DIR__ . '/../tables');

class HelloworldAssociationsHelper extends AssociationExtensionHelper
class QwhelloworldAssociationsHelper extends AssociationExtensionHelper
{
/**
* The extension name
*/
protected $extension = 'com_helloworld';
protected $extension = 'com_qwhelloworld';

/**
* Array of item types which have associations
*/
protected $itemTypes = array('helloworld', 'category');
protected $itemTypes = array('project', 'category');

/**
* Has the extension association support
Expand All @@ -31,7 +31,7 @@ class HelloworldAssociationsHelper extends AssociationExtensionHelper
/**
* Get the associated items for an item
*
* @param string $typeName The item type, either 'helloworld' or 'category'
* @param string $typeName The item type, either 'project' or 'category'
* @param int $id The id of item for which we need the associated items
*
*/
Expand All @@ -42,9 +42,9 @@ public function getAssociations($typeName, $id)
$context = $this->extension . '.item';
$catidField = 'catid';

if ($typeName === 'helloworld')
if ($typeName === 'project')
{
$context = 'com_helloworld.item';
$context = 'com_qwhelloworld.item';
$catidField = 'catid';
}
elseif ($typeName === 'category')
Expand Down Expand Up @@ -90,8 +90,8 @@ public function getItem($typeName, $id)

switch ($typeName)
{
case 'helloworld':
$table = Table::getInstance('Helloworld', 'HelloworldTable');
case 'project':
$table = Table::getInstance('Project', 'QwhelloworldTable');
break;

case 'category':
Expand Down Expand Up @@ -128,8 +128,8 @@ public function getType($typeName = '')
{
switch ($typeName)
{
case 'helloworld':
$fields['title'] = 'a.greeting';
case 'project':
$fields['title'] = 'a.title';
$fields['ordering'] = '';
$fields['access'] = '';
$fields['state'] = 'a.published';
Expand All @@ -142,10 +142,10 @@ public function getType($typeName = '')
$support['category'] = true;

$tables = array(
'a' => '#__helloworld'
'a' => '#__com_qwhelloworld'
);

$title = 'helloworld';
$title = 'project';
break;

case 'category':
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Helper file for outputting html associated with the helloworld administrator functionality
* Helper file for outputting html associated with the Qwhelloworld administrator functionality
*/

defined('_JEXEC') or die;
Expand All @@ -12,14 +12,14 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;

JLoader::register('HelloworldHelper', JPATH_ADMINISTRATOR . '/components/com_helloworld/helpers/helloworld.php');
JLoader::register('QwhelloworldHelper', JPATH_ADMINISTRATOR . '/components/com_qwhelloworld/helpers/qwhelloworld.php');

class JHtmlHelloWorlds
class JHtmlProjects
{
/**
* Render the list of associated items
*
* @param integer $id The id of the helloworld record
* @param integer $id The id of the project record
*
* @return string The language HTML
*
Expand All @@ -31,7 +31,7 @@ public static function association($id)
$html = '';

// Get the associations
if ($associations = Associations::getAssociations('com_helloworld', '#__helloworld', 'com_helloworld.item', (int)$id))
if ($associations = Associations::getAssociations('com_qwhelloworld', '#__com_qwhelloworld', 'com_qwhelloworld.item', (int)$id))
{
foreach ($associations as $tag => $associated)
{
Expand All @@ -44,7 +44,7 @@ public static function association($id)
->select('h.*')
->select('l.sef as lang_sef')
->select('l.lang_code')
->from('#__helloworld as h')
->from('#__com_qwhelloworld as h')
->select('cat.title as category_title')
->join('LEFT', '#__categories as cat ON cat.id=h.catid')
->where('h.id IN (' . implode(',', array_values($associations)) . ')')
Expand All @@ -67,9 +67,9 @@ public static function association($id)
foreach ($items as &$item)
{
$text = $item->lang_sef ? strtoupper($item->lang_sef) : 'XX';
$url = Route::_('index.php?option=com_helloworld&task=helloworld.edit&id=' . (int) $item->id);
$url = Route::_('index.php?option=com_qwhelloworld&task=project.edit&id=' . (int) $item->id);

$tooltip = htmlspecialchars($item->greeting, ENT_QUOTES, 'UTF-8') . '<br />' . Text::sprintf('JCATEGORY_SPRINTF', $item->category_title);
$tooltip = htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8') . '<br />' . Text::sprintf('JCATEGORY_SPRINTF', $item->category_title);
$classes = 'hasPopover label label-association label-' . $item->lang_sef;

$item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes
Expand Down
Loading

0 comments on commit 38e4984

Please sign in to comment.