/** * The addictional attribute loader. It loads an attribute object from * database using the attribute name as search key * * @access public * @return Attribute the loaded attribute or false if sometring wrong. * @since 0.7 */ function loadAttribute($name) { jincimport('utility.servicelocator'); $servicelocator = ServiceLocator::getInstance(); $logger = $servicelocator->getLogger(); $query = 'SELECT id, description, type, table_name, name_i18n ' . 'FROM #__jinc_attribute ' . 'WHERE name = \'' . $name . '\''; $logger->debug('NewsletterFactory: Executing query: ' . $query); $dbo =& JFactory::getDBO(); $dbo->setQuery($query); // Loading newsletter information from database if ($result = $dbo->loadAssocList()) { if (empty($result)) { // Newsletter not found in database $logger->finer('NewsletterFactory: Attribute not found'); return false; } $attr = $result[0]; $attribute = new Attribute($attr['id']); $attribute->set('name', $name); $attribute->set('description', $attr['description']); $attribute->set('type', $attr['type']); $attribute->set('table_name', $attr['table_name']); $attribute->set('name_i18n', $attr['name_i18n']); return $attribute; } return false; }
</td> </tr> <?php $i++; } ?> <?php jincimport('frontend.jincinputstandard'); jincimport('frontend.jincinputminimal'); $renderer = $input_style == INPUT_STYLE_MINIMAL ? new JINCInputMinimal() : new JINCInputStandard(); $renderer->preRender(); if ($public) { $attribute = new Attribute(-1); $attribute->set('name', 'user_mail'); $attribute->set('type', ATTRIBUTE_TYPE_EMAIL); $attribute->set('name_i18n', 'COM_JINC_USERMAIL'); $renderer->modRender($attribute, TRUE); } foreach ($attributes as $attr_name => $attr_value) { $attr = $ninstance->loadAttribute($attr_name); $renderer->modRender($attr, $attr_value == ATTRIBUTE_MANDATORY); } ?> <?php if ($captcha) { $renderer->modCaptchaRender(); } ?>
/** * @param $name * @param null $value * @param int $expire * @param string $path * @param null $domain * @param bool $secure * @param bool $httpOnly * @return CookiesAttribute */ public function setCookie($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = false) { setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly); return parent::set($name, $value); }
/** * Return name * * @return string */ public function getName() { //$this->log_debug("At getName() in Candidate"); $name = $this->get("name"); if ($name) { return $name; } $first = $this->get("firstName"); $middle = $this->get("middleName"); $last = $this->get("lastName"); $name .= $first; if ($middle) { $name .= " {$middle}"; } if ($last) { $name .= " {$last}"; } $name_attr = $this->_fields["name"]; if (!$name_attr) { $name_attr = new Attribute(); $this->_fields["name"] = $name_attr; } $name_attr->set("value", $name); //parent::set("name",$name); //no re-setting sub-names return $name; }