value="<?php echo $value; ?> "><?php echo $typeName; ?> </option> <?php } ?> </select> </div> <div class="hr"></div> <?php foreach (Constants::GetLngArray() as $label => $lng) { ?> <label class="top-field-label">Название <?php echo $label; ?> :</label> <div class="field-container-long"><input type="text" name="name[<?php echo $lng; ?> ]" class="input-main float-left" value="<?php echo $item->getLngObject($lng)->name; ?> "></div> <?php } ?>
<div class="field-container-long"><input type="text" name="word[<?php echo $lng; ?> ]" class="input-main float-left" value="<?php echo $item->getWordByLng($lng); ?> "></div> <?php } ?> <div class="hr"></div> <?php } else { ?> <?php foreach (Constants::GetLngArray() as $indexLng => $lng) { ?> <label class="top-field-label"><?php echo $indexLng; ?> :</label> <div class="field-container-long"><input type="text" name="word[<?php echo $lng; ?> ]" class="input-main float-left" value=""></div> <?php } ?> <div class="hr"></div> <?php }
<?php foreach ($words as $word) { ?> <tr> <td class="td-tbl-clr"><?php echo $word->id; ?> </td> <td class="td-tbl-clr"><?php echo $word->label; ?> </td> <?php foreach (Constants::GetLngArray() as $lngIndex => $lng) { ?> <td class="td-tbl-clr"><?php echo $word->getWordByLng($lng); ?> </td> <?php } ?> <td class="td-tbl-clr" style="text-align:center;"> <?php echo CHtml::link("Удалить", '/admin/lmt/transdel/id/' . $word->id, array('class' => 'button delete-lnk del-link', 'title' => 'удалить')); ?> <?php echo CHtml::link("Изменить", '/admin/lmt/transedit/id/' . $word->id, array('class' => 'button edit-lnk', 'title' => 'редактировать'));
public static function getTranslationFromWordOnSomeLng($str, $toLng) { /* @var $lng TranslationLng */ /* @var $word Translation */ /* @var $neededWord Translation */ $ret = ""; $neededWord = null; $allWords = Translation::model()->findAll(); foreach ($allWords as $word) { foreach (Constants::GetLngArray() as $lngIndex => $lng) { $strWord = $word->getWordByLng($lng); if ($str == $strWord) { $neededWord = $word; } } } if ($neededWord != null) { $ret = $neededWord->getWordByLng($toLng); } else { $ret = $str; } return $ret; }
public function actionUpdateContacts() { /* @var $contacts LuxContactInfo */ /* @var $contactsLng LuxContactInfoLng */ $id = Yii::app()->request->getParam('id', null); $label = Yii::app()->request->getParam('label', null); $email_1 = Yii::app()->request->getParam('email_1', null); $phone_1 = Yii::app()->request->getParam('phone_1', null); $phone_2 = Yii::app()->request->getParam('phone_2', null); $email_admin = Yii::app()->request->getParam('email_admin', null); $map_link = Yii::app()->request->getParam('map_link', null); $small_text_lng = Yii::app()->request->getParam('info', array()); $subject_lng = Yii::app()->request->getParam('subject', array()); $title_lng = Yii::app()->request->getParam('title', array()); $contacts = LuxContactInfo::model()->findByPk($id); if ($contacts == null) { $contacts = new LuxContactInfo(); } $contacts->email_1 = $email_1; $contacts->phone_1 = $phone_1; $contacts->phone_2 = $phone_2; $contacts->administrator_email = $email_admin; $contacts->map_link = $map_link; $contacts->label = $label; $old_f_name = $contacts->map_image; $new_f_name = DwHelper::uploadPicAndGetPath($_FILES, 'map_img', $old_f_name); if ($new_f_name != "") { $contacts->map_image = $new_f_name; } if ($contacts->isNewRecord) { $contacts->save(); } else { $contacts->update(); } foreach (Constants::GetLngArray() as $lng) { $contactsLng = $contacts->getLngObject($lng); $contactsLng->small_text = $small_text_lng[$lng]; $contactsLng->feedback_subject = $subject_lng[$lng]; $contactsLng->text = $title_lng[$lng]; if ($contactsLng->isNewRecord) { $contactsLng->save(); } else { $contactsLng->update(); } } $this->redirect($this->createUrl('/admin/inlux/contacts')); }
public function run() { //render top menu widget $this->render('languages', array('languages' => Constants::GetLngArray())); }
public function actionUpdateContacts() { /* @var $contacts LmtContactInfo */ /* @var $contactsLng LmtContactInfoLng */ $id = Yii::app()->request->getParam('id', null); $email_1 = Yii::app()->request->getParam('email_1', null); $phone_1 = Yii::app()->request->getParam('phone_1', null); $phone_2 = Yii::app()->request->getParam('phone_2', null); $email_admin = Yii::app()->request->getParam('email_admin', null); $small_text_lng = Yii::app()->request->getParam('info', array()); $subject_lng = Yii::app()->request->getParam('subject', array()); $contacts = LmtContactInfo::model()->findByPk($id); if ($contacts == null) { $contacts = new LmtContactInfo(); } $contacts->email_1 = $email_1; $contacts->phone_1 = $phone_1; $contacts->phone_2 = $phone_2; $contacts->administrator_email = $email_admin; if ($contacts->isNewRecord) { $contacts->save(); } else { $contacts->update(); } foreach (Constants::GetLngArray() as $lng) { $contactsLng = $contacts->getLngObject($lng); $contactsLng->small_text = $small_text_lng[$lng]; $contactsLng->feedback_subject = $subject_lng[$lng]; if ($contactsLng->isNewRecord) { $contactsLng->save(); } else { $contactsLng->update(); } } $this->redirect($this->createUrl('/admin/lmt/contacts')); }