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
function declOfNum(number, titles) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
} | |
use: | |
declOfNum(count, ['найдена', 'найдено', 'найдены']); |
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 | |
/* | |
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP) | |
Author: _ck_ (with contributions by GK, stasilok, n1xim, pennedav, kabel) | |
Version: 0.2.0 | |
Free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
* revision history | |
0.2.0 0000-00-00 Updated page layout/styles and restructure code to be more MVC-like (kabel) | |
implemented HTTP Basic authentication (pennedav) |
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
// Event: OnManagerPageBeforeRender | |
$script = "<script> | |
DirectoryTreeHandleDrop = MODx.tree.Directory.prototype._handleDrop; | |
Ext.override(MODx.tree.Directory, { | |
_handleDrop:function(e){ | |
var dropNode = e.dropNode; | |
var targetParent = e.target; | |
if(dropNode.hasChildNodes()) return false; | |
return DirectoryTreeHandleDrop(e); |
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 | |
/** | |
* A custom FormIt hook for CSRF Protection | |
* | |
* Usage: | |
* Append this Plugin as PreHook and Hook | |
* | |
* [[!FormIt? | |
* &preHooks=`FormItCSRF` | |
* &hooks=`spam,FormItCSRF,email` |