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
if (!$modx->resource) { | |
$modx->resource = $modx->newObject('modResource'); | |
$modx->resource->set('id', 5); | |
$modx->resource->set('pagetitle', 'isAPI'); | |
$modx->resource->set('content', $modx->getChunk('Film.Search.Results')); | |
} | |
$modx->getResponse(); | |
$modx->response->outputContent(); |
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
$source = modMediaSource::getDefaultSource($modx); | |
$source->initialize(); | |
$success = $source->uploadObjectsToContainer($path,$_FILES); |
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
// ==UserScript== | |
// @name Twitter Styles | |
// @namespace twitter | |
// @include https://twitter.com* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
document.getElementsByTagName('head')[0].innerHTML += "<style>.content-main{width:880px;}.wrapper,.wrapper-narrow{width:1190px;}.nav > li{color:#CCCCCC;}.global-nav-inner{background:none repeat scroll 0 0 #333;}.content-header .header-inner,.content-no-header .no-header-inner{padding:2px 15px;}.content-header .header-inner h2{font-size:15px;}.stats > li > a *{color:#444444;font-size:17px;}.profile-card.profile-header{margin-right: 145px;}</style>"; |
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 | |
$forms = explode(',', $scriptProperties['forms']); | |
$n = $scriptProperties['count']; | |
if (count($forms) < 3) return; | |
if (($n % 10 == 1) && ($n % 100 != 11)) { | |
$return = $forms[0]; | |
} elseif (($n % 10 >= 2) && ($n %10 <= 4) && ($n % 100 < 10 || $n % 100 >= 20)) { | |
$return = $forms[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
<?php | |
if (!$modx->user->isAuthenticated('mgr')) return; | |
$placeholders = $prefix ? array() : $modx->placeholders; | |
if ($prefix) { | |
foreach ($modx->placeholders as $key => $ph) { | |
if (strpos($key, $prefix) === 0) { | |
$placeholders[$key] = $ph; | |
} |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta name="viewport" content="width=device-width" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Really Simple HTML Email Template</title> | |
<style> | |
/* ------------------------------------- | |
GLOBAL | |
------------------------------------- */ |
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 | |
// change: | |
/* handle file fields */ | |
foreach ($origFields as $k => $v) { | |
$attachmentIndex = 0; | |
if (is_array($v) && !empty($v['tmp_name']) && isset($v['error']) && $v['error'] == UPLOAD_ERR_OK) { | |
if (empty($v['name'])) { | |
$v['name'] = 'attachment'.$attachmentIndex; | |
} | |
$this->modx->mail->mailer->AddAttachment($v['tmp_name'],$v['name'],'base64',!empty($v['type']) ? $v['type'] : 'application/octet-stream'); |
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 | |
if (($validator->required($param, $validator->fields[$param]) === true) || ($validator->required($key, $value) === true)) | |
{ | |
return true; | |
} | |
$validator->addError($key,'Почта и телефон пусты'); | |
return false; | |
/* |
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 | |
switch ($modx->event->name) { | |
case 'OnDocFormRender': | |
if (!isset($_GET['template'])) { | |
$parent = isset($_GET['parent']) ? intval($_GET['parent']) : 0; | |
$templates = array(1 => 4, 6 => 13, 8 => 6, 5 => 6, 4 => 15, 7 => 11, 17 => array(16, 17)); | |
if (isset($templates[$parent])) { | |
$template = $templates[$parent]; | |
if (is_array($template)) { |
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 | |
class msOrderByPhoneHandler extends msOrderHandler { | |
public function getCustomerId() { | |
$order = $this->ms2->order->get(); | |
if (empty($order['phone'])) {return false;} | |
if ($this->modx->user->isAuthenticated()) { | |
$profile = $this->modx->user->Profile; |
NewerOlder