/** * Return a list of all RSS for a given object ID * * @param integer $objectID the object ID to get rss (if none set : all rss) * @return array(int objectID => CMS_poly_rss_definitions) * @access public * @static */ static function getAllRSSDefinitionsForObject($objectID = false) { if ($objectID && !sensitiveIO::isPositiveInteger($objectID)) { CMS_grandFather::raiseError("objectID is not a positive integer : " . $objectID); return false; } $sql = "select\n\t\t\t\t\t*\n\t\t\t\tfrom\n\t\t\t\t\tmod_object_rss_definition"; if ($objectID) { $sql .= "\n\t\t\t\twhere\n\t\t\t\t\tobject_id_mord='" . sensitiveIO::sanitizeSQLString($objectID) . "'\n\t\t\t"; } $q = new CMS_query($sql); $results = array(); while ($r = $q->getArray()) { $object = new CMS_poly_rss_definitions($r["id_mord"], $r); $results[$object->getID()] = $object; } return $results; }
/** * Return given RSS feed informations * * @param array $values : parameters values array(parameterName => parameterValue) in : * selected : the selected rss ID * @param multidimentionnal array $tags : xml2Array content of atm-function tag * ... {url} ... {label} ... {description} ... * @return string : the RSS feed informations * @access public */ function rss($values, $tags) { global $cms_language; if (!sensitiveIO::isPositiveInteger($values['selected'])) { $this->raiseError("Selected value parameter must be a valid RSS Feed ID : " . $values['selected']); return false; } $RSSDefinition = new CMS_poly_rss_definitions($values['selected']); if ($RSSDefinition->hasError()) { $this->raiseError("Selected value parameter must be a valid RSS Feed ID : " . $values['selected']); return false; } $linkParameters = ''; if (sizeof($values) > 1) { foreach ($values as $key => $value) { if ($key != 'selected') { $linkParameters .= '&' . $key . '=' . io::htmlspecialchars($value); } } } $replace = array('{url}' => PATH_REALROOT_WR . '/rss/rss' . (!STRIP_PHP_EXTENSION ? '.php' : '') . '?id=' . $RSSDefinition->getID() . $linkParameters, '{label}' => $RSSDefinition->getLabel($cms_language), '{description}' => $RSSDefinition->getDescription($cms_language)); $xml2Array = new CMS_xml2Array($tags); $return = $xml2Array->toXML($tags); $return = str_replace(array_keys($replace), $replace, $return); return $return; }
if (!$updateFrequency) { $updateFrequency = 1; } $updateList = ''; foreach ($baseListLabels as $key => $listLabel) { $updateList .= '<option value="' . $key . '"' . ($key == $selectedBaseList ? ' selected="selected"' : '') . '>' . $cms_language->getMessage($listLabel, false, MOD_POLYMOD_CODENAME) . '</option>'; } //Definition $definition = $_POST["definition"] ? $_POST["definition"] : $polymod->convertDefinitionString($RSSDefinition->getValue("definition"), true); $content = ' <table width="80%" border="0" cellpadding="3" cellspacing="2"> <form name="frm" action="' . $_SERVER["SCRIPT_NAME"] . '" method="post"> <input type="hidden" id="cms_action" name="cms_action" value="validate" /> <input type="hidden" name="moduleCodename" value="' . $moduleCodename . '" /> <input type="hidden" name="object" value="' . $object->getID() . '" /> <input type="hidden" name="RSSDefinition" value="' . $RSSDefinition->getID() . '" /> <tr> <td class="admin" align="right" valign="top"><span class="admin_text_alert">*</span> ' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_TITLE) . '</td> <td class="admin" width="80%">' . $label->getHTMLAdmin('label') . '</td> </tr> <tr> <td class="admin" align="right" valign="top" nowrap="nowrap"><span class="admin_text_alert">*</span> ' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_DESCRIPTION) . '</td> <td class="admin" width="80%">' . $description->getHTMLAdmin('description', true) . '</td> </tr> <tr> <td class="admin" align="right" valign="top">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_LINK, false, MOD_POLYMOD_CODENAME) . '</td> <td class="admin" width="80%"><input type="text" class="admin_input_long_text" name="link" value="' . $RSSDefinition->getValue('link') . '" /><br /><small>(' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_LINK_EXPLANATION, array(CMS_websitesCatalog::getMainURL()), MOD_POLYMOD_CODENAME) . ')</small></td> </tr> <tr> <td class="admin" align="right" valign="top">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_AUTHOR, false, MOD_POLYMOD_CODENAME) . '</td> <td class="admin" width="80%"><input type="text" class="admin_input_long_text" name="author" value="' . $RSSDefinition->getValue('author') . '" /></td>