Skip to content

Instantly share code, notes, and snippets.

@gartes
gartes / footer-webim.php
Last active May 6, 2018 03:26
ob_start буфер
@gartes
gartes / Exception - try throw new Exception die
Last active May 6, 2018 05:24
Exception Исключения
try {
$r = file_put_contents($save_to, $content);
if ( !$r ){
$error = 'Не удалось сохранить ресурс: '. $save_to ;
$error .='<br/> Проверьте на дступность директорий в пути.';
throw new Exception($error , 500 );
} #END IF
}catch ( Exception $e ) {
$msg = $e->getMessage(); // Returns "Normally you would have other code...
$code = $e->getCode(); // Returns '500';
@gartes
gartes / rwd.css
Created May 7, 2018 07:58 — forked from apzeero/rwd.css
CSS: Twitter Bootstrap Breakpoints
/* http://twitter.github.com/bootstrap/scaffolding.html#responsive */
/* Landscape phones and down */
@media (max-width: 480px) { ... }
/* Landscape phone to portrait tablet */
@media (max-width: 768px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 940px) { ... }
@gartes
gartes / VmConfig::loadConfig()
Last active June 3, 2018 01:34
Vm:class VmConfig Virtuemart
if (!class_exists( 'VmConfig' ))
require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();
@gartes
gartes / JProfiler::getInstance
Created May 7, 2018 18:08
JProfiler - time профелирование
private static $_Jpof ;
self::$_Jpof = \JProfiler::getInstance( 'View-VirtueMart' );
self::$_Jpof->mark('Start') ;
# add mark
self::$_Jpof->mark('Start - getChildCategoryList');
# add mark
self::$_Jpof->mark('End - getChildCategoryList');
@gartes
gartes / $app->enqueueMessage()
Last active July 13, 2018 11:38
JFactory::getApplication()
# https://docs.joomla.org/Display_error_messages_and_notices
// Get a handle to the Joomla! application object
$app = JFactory::getApplication();
// Add a message to the message queue
# message | notice | warning | error
$app->enqueueMessage(JText::_( 'TEXT_MESS' ), 'error');
// Получить из стека массив сообщений
@gartes
gartes / CSS
Last active May 12, 2018 12:28
Css символы
<!-- https://stackoverflow.com/questions/45611064/unicode-symbols-list-for-css-before-content -->
<!-- language: lang-css -->
body {font: normal 18px/27px menlo, monospace, sans-serif; color: #777;}
.unicode-list li {list-style: none; border-bottom: solid 1px #ccc;}
.link-list li {font: 300 16px/27px helvetica;}
:before {color: #A0002E; display: inline-block; font: normal 20px/20px helvetica; width: 30px; }
a {color: dodgerblue;}
.mail:before {content: "\2709";}
$basePath = VMPATH_MY_PLUGIN_GLAVPUNKT . DS . 'layouts' ;
$data = array('name' => 'Dmitry');
$layout = new JLayoutFile('glavpunkt.sspb', $basePath);
$html = $layout->render($data); // $displayData
@gartes
gartes / Системные события
Last active June 6, 2018 13:14
Joomla Events события
/*
* Это событие запускается после загрузки фрейма и вызывается метод инициализации приложения.
* @param - none
* @return - none
*/
onAfterInitialise
/*
* Событие перд установкой данных из кеша.
* Если какой либо плаг вернет FALSE - кеш игнорируеться.
@gartes
gartes / version.php
Last active May 19, 2018 11:00
Тест методов
/**
* /libraries/cms/version/version.php
* Sets the media version which is used to append to Joomla core media files.
*
* @param string $mediaVersion The media version.
*
* @return JVersion Instance of $this to allow chaining.
*
* @since 3.2
*/