コード例 #1
0
ファイル: dmFrontTestFunctional.php プロジェクト: jdart/diem
 public function addWidget(DmZone $zone, $moduleAction)
 {
     list($module, $action) = explode('/', $moduleAction);
     $this->info('Add a ' . $moduleAction . ' widget')->get(sprintf('/index.php/+/dmWidget/add?to_dm_zone=%d&mod=' . $module . '&act=' . $action . '&dm_cpi=%d', $zone->id, $this->getPage()->id))->checks(array('module_action' => 'dmWidget/add', 'method' => 'get'))->has('.dm_widget.' . str_replace('dm_widget_', '', dmString::underscore($module)) . '.' . dmString::underscore($action));
     $zone->refreshRelated('Widgets');
     return $this;
 }
コード例 #2
0
 public function createInZone(DmZone $zone, $moduleAction, $values = array())
 {
     list($module, $action) = explode('/', $moduleAction);
     $widget = $this->create(array('dm_zone_id' => $zone->get('id'), 'module' => $module, 'action' => $action));
     $widget->setValues($values);
     return $widget;
 }
コード例 #3
0
 public function paste(DmZone $zone)
 {
     if (!($widget = $this->getWidget())) {
         return;
     }
     if ('cut' == $this->getMethod()) {
         $widget->set('dm_zone_id', $zone->get('id'));
         // cutted then pasted widget becomes copied widget
         $this->save('widget', array('method' => 'copy', 'id' => $widget->id));
     } else {
         $widget->get('Translation');
         $widget = $widget->copy(true);
         $widget->set('dm_zone_id', $zone->get('id'));
     }
     $widget->save();
     return $widget;
 }