/**
  * Return a list of all plugins for a given object ID
  *
  * @param integer $objectID the object ID to get plugins (if none set : all plugins)
  * @return array(int objectID => CMS_poly_plugin_definitions)
  * @access public
  * @static
  */
 static function getAllPluginDefinitionsForObject($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_plugin_definition";
     if ($objectID) {
         $sql .= "\n\t\t\t\twhere\n\t\t\t\t\tobject_id_mowd='" . sensitiveIO::sanitizeSQLString($objectID) . "'\n\t\t\t";
     }
     $q = new CMS_query($sql);
     $results = array();
     while ($r = $q->getArray()) {
         $object = new CMS_poly_plugin_definitions($r["id_mowd"], $r);
         $results[$object->getID()] = $object;
     }
     return $results;
 }
示例#2
0
    if ($object->getID()) {
        $content .= '
		<dialog-title type="admin_h2">' . $cms_language->getMessage(MESSAGE_PAGE_PLUGIN_DEFINITIONS, false, MOD_POLYMOD_CODENAME) . ' :</dialog-title>
		<br />';
        if (sizeof($pluginDefinitions)) {
            $content .= '<table border="0" cellpadding="2" cellspacing="2">
			<tr>
				<th class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_TITLE) . '</th>
				<th class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_DESCRIPTION) . '</th>
				<th class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_ACTIONS) . '</th>
			</tr>';
            $copunt = 0;
            foreach ($pluginDefinitions as $pluginDefinition) {
                $count++;
                $td_class = $count % 2 == 0 ? "admin_lightgreybg" : "admin_darkgreybg";
                $content .= '<tr alt="ID : ' . $pluginDefinition->getID() . '" title="ID : ' . $pluginDefinition->getID() . '">
					<td class="' . $td_class . '">' . $pluginDefinition->getLabel($cms_language) . '</td>
					<td class="' . $td_class . '">' . $pluginDefinition->getDescription($cms_language) . '</td>
					<td class="' . $td_class . '">
						<table border="0" cellpadding="2" cellspacing="0">
							<tr>';
                $canBeDeleted = true;
                if ($canBeDeleted) {
                    $content .= '
								<form action="' . $_SERVER["SCRIPT_NAME"] . '" method="post" onSubmit="return confirm(\'' . addslashes($cms_language->getMessage(MESSAGE_PAGE_ACTION_DELETEPLUGINCONFIRM, array($pluginDefinition->getLabel($cms_language)), MOD_POLYMOD_CODENAME)) . ' ?\')">
								<input type="hidden" name="cms_action" value="deletePlugin" />
								<input type="hidden" name="pluginDefinition" value="' . $pluginDefinition->getID() . '" />
								<input type="hidden" name="moduleCodename" value="' . $moduleCodename . '" />
								<input type="hidden" name="object" value="' . $object->getID() . '" />
									<td class="admin"><input type="submit" class="admin_input_' . $td_class . '" value="' . $cms_language->getMessage(MESSAGE_PAGE_ACTION_DELETE) . '" /></td>
								</form>';
    $dialog->addStopTab();
    $stopTab = ' onkeydown="return catchTab(this,event)"';
}
if ($cms_message) {
    $dialog->setActionMessage($cms_message);
}
$searchParameters = $object->getHTMLSubFieldsParametersSearch($cms_language, '', $pluginDefinition->getValue("query"));
//Definition
$definition = $_POST["definition"] ? $_POST["definition"] : $polymod->convertDefinitionString($pluginDefinition->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="pluginDefinition" value="' . $pluginDefinition->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_OBJECT_PARAMETERS, false, MOD_POLYMOD_CODENAME) . '</td>
			<td class="admin">' . $searchParameters . '</td>
		</tr>
		<tr>
			<td class="admin" align="right" valign="top"><span class="admin_text_alert">*</span> ' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_DEFINITION) . '</td>
			<td class="admin">