Ejemplo n.º 1
0
 /**
  *
  * @param object modx
  * @param array
  */
 function __construct(&$modx, &$config = array('markup' => array(), 'format' => 'both'))
 {
     $this->modx =& $modx;
     $this->config =& $config;
     $this->controllers = $this->loadActionMap();
     // reverse action map
     self::$cache_opts = array(xPDO::OPT_CACHE_KEY => self::CACHE_DIR);
 }
Ejemplo n.º 2
0
 $core_path = $modx->getOption('bloodline.core_path', '', MODX_CORE_PATH . 'components/bloodline/');
 require_once $core_path . 'model/bloodline/bloodline.class.php';
 $valid = true;
 $content = '';
 // If a specific element is defined, we override everything
 $config = array();
 $config['obj_id'] = isset($_GET['obj_id']) ? $_GET['obj_id'] : null;
 $config['field'] = isset($_GET['field']) ? $_GET['field'] : null;
 $config['type'] = isset($_GET['type']) ? $_GET['type'] : null;
 $hash = isset($_GET['hash']) ? $_GET['hash'] : null;
 $profile = isset($_GET['profile']) ? $_GET['profile'] : null;
 $config['markup'] = isset($_GET['markup']) ? $_GET['markup'] : array();
 $config['format'] = isset($_GET['format']) ? $_GET['format'] : 'both';
 // js|html|both
 $config['persist'] = array('BLOODLINE' => 1);
 $Bloodline = new Bloodline($modx, $config);
 // Gather info...
 $ctx = $modx->context->get('id') ? $modx->context->get('id') : 'web';
 $Bloodline->info('Context ' . $modx->context->get('key'), MODX_MANAGER_URL . "index.php?a=5&id=0&key={$ctx}");
 if (isset($modx->resource->Template)) {
     $Bloodline->info('Template ' . $modx->resource->Template->get('name') . ' (' . $modx->resource->Template->get('id') . ')', $Bloodline->get_mgr_url('template', $modx->resource->Template->get('id')));
 }
 $Bloodline->info('Resource ' . $modx->resource->get('pagetitle') . ' (' . $modx->resource->get('id') . ')', $Bloodline->get_mgr_url('resource', $modx->resource->get('id')));
 // Store this because $modx->resource may get overwritten...
 $Bloodline->resource = $modx->resource;
 // Here's where we drill down: we can only map tags in a few places (mostly chunks)
 if ($config['type']) {
     switch ($config['type']) {
         case 'tv':
             $content = $modx->resource->getTVValue($config['field']);
             break;