public function getMetadataForColumn($sColumnIdentifier)
 {
     $aResult = array('is_sortable' => true);
     switch ($sColumnIdentifier) {
         case 'id':
             $aResult['heading'] = TranslationPeer::getString('wns.id');
             break;
         case 'subject':
             $aResult['heading'] = TranslationPeer::getString('wns.newsletter.subject');
             break;
         case 'language_id':
             $aResult['has_data'] = true;
             if (LanguageInputWidgetModule::isMonolingual()) {
                 $aResult['heading'] = TranslationPeer::getString('wns.language');
             } else {
                 $aResult['heading'] = '';
                 $aResult['heading_filter'] = array('language_input', $this->oLanguageFilter->getSessionKey());
             }
             $aResult['field_name'] = 'language_name';
             $aResult['is_sortable'] = false;
             break;
         case 'template_name':
             $aResult['heading'] = TranslationPeer::getString('wns.newsletter.template_name');
             break;
         case 'is_approved':
             $aResult['heading'] = TranslationPeer::getString('wns.newsletter.is_approved');
             break;
         case 'group_sent_to':
             $aResult['heading'] = TranslationPeer::getString('wns.newsletter.subscriber_groups_sent_to');
             break;
         case 'last_sent_localized':
             $aResult['heading'] = TranslationPeer::getString('wns.newsletter.last_sent');
             $aResult['is_sortable'] = false;
             break;
         case 'send_test':
             $aResult['field_name'] = 'play';
             $aResult['heading'] = TranslationPeer::getString('wns.newsletter.send_test');
             $aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_ICON;
             $aResult['is_sortable'] = false;
             break;
         case 'duplicate':
             $aResult['field_name'] = 'plus';
             $aResult['heading'] = TranslationPeer::getString('wns.newsletter.duplicate');
             $aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_ICON;
             $aResult['is_sortable'] = false;
             break;
         case 'delete':
             $aResult['field_name'] = 'trash';
             $aResult['heading'] = ' ';
             $aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_ICON;
             $aResult['is_sortable'] = false;
             break;
     }
     return $aResult;
 }
Exemplo n.º 2
0
 protected function createListWidget()
 {
     $oListWidget = new ListWidgetModule();
     $this->oDelegateProxy = new CriteriaListWidgetDelegate($this, "Link", "name_truncated", "asc");
     $oListWidget->setDelegate($this->oDelegateProxy);
     $oListWidget->setSetting('row_model_drag_and_drop_identifier', 'id');
     if (!LanguageInputWidgetModule::isMonolingual()) {
         $this->oLanguageFilter = WidgetModule::getWidget('language_input', null, true);
     }
     $this->oTagFilter = WidgetModule::getWidget('tag_input', null, true);
     $this->oTagFilter->setSetting('model_name', 'Link');
     return $oListWidget;
 }
 private function validate($aDocumentationData, $oDocumentation)
 {
     $oFlash = Flash::getFlash();
     $oFlash->setArrayToCheck($aDocumentationData);
     $oFlash->checkForValue('name', 'name_required');
     $oFlash->checkForValue('key', 'key_required');
     if (!LanguageInputWidgetModule::isMonolingual()) {
         $oDocumentation->setLanguageId($aDocumentationData['language_id']);
         $oFlash->checkForValue('language_id', 'language_required');
     } else {
         $oLanguage = LanguageQuery::create()->findOne();
         $oDocumentation->setLanguageId($oLanguage->getId());
     }
     $oCheckDocumentation = DocumentationQuery::create()->filterByLanguageId($oDocumentation->getLanguageId())->filterByKey($aDocumentationData['key'])->findOne();
     if ($oCheckDocumentation && !Util::equals($oDocumentation, $oCheckDocumentation)) {
         $oFlash->addMessage('documentation_unique_required');
     }
     $oFlash->finishReporting();
 }
Exemplo n.º 4
0
 public function getLanguageName()
 {
     return LanguageInputWidgetModule::getLanguageName($this->getLanguageId());
 }
Exemplo n.º 5
0
 /**
  * @deprecated moved to LanguageInputWidgetModule::isMonolingual(), is only used in admin context
  */
 public static function isMonolingual()
 {
     return LanguageInputWidgetModule::isMonolingual();
 }
Exemplo n.º 6
0
 public function getDescription($sLanguageId = null)
 {
     return TranslationPeer::getString('wns.model.description.language_object', $sLanguageId, $this->getId(), array('id' => $this->getId(), 'page' => Util::nameForObject($this->getContentObject()->getPage()), 'language' => LanguageInputWidgetModule::getLanguageName($this->getLanguageId()), 'type' => Module::getDisplayNameByTypeAndName('frontend', $this->getContentObject()->getObjectType())));
 }
Exemplo n.º 7
0
 public function getLanguageName($sLanguageId = null)
 {
     return LanguageInputWidgetModule::getLanguageName($this->getId(), $sLanguageId);
 }