Skip to content

Instantly share code, notes, and snippets.

View phproberto's full-sized avatar

Roberto Segura phproberto

View GitHub Profile
@phproberto
phproberto / googlefont.php
Created June 16, 2012 01:01
Generate a JForm field list with all the fonts available in Google Web Fonts
<?php
defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
class JFormFieldGooglefont extends JFormFieldList {
@phproberto
phproberto / bshead.php
Created June 21, 2012 23:25
In extension parameters show a section header customized with bootstrap appearence. Based on K2 approach.
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.form.formfield');
class JFormFieldBshead extends JFormField {
var $type = 'bshead';
@phproberto
phproberto / multifont.php
Created June 26, 2012 02:34
Google font+variant joomla field
<?php
/**
* @copyright Copyright (C) 2012 Roberto Segura. All rights reserved.
* @license GNU General Public License version 3; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
@phproberto
phproberto / override_controllers_admin_AdminImportController.php
Created October 26, 2012 11:07
Prestashop importer override to update prices without losing product names
<?php
class AdminImportController extends AdminImportControllerCore
{
public function __construct()
{
parent::__construct();
}
@phproberto
phproberto / README.md
Created December 7, 2012 11:15
Trick to make com_taxonomy use content blog templates

Force com_taxonomy to use content category blog templates.

This method uses a hidden menu item to customize the com_taxonomy tag results.

Demo

You can see it in action in:

@phproberto
phproberto / overridable-media.md
Last active December 10, 2015 21:58
Joomla! overridable media cheatsheet
@phproberto
phproberto / examples.md
Last active December 11, 2015 14:38
Joomla! overridable asset loader

Joomla! overridable media asset loader

Asset loader based on @dongilbert asset loader ( https://gist.github.com/4205674 )

Stylesheets

ELHtml::asset('style.css');
@phproberto
phproberto / .gitconfig
Last active February 4, 2022 15:23
My git config file
[color]
status = auto
diff = auto
branch = auto
interactive = auto
ui = true
[alias]
amend = !"git commit --amend -C HEAD"
st = status
ci = commit
@phproberto
phproberto / plugin-parcheado.js
Last active December 16, 2015 16:59
Apaño para Ciro
(function($){
// AQUI TU CODIGO JS USANDO $
})(jQuery);
@phproberto
phproberto / sample.php
Last active December 17, 2015 12:39
Retrieve JForm post data with JInput
<?php
// Required objects
$input = JFactory::getApplication()->input;
// Get the form data
$formData = new JRegistry($input->get('jform', '', 'array'));
// Get any data being able to use default values
$id = $formData->get('id', 0);