Keyword

Section 508 Compliance Labels for Select Menu

More
8 years 2 months ago - 8 years 2 months ago #151835 by Luke
Hello,

I am relatively new to Joomla so this may be a silly question. I am set to keep this website goodwillmidmichigan.org/ compliant with Section 508, using a compliance checking tool it flags the Select Box (Resource Guides) as missing labels on the home which violates Section 508 compliance standards. The question is, how exactly do I change the code in order to add labels to this section?

I think it has to do with this file public_html/templates/goodwillmidmichigan/html/mod_k2_tools/helper.php but anything I do in this file does not reflect on the site itself. I have confirmed that the changes are indeed being made and saved. I am just misunderstanding what needs to be done to edit the way this is to work.

Any advice would be awesome!

The code in helper.php that leads me to believe this is what needs to be edited is as follows:
public static function treeselectbox(&$params, $id = 0, $level = 0)
	{

		$mainframe = JFactory::getApplication();
		$root_id = (int)$params->get('root_id2');
		$option = JRequest::getCmd('option');
		$view = JRequest::getCmd('view');
		$category = JRequest::getInt('id');
		$id = (int)$id;
		$user = JFactory::getUser();
		$aid = (int)$user->get('aid');
		$db = JFactory::getDBO();
		if (($root_id != 0) && ($level == 0))
		{
			$query = "SELECT * FROM #__k2_categories WHERE parent={$root_id} AND published=1 AND trash=0 ";
		}
		else
		{
			$query = "SELECT * FROM #__k2_categories WHERE parent={$id} AND published=1 AND trash=0 ";
		}

		if (K2_JVERSION != '15')
		{
			$query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
			if ($mainframe->getLanguageFilter())
			{
				$languageTag = JFactory::getLanguage()->getTag();
				$query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
			}
		}
		else
		{
			$query .= " AND access <= {$aid}";
		}

		$query .= " ORDER BY ordering";

		$db->setQuery($query);
		$rows = $db->loadObjectList();
		if ($db->getErrorNum())
		{
			echo $db->stderr();
			return false;
		}

		if ($level == 0)
		{
			echo '
<div class="k2CategorySelectBlock '.$params->get('moduleclass_sfx').'">
	<form action="'.JRoute::_('index.php').'" method="get">
		<label for="category" style="font-weight:bold;font-size:12pt">Resource Guides</label></br> <!-- 12-24-2014 JMEInc, MJM, added for Sec508 compliance -->
		<select name="category" id="category" onchange="window.location=this.form.category.value;">
			<option value="'.JURI::base(true).'/">'.JText::_('K2_SELECT_CATEGORY').'</option>
			';
		}
		$indent = "";
		for ($i = 0; $i < $level; $i++)
		{
			$indent .= '&ndash; ';
		}

		foreach ($rows as $row)
		{
			if (($option == 'com_k2') && ($category == $row->id))
			{
				$selected = ' selected="selected"';
			}
			else
			{
				$selected = '';
			}
			if (modK2ToolsHelper::hasChildren($row->id))
			{
				echo '<option value="'.urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($row->id.':'.urlencode($row->alias)))).'"'.$selected.'>'.$indent.$row->name.'</option>';
				modK2ToolsHelper::treeselectbox($params, $row->id, $level + 1);
			}
			else
			{
				echo '<option value="'.urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($row->id.':'.urlencode($row->alias)))).'"'.$selected.'>'.$indent.$row->name.'</option>';
			}
		}

		if ($level == 0)
		{

			echo '
			</select>
			<input name="option" value="com_k2" type="hidden" />
			<input name="test" value="test" type="test" />
			<input name="view" value="itemlist" type="hidden" />
			<input name="task" value="category" type="hidden" />
			<input name="Itemid" value="'.JRequest::getInt('Itemid').'" type="hidden" />';

			// For Joom!Fish compatibility
			if (JRequest::getCmd('lang'))
			{
				echo '<input name="lang" value="'.JRequest::getCmd('lang').'" type="hidden" />';
			}

			echo '
	</form>
</div>
			';

		}
	}
Last edit: 8 years 2 months ago by Luke. Reason: Added code for helper.php

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 2 months ago #151846 by Krikor Boghossian
Replied by Krikor Boghossian on topic Section 508 Compliance Labels for Select Menu
Try altering some other aspect eg, the CSS classes' name, is that change showing up in your site?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #151888 by Luke
Changing the class not does change any functionality of the page. I have, just out of curiosity, deleted the entire contents of the helper.php file, cleared cache for the website, cleared cache in my browser and then visited that page using private browsing and no changes were made, the select menu still functions as it did before removing all the code from the helper.php file.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 2 months ago #151898 by Krikor Boghossian
Replied by Krikor Boghossian on topic Section 508 Compliance Labels for Select Menu
I misread the URL,
This file cannot be overriden,
html/templates/goodwillmidmichigan/html/mod_k2_tools/helper.php

Unfortunately you have to edit the core file.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #151900 by Luke
Okay, thank you!

I found the core file and added my changes to it and it worked! :-)

Would there be any documentation that I am missing that would have told me that this file was not able to be overrode?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 2 months ago #151914 by Krikor Boghossian
Replied by Krikor Boghossian on topic Section 508 Compliance Labels for Select Menu
Actually only the files inside the /tmpl folders are overridable.
The folder for K2's subtemplate files is /templates/TEMPLATE_NAME

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum