<?php $post = new stdClass(); $post->postBody = ''; $post->postTitle = ''; $post->slug = ''; if ($id) { $post = db_select('post', 'p')->where()->condition('postId', $id)->getSingleResult(); if ($post) { $post = _getTranslationStrings($post, array('postTitle', 'postBody'), $lang); } else { _redirect('admin/property/list'); } } $condition = array('deleted' => null); if ($id) { $condition[] = db_and(array('catId' => $post->catId, 'deleted !=' => null)); } $categories = db_select('category')->orWhere($condition)->orderBy('catName')->getResult();
<label><?php echo _t('Category') . $lc_reqSign; ?> </label> <div> <select name="cboCategory" class="<?php echo $lang; ?> "> <option value=""><?php echo _t('Select Category'); ?> </option> <?php foreach ($categories as $category) { $category = _getTranslationStrings($category, 'catName', $lang); $selected = $category->catId == $post->catId ? 'selected="selected"' : ''; ?> <option value="<?php echo $category->catId; ?> " <?php echo $selected; ?> ><?php echo $category->catName_i18n; ?> </option> <?php } ?>
<?php } ?> </td> <?php } ?> <?php } ?> </tr> <?php while ($row = $qb->fetchRow()) { $data = array('catId' => $row->catId, 'catName' => $row->catName); # Get translations for other languages $i18n = (array) _getTranslationStrings($row, 'catName'); $data = array_merge($data, $i18n); ?> <tr id="row-<?php echo $row->catId; ?> "> <td class="tableLeft colAction"> <span class="row-data" style="display:none"><?php echo json_encode($data); ?> </span> <a href="javascript:" class="edit" title="Edit" onclick="LC.Page.Category.edit(<?php echo $row->catId; ?> )">