This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//add this function to Wordpress theme function.php file | |
function loadBootstrap() { | |
wp_register_script( 'bootstrap-js', 'http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js', array('jquery'), NULL, true ); | |
wp_register_style( 'bootstrap-css', 'http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css', false, NULL, 'all' ); | |
wp_enqueue_script( 'bootstrap-js' ); | |
wp_enqueue_style( 'bootstrap-css' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$doc = JFactory::getDocument(); | |
unset($doc->_scripts[JURI::root(true).'/media/jui/js/jquery.min.js']); | |
unset($doc->_scripts[JURI::root(true).'/media/jui/js/bootstrap.min.js']); | |
unset($doc->_scripts[JURI::root(true).'/media/jui/js/jquery-migrate.min.js']); | |
unset($doc->_styleSheets[JURI::root(true).'/media/jui/css/bootstrap.min.css']); | |
unset($doc->_styleSheets[JURI::root(true).'/media/jui/css/bootstrap-responsive.min.css']); | |
unset($doc->_styleSheets[JURI::root(true).'/media/jui/css/bootstrap-extended.css']); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#set variable from view | |
$this->form->setValue('image_name', null, $this->item->image); | |
#update dropdown | |
$('selector').val('value').trigger("liszt:updated"); | |
#call any model from any component , any location | |
JModelLegacy::addIncludePath (JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_component' . DIRECTORY_SEPARATOR . 'models'); | |
#add jtable if needs to call core functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get age to current date | |
select timestampdiff(YEAR, dob, curdate()) AS age from table name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$name = "aaa bbb ccc ddd"; | |
$parts = explode(" ", $name); | |
$lastname = array_pop($parts); | |
$firstname = implode(" ", $parts); | |
echo "Lastname: $lastname"; | |
echo "Firstname: $firstname"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Joomla.Platform | |
* @subpackage Form | |
* | |
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE | |
*/ | |
defined('JPATH_PLATFORM') or die; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<field name="customer_name" label="Customer Name" description="Name of the customer" | |
type="text" | |
maxlength="10" | |
class="input-xxlarge input-large-text disabled_field" | |
tabindex="1" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You will usually want to associate modules with articles in some way. The modules are allocated to module positions and the module positions appear somewhere on the Web page as determined by the template. However, it is sometimes useful to have a module actually embedded within the article. Joomla core provides two ways to do that: loadposition and loadmodule. | |
Syntax: | |
{loadposition position[, style]} | |
{loadmodule module[, title[, style]]} | |
loadposition | |
To insert a module inside an article, you publish the module to a position and load that position in the article as follows: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{HTTP_REFERER} !^$ | |
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC] | |
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/angryman.gif [R,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//add this function to your page | |
//after creation of file run the function in order to change the permission | |
function insertPermission($service, $fileId, $value, $type, $role) { | |
$newPermission = new Google_Service_Drive_Permission(); | |
$newPermission->setValue($value); | |
$newPermission->setType($type); | |
$newPermission->setRole($role); | |
try { |
OlderNewer