Permalink
Browse files

#35 and #41 fixed

  • Loading branch information...
1 parent 586c463 commit ba0fd7391ee7ceab442cb493d600683ce8119638 @MilkZoft committed Apr 17, 2012
@@ -5,21 +5,22 @@
if(is_array($data)) {
foreach($data as $ad) {
if((int) count($data) === 1) {
- $HTML = a(img(_webURL . _sh . $ad["Banner"]), $ad["URL"], TRUE, array("title" => $ad["Title"]));
+ $HTML = a(img(path($ad["Banner"], TRUE)), $ad["URL"], TRUE, array("title" => $ad["Title"]));
} else {
if((int) $ad["Principal"] === 1) {
if(!$flag) {
$flag = TRUE;
- $HTML .= a(img(_webURL . _sh . $ad["Banner"]), $ad["URL"], TRUE, array(
- "title" => $ad["Title"],
- "class" => "ads principal",
- "style" => "text-align: center;"));
+ $HTML .= a(img(path($ad["Banner"], TRUE)), $ad["URL"], TRUE, array(
+ "title" => $ad["Title"],
+ "class" => "ads principal",
+ "style" => "text-align: center;")
+ );
} else {
- $HTML .= a(img(_webURL . _sh . $ad["Banner"]), $ad["URL"], TRUE, array("title" => $ad["Title"], "class" => "ads"));
+ $HTML .= a(img(path($ad["Banner"], TRUE)), $ad["URL"], TRUE, array("title" => $ad["Title"], "class" => "ads"));
}
} else {
- $HTML .= a(img(_webURL . _sh . $ad["Banner"]), $ad["URL"], TRUE, array("title" => $ad["Title"], "class" => "ads"));
+ $HTML .= a(img(path($ad["Banner"], TRUE)), $ad["URL"], TRUE, array("title" => $ad["Title"], "class" => "ads"));
}
}
@@ -84,42 +84,47 @@
);
print formSelect(array(
- "name" => "situation",
- "p" => TRUE,
- "class" => "required",
- "field" => __(_("Situation"))),
- $options);
+ "name" => "situation",
+ "p" => TRUE,
+ "class" => "required",
+ "field" => __(_("Situation"))),
+ $options
+ );
if(!isset($pwd)) {
print formInput(array(
- "name" => "pwd",
- "class" => "span10",
- "field" => __(_("Password")),
- "p" => TRUE,
- "value" => $pwd));
+ "name" => "pwd",
+ "class" => "span10",
+ "field" => __(_("Password")),
+ "p" => TRUE,
+ "value" => $pwd)
+ );
} else {
print formField(NULL, __(_("Password")) ."<br />");
print formInput(array(
- "id" => "lock",
- "class" => "lock",
- "type" => "button"));
-
+ "id" => "lock",
+ "class" => "lock",
+ "type" => "button")
+ );
+
print formInput(array(
- "id" => "password",
- "type" => "hidden",
- "value" => $pwd));
+ "id" => "password",
+ "type" => "hidden",
+ "value" => $pwd
+ ));
}
print formInput(array(
- "type" => "file",
- "name" => "image",
- "field" => __(_("Image for this post")),
- "p" => TRUE));
+ "type" => "file",
+ "name" => "image",
+ "field" => __(_("Image for this post")),
+ "p" => TRUE
+ ));
if(isset($medium)) {
- print img(_webURL . _sh . $medium);
+ print img(path($medium, TRUE));
}
print formInput(array(
@@ -132,23 +137,25 @@
if(isset($muralImage) and is_array($muralImage)) {
print formInput(array(
- "type" => "hidden",
- "name" => "mural_exist",
- "class" => "span10",
- "field" => __(_("Current mural image")),
- "p" => TRUE));
+ "type" => "hidden",
+ "name" => "mural_exist",
+ "class" => "span10",
+ "field" => __(_("Current mural image")),
+ "p" => TRUE)
+ );
- print img(_webURL . _sh . $muralImage[0]["Image"], NULL, NULL, array("style" => "width: 98%; border: 1px solid #000;"));
+ print img(path($muralImage[0]["Image"], TRUE), array("style" => "width: 98%; border: 1px solid #000;"));
print $this->js("var URL = '$muralDeleteURL';", TRUE);
print formInput(array(
- "type" => "submit",
- "id" => "delete_mural",
- "name" => "delete_mural_image",
- "value" => __(_("Delete Mural")),
- "class" => "btn error",
- "p" => TRUE));
+ "type" => "submit",
+ "id" => "delete_mural",
+ "name" => "delete_mural_image",
+ "value" => __(_("Delete Mural")),
+ "class" => "btn error",
+ "p" => TRUE
+ ));
}
print formSave($action);
@@ -16,16 +16,14 @@ public function __construct() {
$this->application = $this->app("pages");
- $this->Templates->theme(_webTheme);
+ $this->Templates->theme();
}
- public function index() {
+ public function index($slug = NULL) {
$this->CSS("style", $this->application);
- if(isLang() and segment(2)) {
- $this->getBySlug(segment(2));
- } elseif(!isLang() and segment(1)) {
- $this->getBySlug(segment(1));
+ if(!is_null($slug)) {
+ $this->getBySlug($slug);
} else {
$this->getByDefault();
}
@@ -34,7 +32,7 @@ private function getView($view = NULL) {
$view = segment(2);
$vars["view"] = $this->view("$view", TRUE);
- $this->template("content", $vars);
+ $this->render("content", $vars);
}
private function getBySlug($slug = NULL) {
@@ -67,9 +65,9 @@ private function getBySlug($slug = NULL) {
$vars["content"] = $data[0]["Content"];
$vars["view"] = $this->view("page", TRUE);
- $this->template("content", $vars);
+ $this->render("content", $vars);
} else {
- $this->template("error404");
+ $this->render("error404");
}
}
@@ -83,9 +81,9 @@ private function getByDefault() {
$vars["content"] = $data[0]["Content"];
$vars["view"] = $this->view("page", TRUE);
- $this->template("content", $vars);
+ $this->render("content", $vars);
} else {
- $this->template("error404");
+ $this->render("error404");
}
}
}
@@ -41,20 +41,14 @@ public function cpanel($action, $limit = NULL, $order = "Language DESC", $search
}
}
- private function all($trash, $order, $limit) {
+ private function all($trash, $order, $limit) {
if(!$trash) {
- if(SESSION("ZanUserPrivilege") === _super) {
- $data = $this->Db->findBySQL("Situation != 'Deleted'", $this->table, NULL, $order, $limit);
- } else {
- $data = $this->Db->findBySQL("ID_User = '". SESSION("ZanUserID") ."' AND Situation != 'Deleted'", $this->table, NULL, $order, $limit);
- }
+ $query = (SESSION("ZanUserPrivilegeID") === 1) ? "Situation != 'Deleted'" : "ID_User = '". SESSION("ZanUserID") ."' AND Situation != 'Deleted'";
} else {
- if(SESSION("ZanUserPrivilege") === _super) {
- $data = $this->Db->findBy("Situation", "Deleted", $this->table, NULL, $order, $limit);
- } else {
- $data = $this->Db->findBySQL("ID_User = '". SESSION("ZanUserID") ."' AND Situation = 'Deleted'", $this->table, NULL, $order, $limit);
- }
+ $query = (SESSION("ZanUserPrivilegeID") === 1) ? "Situation = 'Deleted'" : "ID_User = '". SESSION("ZanUserID") ."' AND Situation = 'Deleted'";
}
+
+ $data = $this->Db->findBySQL($query, $this->table, NULL, $order, $limit);
return $data;
}
@@ -31,12 +31,24 @@
print isset($alert) ? $alert : NULL;
- print formInput(array("type" => "text", "name" => "title", "class" => "input required", "field" => __("Title"), "p" => TRUE, "value" => $title));
-
- print formTextarea(array("id" => "editor", "name" => "content", "class" => "textarea", "field" => __("Content"), "p" => TRUE, "value" => $content));
+ print formInput(array(
+ "type" => "text",
+ "name" => "title",
+ "class" => "span10 required",
+ "field" => __(_("Title")),
+ "p" => TRUE,
+ "value" => $title)
+ );
- print isset($imagesLibrary) ? $imagesLibrary : NULL;
- print isset($documentsLibrary) ? $documentsLibrary : NULL;
+ print formTextarea(array(
+ "id" => "editor",
+ "name" => "content",
+ "class" => "span10",
+ "style" => "height: 400px;",
+ "field" => __(_("Content")),
+ "p" => TRUE,
+ "value" => $content)
+ );
print formField(NULL, __("Languages") ."<br />". getLanguagesInput($language));
@@ -54,7 +66,13 @@
)
);
- print formSelect(array("name" => "principal", "class" => "select", "p" => TRUE, "field" => __("Principal")), $options);
+ print formSelect(array(
+ "name" => "principal",
+ "class" => "required",
+ "p" => TRUE,
+ "field" => __(_("Principal"))),
+ $options
+ );
$options = array(
0 => array(
@@ -70,7 +88,13 @@
)
);
- print formSelect(array("name" => "situation", "class" => "select", "p" => TRUE, "field" => __("Situation")), $options);
+ print formSelect(array(
+ "name" => "situation",
+ "class" => "required",
+ "p" => TRUE,
+ "field" => __(_("Situation"))),
+ $options
+ );
print formSave($action);
@@ -2,7 +2,7 @@
<a name="top"></a>
<p>
- <?php print $content; ?>
+ <?php print bbCode($content); ?>
</p>
<?php
View
@@ -121,3 +121,7 @@
.right {
text-align: right;
}
+
+#alert-message {
+ width: 90%;
+}
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit ba0fd73

Please sign in to comment.