Exemplo n.º 1
0
 /**
  * Get array of configured content templates for a given moel name
  *
  * @param string $model
  * @return array $contentTemplates
  */
 public function getContentTemplates($model)
 {
     return sfSympalConfig::getDeep('content_types', $model, 'content_templates', array());
 }
Exemplo n.º 2
0
 /**
  * Takes in the raw array of options, parses those options, and combines
  * them with global options
  * 
  * @param mixed $slot The name of the slot or the slot itself
  * @param array $options 
  */
 protected function _configure($slot, $content, $options)
 {
     $this->setContent($content);
     $this->_options = $options;
     // determine the name of the slot
     $name = $slot instanceof sfSympalContentSlot ? $slot->name : $slot;
     /*
      * Priority of options is as follows (most important to least important)
      *   1) Any option passed in from the template
      *   2) Any option defined on the content type
      *   3) Any option defined on the slot type
      */
     // merge in options for this slot that may appear under this content type
     $contentTypeSlotOptions = sfSympalConfig::getDeep('content_types', $this->_content->Type->name, 'content_slots', array());
     if (isset($contentTypeSlotOptions[$name])) {
         $this->_options = array_merge($contentTypeSlotOptions[$name], $this->_options);
     }
     // Gets or creates the slot
     $this->_configureSlot($slot);
     // Merge in the #3 from the above priority list
     $slotOptions = sfSympalConfig::get('content_slot_types', $this->_slot->type, array());
     $this->_options = array_merge($slotOptions, $this->_options);
 }