Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Loader)
- *
- * @ Version : 2.0.0.4
- * @ Author : DeZender
- * @ Release on : 21.10.2015
- * @ Official site : http://DeZender.Net
- *
- */
- class sfrAdvancedPages extends WP_Widget {
- public function __construct() {
- parent::__construct("sfrAdvancedPages", "- SAFİR - GELİŞMİŞ SAYFALAR", array("description" => "İstediğiniz sayfaları göstermek için kullanılabilecek bileşen"));
- add_action("save_post", array($this, "delete_widget_cache"));
- add_action("deleted_post", array($this, "delete_widget_cache"));
- add_action("switch_theme", array($this, "delete_widget_cache"));
- return;
- }
- public function delete_widget_cache() {
- delete_transient($this->id);
- return;
- }
- private function get_defaults() {
- $defaults = array("title" => "SAYFALAR", "color" => "mavi", "icon" => "sayfa", "slogan" => "Buraya başlık altındaki kısa açıklamanızı girebilirsiniz.", "scroll" => "scroll", "detail" => "evet", "buttonText" => "SAYFAYA GİT");
- return $defaults;
- }
- public function update($new_instance, $old_instance) {
- $instance = $old_instance;
- $instance["title"] = $new_instance["title"];
- $instance["pageIDs"] = $new_instance["pageIDs"];
- $instance["slogan"] = $new_instance["slogan"];
- $instance["color"] = $new_instance["color"];
- $instance["number"] = $new_instance["number"];
- $instance["offset"] = $new_instance["offset"];
- $instance["color"] = $new_instance["color"];
- $instance["icon"] = $new_instance["icon"];
- $instance["filter"] = $new_instance["filter"];
- $instance["categoryChoice"] = $new_instance["categoryChoice"];
- $instance["catIDs"] = $new_instance["catIDs"];
- $instance["scroll"] = $new_instance["scroll"];
- $instance["buttonText"] = $new_instance["buttonText"];
- $instance["detail"] = $new_instance["detail"];
- $this->delete_widget_cache();
- return $instance;
- }
- public function form($instance) {
- $defaults = $this->get_defaults();
- extract(wp_parse_args($instance, $defaults));
- echo " <p>\r
- <label for=\"";
- echo $this->get_field_id("title");
- echo "\">Bileşen başlığı</label>\r
- <input type=\"text\" id=\"";
- echo $this->get_field_id("title");
- echo "\" name=\"";
- echo $this->get_field_name("title");
- echo "\" value=\"";
- echo esc_attr($title);
- echo "\" class=\"widefat\" />\r
- </p>\r
- <p> \r
- <label for=\"";
- echo $this->get_field_id("slogan");
- echo "\">Başlık altındaki açıklama<br/>(sadece anasayfa için)</label>\r
- <input type=\"text\" id=\"";
- echo $this->get_field_id("slogan");
- echo "\" name=\"";
- echo $this->get_field_name("slogan");
- echo "\" value=\"";
- echo esc_attr($slogan);
- echo "\" class=\"widefat\" />\r
- </p>\r
- <div class=\"safirCategoryGroup\"> \r
- <p>\r
- Hangi sayfalar gösterilsin?\r
- </p> \r
- <p style=\"height:123px;overflow-y:scroll; border:1px solid #e2e2e2; padding:0 5px;margin:-1em -1px 1em 1px\">\r
- ";
- $counter = 0;
- $args = array("sort_order" => "ASC", "sort_column" => "post_title", "hierarchical" => 1, "exclude" => "", "include" => "", "meta_key" => "", "meta_value" => "", "authors" => "", "child_of" => 0, "parent" => -1, "exclude_tree" => "", "number" => "", "offset" => 0, "post_type" => "page", "post_status" => "publish");
- $globalPages = get_pages($args);
- global $globalCategories;
- foreach ($globalPages as $globalPage)
- {
- echo " <label style=\"display:block;margin-top:5px;\" for=\"";
- echo $this->get_field_name("pageIDs");
- echo $counter;
- echo "\">\r
- <input id=\"";
- echo $this->get_field_name("pageIDs");
- echo $counter;
- echo "\" name=\"";
- echo $this->get_field_name("pageIDs");
- echo "[]\" type=\"checkbox\" value=\"";
- echo $globalPage->ID;
- echo "\"";
- if (is_array($pageIDs) || in_array($globalPage["ID"], $pageIDs))
- {
- echo " checked";
- }
- echo "> ";
- echo $globalPage->post_title;
- echo "</label>\r
- ";
- ++$counter;
- continue;
- }
- echo " </p>\r
- </div>\r
- <p>\r
- <label for=\"";
- echo $this->get_field_id("filter");
- echo ">\">Sayfalar neye göre gösterilsin?</label>\r
- <select style=\"width:100%;\" id=\"";
- echo $this->get_field_id("filter");
- echo "\" name=\"";
- echo $this->get_field_name("filter");
- echo "\">\r
- <option value=\"date\"";
- if ("date" == esc_attr($filter))
- {
- echo " selected";
- }
- echo ">Son eklenene göre</option>\r
- <option value=\"hit\"";
- if ("hit" == esc_attr($filter))
- {
- echo " selected";
- }
- echo ">En çok bakılana göre</option>\r
- <option value=\"comment_count\"";
- if ("comment_count" == esc_attr($filter))
- {
- echo " selected";
- ........................................
- .........................
- ........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement