Exemplo n.º 1
0
 public function getlist($param)
 {
     $this->criteria->addAscendingOrderByColumn(WebModulePeer::NAME);
     $modules = WebModulePeer::doSelect($this->criteria);
     $modulesOutput = array();
     foreach ($modules as $module) {
         $temp = array();
         $temp = $module->toArray();
         $temp['type'] = $module->getWebModuleType()->toArray();
         $modulesOutput[] = $temp;
     }
     $output = array('success' => 1, 'data' => $modulesOutput);
     $this->jsonwrapper->print_json($output);
 }
Exemplo n.º 2
0
function loadModule($initial, $param = null, $show_error = true)
{
    $criteria = new Criteria();
    $criteria->add(WebModulePeer::INITIAL, $initial, Criteria::EQUAL);
    $requestModule = WebModulePeer::doSelectOne($criteria);
    if ($requestModule) {
        $module = 'mod_' . $requestModule->getWebModuleType()->getInitial();
        include_component($module, 'run', array('module' => $requestModule, 'param' => $param, 'initial' => $initial));
        return true;
    } else {
        if ($show_error) {
            echo '<h3 class="exception">Module ' . $initial . ' not found</h3>';
        }
        return false;
    }
}
Exemplo n.º 3
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(WebModulePeer::ID, $pks, Criteria::IN);
         $objs = WebModulePeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Exemplo n.º 4
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = WebModulePeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setModuleTypeId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setInitial($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setName($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setClientId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setTemplateId($arr[$keys[5]]);
     }
 }
Exemplo n.º 5
0
 public function countWebModules($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseWebModulePeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(WebModulePeer::MODULE_TYPE_ID, $this->getId());
     return WebModulePeer::doCount($criteria, $distinct, $con);
 }