Commit ed1a9cbf authored by Dries's avatar Dries

Patch by Al:

- Made the import module use theme_item_list() instead of emitting the HTML
  and CSS itself.

- Renamed the "blog-it" tag to "icon" so it can be used for other (but
  similar) purposes.
parent 514a1a96
......@@ -2,9 +2,9 @@
.item-list ul { margin: 0 0 0.75em 0; padding: 0; }
.item-list ul li { margin: 0 0 0.25em 1.5em; padding: 0; list-style: disc; }
.blog-it { color: #555; float: right; padding-left: 0.25em; }
.blog-it a { color: #000; text-decoration: none; }
.blog-it a:hover { color: #000; text-decoration: none; }
.item-list .icon { color: #555; float: right; padding-left: 0.25em; }
.item-list .icon a { color: #000; text-decoration: none; }
.item-list .icon a:hover { color: #000; text-decoration: none; }
.poll-foreground { background-color: #000; float: left; height: 1em; }
.poll-background { background-color: #ddd; float: left; height: 1em; }
......
......@@ -72,7 +72,7 @@ function import_format_item($item, $feed = 0) {
if ($user->uid && user_access("maintain personal blog")) {
// $output .= "&nbsp;". l("<img src=\"". theme("image", "blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", "node/add/blog&amp;iid=$item->iid", array("title" => t("Comment on this news item in your personal blog.")));
$output .= "<div class=\"blog-it\">(". l("b", "node/add/blog&amp;iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))) .")</div>";
$output .= "<div class=\"icon\">(". l("b", "node/add/blog&amp;iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))) .")</div>";
}
// external link
......@@ -90,22 +90,29 @@ function import_bundle_block($attributes) {
$result = db_query_range("SELECT * FROM item WHERE ". implode(" OR ", $where) ." ORDER BY iid DESC", 0, variable_get("import_block_limit", 15));
}
$output = "<div class=\"item-list\"><ul>";
$items = array();
while ($item = db_fetch_object($result)) {
$output .= "<li>". import_format_item($item) ."</li>";
$items[] = import_format_item($item);
}
$output .= "</ul></div>";
$output = "<div class=\"import-block\"><div class=\"bundle\">";
$output .= theme("theme_item_list", $items);
$output .= "</div></div>";
return $output;
}
function import_feed_block($feed) {
$result = db_query_range("SELECT * FROM item WHERE fid = %d ORDER BY iid DESC ", $feed->fid, 0, variable_get("import_block_limit", 15));
$output = "<div class=\"item-list\"><ul>";
$items = array();
while ($item = db_fetch_object($result)) {
$output .= "<li>". import_format_item($item) ."</li>";
$items[] = import_format_item($item);
}
$output .= "</ul></div>";
$output = "<div class=\"import-block\"><div class=\"feed\">";
$output .= theme("theme_item_list", $items);
$output .= "</div></div>";
return $output;
}
......
......@@ -72,7 +72,7 @@ function import_format_item($item, $feed = 0) {
if ($user->uid && user_access("maintain personal blog")) {
// $output .= "&nbsp;". l("<img src=\"". theme("image", "blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", "node/add/blog&amp;iid=$item->iid", array("title" => t("Comment on this news item in your personal blog.")));
$output .= "<div class=\"blog-it\">(". l("b", "node/add/blog&amp;iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))) .")</div>";
$output .= "<div class=\"icon\">(". l("b", "node/add/blog&amp;iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))) .")</div>";
}
// external link
......@@ -90,22 +90,29 @@ function import_bundle_block($attributes) {
$result = db_query_range("SELECT * FROM item WHERE ". implode(" OR ", $where) ." ORDER BY iid DESC", 0, variable_get("import_block_limit", 15));
}
$output = "<div class=\"item-list\"><ul>";
$items = array();
while ($item = db_fetch_object($result)) {
$output .= "<li>". import_format_item($item) ."</li>";
$items[] = import_format_item($item);
}
$output .= "</ul></div>";
$output = "<div class=\"import-block\"><div class=\"bundle\">";
$output .= theme("theme_item_list", $items);
$output .= "</div></div>";
return $output;
}
function import_feed_block($feed) {
$result = db_query_range("SELECT * FROM item WHERE fid = %d ORDER BY iid DESC ", $feed->fid, 0, variable_get("import_block_limit", 15));
$output = "<div class=\"item-list\"><ul>";
$items = array();
while ($item = db_fetch_object($result)) {
$output .= "<li>". import_format_item($item) ."</li>";
$items[] = import_format_item($item);
}
$output .= "</ul></div>";
$output = "<div class=\"import-block\"><div class=\"feed\">";
$output .= theme("theme_item_list", $items);
$output .= "</div></div>";
return $output;
}
......
......@@ -72,7 +72,7 @@ function import_format_item($item, $feed = 0) {
if ($user->uid && user_access("maintain personal blog")) {
// $output .= "&nbsp;". l("<img src=\"". theme("image", "blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", "node/add/blog&amp;iid=$item->iid", array("title" => t("Comment on this news item in your personal blog.")));
$output .= "<div class=\"blog-it\">(". l("b", "node/add/blog&amp;iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))) .")</div>";
$output .= "<div class=\"icon\">(". l("b", "node/add/blog&amp;iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))) .")</div>";
}
// external link
......@@ -90,22 +90,29 @@ function import_bundle_block($attributes) {
$result = db_query_range("SELECT * FROM item WHERE ". implode(" OR ", $where) ." ORDER BY iid DESC", 0, variable_get("import_block_limit", 15));
}
$output = "<div class=\"item-list\"><ul>";
$items = array();
while ($item = db_fetch_object($result)) {
$output .= "<li>". import_format_item($item) ."</li>";
$items[] = import_format_item($item);
}
$output .= "</ul></div>";
$output = "<div class=\"import-block\"><div class=\"bundle\">";
$output .= theme("theme_item_list", $items);
$output .= "</div></div>";
return $output;
}
function import_feed_block($feed) {
$result = db_query_range("SELECT * FROM item WHERE fid = %d ORDER BY iid DESC ", $feed->fid, 0, variable_get("import_block_limit", 15));
$output = "<div class=\"item-list\"><ul>";
$items = array();
while ($item = db_fetch_object($result)) {
$output .= "<li>". import_format_item($item) ."</li>";
$items[] = import_format_item($item);
}
$output .= "</ul></div>";
$output = "<div class=\"import-block\"><div class=\"feed\">";
$output .= theme("theme_item_list", $items);
$output .= "</div></div>";
return $output;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment