Skip to content

Instantly share code, notes, and snippets.

View mabdelaziz77's full-sized avatar

Mohamed Abdelaziz mabdelaziz77

View GitHub Profile
@mabdelaziz77
mabdelaziz77 / siteview.defaulttmpl.html
Created April 7, 2021 08:22
Categorized recipes using JCB
<h2>Categoriezed Recipes</h2>
<?php foreach($this->categorizeditems as $category=>$items) :?>
<h3><?php echo $category; ?></h3>
<ul>
<?php foreach($items as $item) :?>
<li><?php echo $item->name; ?></li>
<?php endforeach; ?>
</ul>
<?php endforeach; ?>
@mabdelaziz77
mabdelaziz77 / heart.svg
Last active February 27, 2021 17:47
JCB Tutorials (7)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mabdelaziz77
mabdelaziz77 / default.php
Last active July 11, 2020 17:09
Recipe Manager Frontend Filters (Part 5)
<div id="recipe_filters">
<h3><?php echo JText::_('Preparing Time:'); ?></h3>
<?php echo $this->filters['from_prepartingtime'];?>
<?php echo $this->filters['to_prepartingtime'];?>
<br/>
<button type="submit" class="btn"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
</div>
<hr/>
$this->_item[$pk]->ingredientsList = $this->getIngredientsList($this->_item[$pk]->ingredients);
$canDo = [[[Component]]]Helper::getActions('recipe',$this->_item[$pk],'recipes');
if ($canDo->get('recipe.edit'))
{
$this->_item[$pk]->editLink = JRoute::_('index.php?option=com_[[[component]]]&view=recipe&task=recipe.edit&id=' . $this->_item[$pk]->id);
}
else
{
$this->_item[$pk]->editLink = null;
@mabdelaziz77
mabdelaziz77 / gist:0d54b96373566ede71305b0f61fadea5
Last active November 8, 2020 07:08
jQuery to display the igredient image as a bootstrap popover
jQuery(document).ready(function($){
$('#ingredientList tbody tr td:nth-child(5)').each(function(){
var imgPath = '<?php echo JURI::root(true) . "/";?>' + $(this).text();
$(this).html('<img rel="popover" src="'+ imgPath +'" width="30" data-img="'+ imgPath +'" />');
});
$('img[rel=popover]').popover({
html: true,
trigger: 'hover',
placement: 'bottom',
content: function(){return '<img src="'+$(this).data('img') + '" />';}
<?php
/**
* @version 2.6.x
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access