コード例 #1
0
 /**
  *
  * @param unknown $value
  * @return string
  */
 public function prepareLink($value)
 {
     if (null === $this->prepareFilter) {
         $this->prepareFilter = new Prepare();
     }
     return $this->prepareFilter->filter($value) . '-' . time();
 }
コード例 #2
0
 /**
  * (non-PHPdoc)
  * 
  * @see \Zend\ServiceManager\FactoryInterface::createService()
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $worker = new Process($serviceLocator->get(static::MC_ENTITYMANAGER));
     $worker->setEntity(new WebFormsField());
     $formFactory = new Customer($worker);
     $decorators = $serviceLocator->get('contentinum_form_decorators');
     $formFactory->setDecorators($decorators->toArray());
     return $formFactory;
 }
コード例 #3
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         if (isset($datas['loginHomedir']) && strlen($datas['loginHomedir']) == 0) {
             unset($datas['loginHomedir']);
         }
         $datas['loginUsername'] = md5($datas['username']);
         $crypt = new Password();
         $datas['loginPassword'] = $crypt->encode($datas['loginPassword']);
         $datas['verify_string'] = $crypt->getSalt();
         parent::save($datas, $entity);
     } else {
         if (isset($datas['loginHomedir']) && strlen($datas['loginHomedir']) == 0) {
             unset($datas['loginHomedir']);
         }
         if (isset($datas['loginPassword']) && $datas['loginPassword'] > '0') {
             $crypt = new Password();
             $datas['loginPassword'] = $crypt->encode($datas['loginPassword']);
             $datas['verify_string'] = $crypt->getSalt();
         } else {
             unset($datas['loginPassword']);
         }
         $datas['loginUsername'] = md5($datas['username']);
         $msg = parent::save($datas, $entity, $stage, $id);
         return $msg;
     }
 }
コード例 #4
0
 /**
  *
  * @param array $params
  * @param string $posts
  */
 public function processRequest(array $params = null, $posts = null)
 {
     try {
         if (isset($posts['data']["groupName"])) {
             parent::save(array('groupName' => $posts['data']["groupName"], 'resource' => 'index'), $this->getEntity());
             $groupIdent = $this->getLastInsertId();
             $itemRang = 0;
             $date = date('Y-m-d H:i:s');
             $this->executeQuery("SET FOREIGN_KEY_CHECKS=0;");
             foreach ($posts['data']['files'] as $fileIdent) {
                 $itemRang++;
                 $result = $this->fetchRow("SELECT MAX(id) AS ident FROM web_media_categories;");
                 $ident = (int) $result['ident'];
                 $id = $ident + 1;
                 $insert = array('id' => $id, 'web_medias_id' => $fileIdent, 'web_mediagroup_id' => $groupIdent, 'parent_media_file' => '0', 'item_rang' => $itemRang, 'caption' => '', 'description' => '', 'media_link_url' => '', 'target_link' => '', 'resource' => 'index', 'alternate_download' => '0', 'alternate_linktitle' => '', 'alternate_labelname' => '', 'created_by' => $this->getUserIdent(), 'update_by' => $this->getUserIdent(), 'register_date' => $date, 'up_date' => $date);
                 $this->insertQuery('web_media_categories', $insert);
             }
             $this->executeQuery("SET FOREIGN_KEY_CHECKS=1;");
             return array('success' => true);
         } else {
             return array('error' => 'error');
         }
     } catch (\Exception $e) {
         return array('error' => $e->getMessage());
     }
 }
コード例 #5
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $ident = $this->fetchRow("SELECT * FROM mcevent_dates WHERE id = {$datas['mceventIdent']}");
         $configure = $this->fetchRow($this->queryString($ident['configure_id']));
         $datas['organizerIdent'] = $configure['organizer_id'];
         $datas['registerIdent'] = Id::get();
         if (strlen($datas['poststreet']) < 2) {
             $datas['poststreet'] = $datas['street'];
             $datas['postnumber'] = $datas['number'];
             $datas['postcity'] = $datas['city'];
             $datas['postzipcode'] = $datas['zipcode'];
         }
         parent::save($datas, $entity, $stage, $id);
         if ('1' === $datas['sendConfirm']) {
             return $this->sendmail($datas, $configure, $ident);
         }
     } else {
         parent::save($datas, $entity, $stage, $id);
         $ident = $this->fetchRow("SELECT * FROM mcevent_dates WHERE id = {$datas['mceventIdent']}");
         $configure = $this->fetchRow($this->queryString($ident['configure_id']));
         $datas['organizerIdent'] = $configure['organizer_id'];
         $datas['registerIdent'] = $entity->registerIdent;
         parent::save($datas, $entity, $stage, $id);
         if ('1' === $datas['sendConfirm']) {
             return $this->sendmail($datas, $configure, $ident);
         }
     }
 }
コード例 #6
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         if (isset($datas['furthernames']) && strlen($datas['furthernames']) > 0) {
             return array('error' => 'Sorry! ERROR!');
         } else {
             $conf = $this->fetchRow("SELECT * FROM web_guestbook_config WHERE id = 1;");
             $datas['com'] = strip_tags($datas['com']);
             $datas['com'] = str_replace("http://", "", $datas['com']);
             $datas['com'] = str_replace("https://", "", $datas['com']);
             if ('0' == $conf['mark_spam_first']) {
                 $datas['approved'] = 'publish';
                 $datas['checkout'] = 1;
             }
             parent::save($datas, $entity, $stage, $id);
             if ('1' == $conf['send_email']) {
                 $this->sendmail($datas, $conf);
             }
             return array('success' => 'Vielen Dank! Dein Eintrag wurde registriert und nach Prüfung freigeschaltet.');
         }
     } else {
         return array('error' => 'Sorry! Es gab einen Fehler Bitte probiere es später noch einmal!');
     }
 }
コード例 #7
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         parent::save($datas, $entity, $stage, $id);
     } else {
         parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #8
0
 /**
  * Update count user faild logins
  * @param array $user user identity
  * @param number $add
  */
 public function updateCountLogin($user, $add = 1)
 {
     if (1 === $add) {
         $update['tryLogin'] = $user['try_login'] + $add;
     } else {
         $update['tryLogin'] = 0;
     }
     parent::save($update, $this->find($user['id']), self::SAVE_UPDATE);
 }
コード例 #9
0
 /**
  * Prepare datas before save
  * Insert the category with the correct sequnce number in this group
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $datas['itemRang'] = $this->sequence('webGroupsId', $datas['webGroupsId'], 'itemRang') + 1;
         parent::save($datas, $entity, $stage, $id);
         return true;
     } else {
         parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #10
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $mcSerialize = new HandleSerializeDatabase();
     if (null === $entity->getPrimaryValue()) {
         $datas['settingsFormular'] = $mcSerialize->execSerialize($datas['settingsFormular']);
         parent::save($datas, $entity, $stage, $id);
     } else {
         $datas['settingsFormular'] = $mcSerialize->execSerialize($datas['settingsFormular']);
         parent::save($datas, $entity, $stage, $id);
     }
     unset($mcSerialize);
 }
コード例 #11
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $ident = $this->fetchRow("SELECT * FROM mcevent_dates WHERE id = {$datas['mceventIdent']}");
         $configure = $this->fetchRow($this->queryString($ident['configure_id']));
         $datas['organizerIdent'] = $configure['organizer_id'];
         $datas['registerIdent'] = Id::get();
         parent::save($datas, $entity, $stage, $id);
         return $this->sendmail($datas, $configure, $ident);
     }
 }
コード例 #12
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $datas['publish'] = 'yes';
         $datas['itemRang'] = $this->sequence('indexGroup', $datas['indexGroup'], 'itemRang') + 1;
         parent::save($datas, $entity);
     } else {
         $msg = parent::save($datas, $entity, $stage, $id);
         return $msg;
     }
 }
コード例 #13
0
 public function saveMetas($app, $datas)
 {
     $metas = array();
     foreach ($this->mediaAttributeFields as $field) {
         if (isset($datas[$field])) {
             $metas[$field] = $datas[$field];
         }
     }
     $mcSerialize = new HandleSerializeDatabase();
     $update['mediaMetas'] = $mcSerialize->execSerialize($metas);
     parent::save($update, $this->find($datas['ident']));
     return true;
 }
コード例 #14
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $datas['scope'] = '_link';
         $datas['onlylink'] = '1';
         $datas['parentPage'] = '0';
         $datas['publish'] = 'yes';
         return parent::save($datas, $entity);
     } else {
         return parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #15
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $datas['verifyString'] = Id::get();
         $datas['close'] = 'open';
         $datas['publish'] = 'yes';
         $datas['date'] = date('Y-m-d H:i:s');
         parent::save($datas, $entity, $stage, $id);
     } else {
         parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #16
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $filter = new Prepare();
         $datas['scope'] = $filter->filter($datas['name']);
         parent::save($datas, $entity, $stage, $id);
     } else {
         $filter = new Prepare();
         $datas['scope'] = $filter->filter($datas['name']);
         parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #17
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     if (null === $entity->getPrimaryValue()) {
         if (0 == $datas['account']) {
             $datas['account'] = 1;
         }
         parent::save($datas, $entity, $stage, $id);
     } else {
         if (0 == $datas['account']) {
             $datas['account'] = 1;
         }
         parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #18
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         if (strlen($datas['objectName']) < 1) {
             $datas['objectName'] = $datas['firstName'] . ' ' . $datas['lastName'];
         }
         $datas['publish'] = 'yes';
         parent::save($datas, $entity);
     } else {
         $msg = parent::save($datas, $entity, $stage, $id);
         return $msg;
     }
 }
コード例 #19
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $filter = new \ContentinumComponents\Filter\Url\Prepare();
         $datas['typescope'] = $filter->filter($datas['typescope']);
         unset($filter);
         parent::save($datas, $entity, $stage, $id);
     } else {
         $filter = new \ContentinumComponents\Filter\Url\Prepare();
         $datas['typescope'] = $filter->filter($datas['typescope']);
         unset($filter);
         parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #20
0
 /**
  *
  * @param array $params
  * @param string $posts
  */
 public function processRequest(array $params = null, $posts = null)
 {
     try {
         if (isset($posts['entity'])) {
             $this->setEntity($this->getSl()->get($posts['entity']));
             $id = $posts['ident'];
             parent::save(array('checkout' => '1', 'approved' => $posts['value']), $this->find($id), self::SAVE_UPDATE, $id);
             return array('success' => true);
         } else {
             return array('error' => 'miss_paramter');
         }
     } catch (\Exception $e) {
         return array('error' => $e->getMessage());
     }
 }
コード例 #21
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $filter = new Prepare();
         if (strlen($datas['optionValue']) === 0) {
             $datas['optionValue'] = $datas['optionLabel'];
         }
         $datas['optionValue'] = str_replace('-', '', $filter->filter($datas['optionValue']));
         unset($filter);
         parent::save($datas, $entity);
     } else {
         $msg = parent::save($datas, $entity, $stage, $id);
         return $msg;
     }
 }
コード例 #22
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $datas['tagGroup'] = 'newsblogstags';
         $filter = new Prepare();
         $datas['tagScope'] = $filter->filter($datas['tagName']);
         unset($filter);
         parent::save($datas, $entity, $stage, $id);
     } else {
         $filter = new Prepare();
         $datas['tagScope'] = $filter->filter($datas['tagName']);
         unset($filter);
         parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #23
0
 /**
  *
  * @param array $params
  * @param string $posts
  */
 public function processRequest(array $params = null, $posts = null)
 {
     if (is_array($posts)) {
         $params = array_merge($params, $posts);
     }
     try {
         if (isset($params['ident'])) {
             $id = $params['ident'];
             parent::save(array('tryLogin' => '0'), $this->find($id, true));
             return array('success' => 1);
         } else {
             return array('error' => 'miss_paramter');
         }
     } catch (\Exception $e) {
         return array('error' => $e->getMessage());
     }
 }
コード例 #24
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $datas['accountName'] = '';
         $filter = new Prepare();
         $datas['organisationScope'] = $filter->filter($datas['organisation']);
         unset($filter);
         $datas['accountId'] = Id::get();
         parent::save($datas, $entity, $stage, $id);
     } else {
         $filter = new Prepare();
         $datas['organisationScope'] = $filter->filter($datas['organisation']);
         unset($filter);
         parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #25
0
 /**
  * Prepare datas before save
  * Insert the category with the correct sequnce number in this group
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     if (isset($datas['id'])) {
         unset($datas['id']);
     }
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $datas['itemRang'] = $this->sequence('webMediagroupId', $datas['webMediagroupId'], 'itemRang') + 1;
         parent::save($datas, $entity, $stage, $id);
         $this->inUseMedia($datas['webMediasId'], $this->lastInsertId);
         return true;
     } else {
         $this->inUseMedia($entity->webMediasId->id, $entity->id, self::INUSE_GROUP, 'delete');
         //var_dump($datas);exit;
         parent::save($datas, $entity, $stage, $id);
         $this->inUseMedia($datas['webMediasId'], $entity->id);
     }
 }
コード例 #26
0
 /**
  * Prepare datas before save
  * decide is it a insert or update
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     if ('force' === $stage) {
         $entity = $this->handleEntity($entity);
         return parent::save($datas, $entity, self::SAVE_INSERT);
     }
     if (false !== ($result = $this->alreadyExists($datas['mediaSource'], $entity))) {
         $entity = $this->find($result, true);
     }
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $this->saveStatus = 'insert';
         return parent::save($datas, $entity, $stage, $id);
     } else {
         $this->saveStatus = 'update';
         if (isset($datas['mediaMetas'])) {
             unset($datas['mediaMetas']);
         }
         parent::save($datas, $entity, $stage, $id);
     }
 }
コード例 #27
0
 /**
  * Prepare datas before save
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     $entity = $this->handleEntity($entity);
     if (null === $entity->getPrimaryValue()) {
         $datas['publish'] = 'yes';
         $filter = new Prepare();
         if (!isset($datas['fieldName']) || strlen($datas['fieldName']) == 0) {
             $filter = new Prepare();
             $datas['fieldName'] = str_replace('-', '', $filter->filter($datas['label']));
         } else {
             $datas['fieldName'] = str_replace('-', '', $filter->filter($datas['fieldName']));
         }
         unset($filter);
         if (!isset($datas['fieldDomid']) || strlen($datas['fieldDomid']) == 0) {
             $datas['fieldDomid'] = $datas['fieldName'];
         }
         $datas['itemRang'] = $this->sequence('webForms', $datas['webForms'], 'itemRang') + 1;
         parent::save($datas, $entity);
     } else {
         $msg = parent::save($datas, $entity, $stage, $id);
         return $msg;
     }
 }
コード例 #28
0
 /**
  * Prepare datas before save
  * decide is it a insert or update
  *
  * @see \ContentinumComponents\Mapper\Process::save()
  */
 public function save($datas, $entity = null, $stage = '', $id = null)
 {
     foreach ($datas as $tagName) {
         $tagEntity = self::TAG_ENTITY;
         $entity = new $tagEntity();
         $entries = $this->fetchEntries($entity->getEntityName(), self::TAG_ENTITY_COL_NAME, $tagName);
         if (false === $entries) {
             $msg = parent::save(array(self::TAG_ENTITY_COL_NAME => $tagName, self::TAG_ENTITY_COL_GROUP => static::TAG_GROUP_VALUE), $entity);
             $lastInsertId = $this->getLastInsertId();
         } else {
             $lastInsertId = $entries[0]->id;
         }
         $this->assigsTags[$id][] = $lastInsertId;
     }
     if (!empty($this->assigsTags)) {
         $this->assigns($id);
     }
 }