コード例 #1
0
ファイル: tokens.php プロジェクト: retrorism/exchange-plugin
function exchange_build_token_form_cta($pr_obj, $type)
{
    $block = $pr_obj->create_token_form_cta($type);
    if ($block instanceof BasePattern) {
        $griditem = new GridItem($block, 'token', $grid_mods);
        $griditem->publish();
    }
}
コード例 #2
0
 public function populateCell(GridItem $item, $componentId, Model $model)
 {
     $callable = $this->callback;
     $component = $callable($componentId, $model);
     if ($component == null || !$component instanceof Component || $component->getId() != $componentId) {
         throw new \IllegalStateException('Callback for CallbackColumn is expected to return a componet with the given id');
     }
     $item->add($component);
 }
コード例 #3
0
 /**
  * @todo this should get the property via a resolver helper
  * @param GridItem $item
  * @param type $componentId
  * @param Model $model 
  */
 public function populateCell(GridItem $item, $componentId, Model $model)
 {
     $property = $this->propertyName;
     $value = PropertyResolver::get($model->getModelObject(), $property);
     $item->add(new Label($componentId, new BasicModel($value)));
 }
コード例 #4
0
 protected function populateItem(GridItem $item)
 {
     $column = $this->columns[$item->getColumnIndex()];
     $column->populateCell($item, $this->valueId, $item->getModel());
 }
コード例 #5
0
 public function publish_collab_files($context = '')
 {
     if (!$this->has_files) {
         return;
     }
     $doc_block_input = array('add_file' => array());
     foreach ($this->files as $file) {
         $doc_block_input['add_file'][] = array('file' => $file);
     }
     $doc_block = BasePattern::pattern_factory($doc_block_input, 'uploaded_files', 'collaboration', true);
     if ($doc_block instanceof Documentblock) {
         $grid_mods = array('type' => 'documentblock');
         $griditem = new GridItem($doc_block, 'collaboration', $grid_mods);
         $griditem->publish();
     }
 }