public function scanGateways($merge = true) { $gateways = array(); // Load file helper and read gateways directory loader::helper('file'); $dirs = file_helper::scanFileNames(DOCPATH . 'libraries/payments'); // Loop through found directories foreach ($dirs as $gateway) { // Remove file extension $gateway = substr($gateway, 0, -4); if ($manifest = $this->getManifest($gateway)) { $gateways[$gateway] = $manifest; } } // Do we need to merge results with installed gateways? if ($merge) { // Loop through installed gateways foreach ($this->getGateways(false, false) as $gateway) { if (isset($gateways[$gateway['keyword']])) { $gateways[$gateway['keyword']]['gateway_id'] = $gateway['gateway_id']; $gateways[$gateway['keyword']]['name'] = $gateway['name']; $gateways[$gateway['keyword']]['active'] = $gateway['active']; } } } // Order gateways ksort($gateways); return $gateways; }
public function scanServices($merge = true) { // Load file helper and read storage services directory loader::helper('file'); $dirs = file_helper::scanFileNames(DOCPATH . 'libraries/storages'); $services = array(); // Loop through found directories foreach ($dirs as $service) { // Remove file extension $service = substr($service, 0, -4); if ($manifest = $this->getManifest($service)) { $services[$service] = $manifest; $services[$service]['default'] = 0; } } // Do we need to merge results with installed storage services? if ($merge) { // Loop through installed storage services foreach ($this->getServices() as $service) { if (isset($services[$service['keyword']])) { $services[$service['keyword']]['service_id'] = $service['service_id']; $services[$service['keyword']]['default'] = $service['default']; } } } // Order services ksort($services); return $services; }
public function view() { $ct = CollectionType::getByHandle('pb_post'); $ctID = $ct->getPageTypeID(); if ($this->targetCID > 0) { $target = Page::getByID($this->targetCID); $this->set('target', $target); } else { $target = Page::getByPath('/blogsearch'); $this->set('target', $target); } if (!$this->page_type) { $this->page_type = 'pb_post'; } $page_type = trim($this->page_type); $query = "SELECT MIN(cv.cvDatePublic) as firstPost\n\t\t\tFROM CollectionVersions cv\n INNER JOIN Pages pp ON cv.cID = pp.cID\n\t\t\tINNER JOIN PageTypes pt ON pp.ptID = pt.ptID\n\t\t\tWHERE pt.ptHandle = ? and cv.cvIsApproved = 1\n\t\t\tAND cv.cvDatePublic < CURDATE()\n ORDER BY firstPost ASC"; $db = Loader::db(); $firstPost = $db->getOne($query, array($page_type)); if (strlen($firstPost)) { $firstPost = new \DateTime($firstPost); $this->set('firstPost', $firstPost); } $this->set('numMonths', $this->numMonths); $this->set('navigation', loader::helper('navigation')); }
public function scanCaptchas($merge = true) { // Load file helper and read captcha directory loader::helper('file'); $dirs = file_helper::scanFileNames(DOCPATH . 'libraries/captchas'); $captchas = array(); // Loop through found directories foreach ($dirs as $captcha) { // Remove file extension $captcha = substr($captcha, 0, -4); if ($manifest = $this->getManifest($captcha)) { $captchas[$captcha] = $manifest; $captchas[$captcha]['default'] = 0; } } // Do we need to merge results with installed captchas? if ($merge) { // Loop through installed captchas foreach ($this->getCaptchas() as $captcha) { if (isset($captchas[$captcha['keyword']])) { $captchas[$captcha['keyword']]['captcha_id'] = $captcha['captcha_id']; $captchas[$captcha['keyword']]['default'] = $captcha['default']; } } } // Order captchas ksort($captchas); return $captchas; }
public function scanPlugins($merge = true, $escape = true) { // Load file helper and read plugins directory loader::helper('file'); $dirs = file_helper::scanDirectoryNames(DOCPATH . 'plugins'); $plugins = array(); // Loop through found directories foreach ($dirs as $plugin) { if ($manifest = $this->getManifest($plugin, false, $escape)) { $plugins[$plugin] = $manifest; } } // Do we need to merge results with installed plugins? if ($merge) { // Loop through installed plugins foreach ($this->getPlugins($escape) as $plugin) { if (isset($plugins[$plugin['keyword']])) { $plugins[$plugin['keyword']]['plugin_id'] = $plugin['plugin_id']; $plugins[$plugin['keyword']]['name'] = $plugin['name']; $plugins[$plugin['keyword']]['version_new'] = $plugins[$plugin['keyword']]['version']; $plugins[$plugin['keyword']]['version'] = $plugin['version']; $plugins[$plugin['keyword']]['system'] = $plugin['system']; } } } // Order plugins ksort($plugins); return $plugins; }
public function scanTemplates($merge = true) { // Load file helper and read templates directory loader::helper('file'); $dirs = file_helper::scanDirectoryNames(BASEPATH . 'templates'); $templates = array(); // Loop through found directories foreach ($dirs as $template) { if ($manifest = $this->getManifest($template)) { $templates[$template] = $manifest; $templates[$template]['default'] = 0; } } // Do we need to merge results with installed templates? if ($merge) { // Loop through installed templates foreach ($this->getTemplates() as $template) { if (isset($templates[$template['keyword']])) { $templates[$template['keyword']]['template_id'] = $template['template_id']; $templates[$template['keyword']]['default'] = $template['default']; } } } // Order templates ksort($templates); return $templates; }
function import($themename) { $img = loader::helper('image'); if (is_dir(DIRNAME_THEMES . '/' . $themename)) { if (is_file(DIRNAME_THEMES . '/' . $themename . '/style.css')) { if (is_file(DIRNAME_THEMES . '/' . $themename . '/index.php')) { $page = 'index.php'; //make the description file_put_contents(DIRNAME_THEMES . '/' . $themename . '/description.txt', $themename . "\n Converted by Wordpress Theme Importer"); if (!copy(DIRNAME_PACKAGES . '/wordpress_theme_importer/img/default_thumb.png', DIRNAME_THEMES . '/' . $themename . '/thumbnail.png')) { throw new exception(t('Couldn\'t copy thumbnail.png to ' . DIRNAME_THEMES . '/' . $themename . '/thumbnail.png')); } if (is_file(DIRNAME_THEMES . '/' . $themename . '/single.php')) { //if single.php exists we use that because thats closer to c5s concept of a page //otherwise we check for page.php $page = 'single.php'; } elseif (is_file(DIRNAME_THEMES . '/' . $themename . '/page.php')) { //if page.php exists we use that because thats closer to c5s concept of a page than index (but not as close as single) //otherwise we just use index.php $page = 'page.php'; } //get the file contents $contents = file_get_contents(DIRNAME_THEMES . '/' . $themename . '/' . $page); //merge all the things! $contents = preg_replace("#get_header.*\\(.*\\).*;#smUi", preg_replace('#<\\?php#', '', file_get_contents(DIRNAME_THEMES . '/' . $themename . '/header.php'), 1), $contents); $contents = preg_replace("#get_footer.*\\(.*\\).*;#smUi", preg_replace('#<\\?php#', '', file_get_contents(DIRNAME_THEMES . '/' . $themename . '/footer.php'), 1), $contents); $contents = preg_replace("#get_sidebar.*\\(.*\\).*;#smUi", preg_replace('#<\\?php#', '', file_get_contents(DIRNAME_THEMES . '/' . $themename . '/sidebar.php'), 1), $contents); $contents = preg_replace('#<title>(.*)</title>.*#smUi', '', $contents); //remove title $contents = preg_replace('#<meta.*(\\/>|>.*</meta>)#smUi', '', $contents); //removes the meta info from the file //you can use regext stuff in here $array = array('<?php while.*the_post ;|{ s*?>(.*) endwhile;|} else :|{ .* endif;|}' => '$1', "get_search_form\\(.*\\);" => '', "language_attributes\\(.*\\);" => '', "wp_head\\(.*\\);" => 'Loader::element(\'header_required\');', "body_class\\(.*\\);" => '', "get_template_directory_uri\\(.*\\);" => 'echo $this->getThemePath();;', 'get_adjacent_post\\(.*\\);;' => '', 'get_boundary_post\\(.*\\);' => '', 'get_children\\(.*\\);' => '', 'get_extended\\(.*\\);' => '', 'get_next_post\\(.*\\);' => '', 'get_permalink\\(.*\\);' => 'Loader::helper(\'navigation\'); echo NavigationHelper::getLinkToCollection($c);', 'get_the_excerpt\\(.*\\);' => '', 'get_the_post_thumbnail\\(.*\\);' => '', 'get_post\\(.*\\);' => 'global $c', 'the_time\\(.*\\);' => 'date();', 'get_post_ancestors\\(.*\\);' => '', 'get_post_mime_type\\(.*\\);' => '', 'get_post_status\\(.*\\);' => '', 'get_post_type\\(.*\\);' => 'echo $c->getCollectionTypeHandle\\(\\);;', 'get_previous_post\\(.*\\);' => '', 'is_post\\(.*\\);' => '', 'is_single\\(.*\\);' => '', 'is_sticky\\(.*\\);' => '', 'register_post_type\\(.*\\);' => '', 'the_ID\\(.*\\);' => 'echo $c->getCollectionID();;', 'wp_get_recent_posts\\(.*\\);' => '', 'wp_get_single_post\\(.*\\);' => '', 'wp_delete_post\\(.*\\);' => '', 'wp_insert_post\\(.*\\);' => '', 'wp_publish_post\\(.*\\);' => '', 'wp_update_post\\(.*\\);' => '', 'get_all_page_ids\\(.*\\);' => '', 'get_ancestors\\(.*\\);' => '', 'get_page\\(.*\\);' => 'global $c', 'get_page_link\\(.*\\);' => 'Loader::helper\\(\'navigation\'\\); echo NavigationHelper::getLinkToCollection($c, true);', 'get_page_by_path\\((.*)\\);' => 'Page::getByPath\\(\'$1\'\\);;', 'get_page_by_title\\(.*\\);' => '', 'get_page_children\\(.*\\);' => '', 'get_page_hierarchy\\(.*\\);' => '', 'get_page_uri\\(.*\\);' => '', 'get_pages\\(.*\\);' => '', 'is_page\\(.*\\);' => '', 'page_uri_index\\(.*\\);' => '', 'add_post_meta\\(.*\\);' => '', 'delete_post_meta\\(.*\\);' => '', 'get_post_custom\\(.*\\);' => '', 'get_post_custom_keys\\(.*\\);' => '', 'get_post_custom_values\\(.*\\);' => '', 'get_post_meta\\(.*\\);' => '', 'update_post_meta\\(.*\\);' => '', 'get_attached_file\\(.*\\);' => '', 'is_attachment\\(.*\\);' => '', 'is_local_attachment\\(.*\\);' => '', 'update_attached_file\\(.*\\);' => '', 'wp_attachment_is_image\\(.*\\);' => '', 'wp_insert_attachment\\(.*\\);' => '', 'wp_delete_attachment\\(.*\\);' => '', 'wp_get_attachment_image\\(.*\\);' => '', 'wp_get_attachment_link\\(.*\\);' => '', 'wp_get_attachment_image_src\\(.*\\);' => '', 'wp_get_attachment_metadata\\(.*\\);' => '', 'wp_get_attachment_thumb_file\\(.*\\);' => '', 'wp_get_attachment_thumb_url\\(.*\\);' => '', 'wp_get_attachment_url\\(.*\\);' => '', 'wp_check_for_changed_slugs\\(.*\\);' => '', 'wp_count_posts\\(.*\\);' => '', 'wp_mime_type_icon\\(.*\\);' => '', 'wp_update_attachment_metadata\\(.*\\);' => '', 'get_bookmark\\(.*\\);' => '', 'get_bookmarks\\(.*\\);' => '', 'wp_get_post_categories\\(.*\\);' => '', 'wp_set_post_categories\\(.*\\);' => '', 'wp_get_post_tags\\(.*\\);' => '', 'wp_set_post_tags\\(.*\\);' => '', 'wp_get_post_terms\\(.*\\);' => '', 'wp_set_post_terms\\(.*\\);' => '', 'add_meta_box\\(.*\\);' => '', 'remove_meta_box\\(.*\\);' => '', 'get_the_ID\\(.*\\);' => ' $c->getCollectionID();', 'get_the_author\\(.*\\);' => ' $c->getCollectionUserID();', 'the_post\\(.*\\);' => '', 'the_content\\(.*\\);' => '$a=new Area("Main");$a->display($c);', 'get_the_content\\(.*\\);' => '$a=new Area("Main");$a->display($c);', 'get_the_title\\(.*\\);' => ' $c->getCollectionName();', 'wp_trim_excerpt\\(.*\\);' => '', 'cat_is_ancestor_of\\(.*\\);' => '', 'get_all_category_ids\\(.*\\);' => '', 'get_ancestors\\(.*\\);' => '', 'get_cat_ID\\(.*\\);' => '', 'get_cat_name\\(.*\\);' => '', 'get_categories\\(.*\\);' => '', 'get_category\\(.*\\);' => '', 'get_category_by_path\\(.*\\);' => '', 'get_category_by_slug\\(.*\\);' => '', 'get_the_category_by_ID\\(.*\\);' => '', 'get_category_link\\(.*\\);' => '', 'get_category_parents\\(.*\\);' => '', 'get_the_category\\(.*\\);' => '', 'in_category\\(.*\\);' => '', 'is_category\\(.*\\);' => '', 'wp_list_categories\\(.*\\);' => '', 'wp_create_category\\(.*\\);' => '', 'wp_delete_category\\(.*\\);' => '', 'wp_insert_category\\(.*\\);' => '', 'get_tag\\(.*\\);' => '', 'get_tag_link\\(.*\\);' => '', 'get_tags\\(.*\\);' => '', 'get_the_tag_list\\(.*\\);' => '', 'get_the_tags\\(.*\\);' => '', 'is_tag\\(.*\\);' => '', 'get_taxonomies\\(.*\\);' => '', 'get_term\\(.*\\);' => '', 'get_the_term_list\\(.*\\);' => '', 'get_term_by\\(.*\\);' => '', 'get_the_terms\\(.*\\);' => '', 'get_term_children\\(.*\\);' => '', 'get_term_link\\(.*\\);' => '', 'get_terms\\(.*\\);' => '', 'is_taxonomy\\(.*\\);' => '', 'is_taxonomy_hierarchical\\(.*\\);' => '', 'is_term\\(.*\\);' => '', 'taxonomy_exists\\(.*\\);' => '', 'term_exists\\(.*\\);' => '', 'register_taxonomy\\(.*\\);' => '', 'register_taxonomy_for_object_type\\(.*\\);' => '', 'wp_get_object_terms\\(.*\\);' => '', 'wp_set_object_terms\\(.*\\);' => '', 'wp_insert_term\\(.*\\);' => '', 'wp_update_term\\(.*\\);' => '', 'wp_delete_term\\(.*\\);' => '', 'add_role\\(.*\\);' => '', 'author_can\\(.*\\);' => '', 'current_user_can\\(.*\\);' => '', 'current_user_can_for_blog\\(.*\\);' => '', 'get_role\\(.*\\);' => '', 'get_super_admins\\(.*\\);' => '', 'is_super_admin\\(.*\\);' => '$u->isSuperAdmin();', 'map_meta_cap\\(.*\\);' => '', 'remove_role\\(.*\\);' => '', 'user_can\\(.*\\);' => '', 'add_cap\\(.*\\);' => '', 'remove_cap\\(.*\\);' => '', 'auth_redirect\\(.*\\);' => '', 'count_users\\(.*\\);' => '', 'count_user_posts\\(.*\\);' => '', 'count_many_users_posts\\(.*\\);' => '', 'email_exists\\(.*\\);' => '', 'get_currentuserinfo\\(.*\\);' => '', 'get_profile\\(.*\\);' => '', 'get_userdata\\(.*\\);' => '', 'get_userdatabylogin\\(.*\\);' => '', 'get_usernumposts\\(.*\\);' => '', 'get_users\\(.*\\);' => '', 'get_users_of_blog\\(.*\\);' => '', 'set_current_user\\(.*\\);' => '', 'user_pass_ok\\(.*\\);' => '', 'username_exists\\(.*\\);' => '', 'validate_username\\(.*\\);' => '', 'wp_get_current_user\\(.*\\);' => '', 'wp_set_current_user\\(.*\\);' => '', 'get_author_posts_url\\(.*\\);' => '', 'add_user_meta\\(.*\\);' => '', 'delete_user_meta\\(.*\\);' => '', 'get_user_meta\\(.*\\);' => '', 'update_user_meta\\(.*\\);' => '', 'wp_create_user\\(.*\\);' => '', 'wp_delete_user\\(.*\\);' => '', 'wp_insert_user\\(.*\\);' => '', 'wp_update_user\\(.*\\);' => '', 'is_user_logged_in\\(.*\\);' => '', 'wp_signon\\(.*\\);' => '', 'wp_logout\\(.*\\);' => '', 'bloginfo_rss\\(.*\\);' => '', 'comment_author_rss\\(.*\\);' => '', 'comment_link\\(.*\\);' => '', 'comment_text_rss\\(.*\\);' => '', 'do_feed\\(.*\\);' => '', 'do_feed_atom\\(.*\\);' => '', 'do_feed_rdf\\(.*\\);' => '', 'do_feed_rss\\(.*\\);' => '', 'do_feed_rss2\\(.*\\);' => '', 'fetch_feed\\(.*\\);' => '', 'fetch_rss\\(.*\\);' => '', 'get_author_feed_link\\(.*\\);' => '', 'get_bloginfo_rss\\(.*\\);' => '', 'get_category_feed_link\\(.*\\);' => '', 'get_comment_link\\(.*\\);' => '', 'get_comment_author_rss\\(.*\\);' => '', 'get_post_comments_feed_link\\(.*\\);' => '', 'get_rss\\(.*\\);' => '', 'get_search_comments_feed_link\\(.*\\);' => '', 'get_search_feed_link\\(.*\\);' => '', 'get_the_category_rss\\(.*\\);' => '', 'get_the_title_rss\\(.*\\);' => '', 'post_comments_feed_link\\(.*\\);' => '', 'rss_enclosure\\(.*\\);' => '', 'the_title_rss\\(.*\\);' => '', 'the_category_rss\\(.*\\);' => '', 'the_content_rss\\(.*\\);' => '', 'the_excerpt_rss\\(.*\\);' => '', 'wp_rss\\(.*\\);' => '', 'add_ping\\(.*\\);' => '', 'add_comment_meta\\(.*\\);' => '', 'check_comment\\(.*\\);' => '', 'comment_text\\(.*\\);' => '', 'comment_form\\(.*\\);' => '', 'comments_number\\(.*\\);' => '', 'discover_pingback_server_uri\\(.*\\);' => '', 'delete_comment_meta\\(.*\\);' => '', 'do_all_pings\\(.*\\);' => '', 'do_enclose\\(.*\\);' => '', 'do_trackbacks\\(.*\\);' => '', 'generic_ping\\(.*\\);' => '', 'get_approved_comments\\(.*\\);' => '', 'get_avatar\\(.*\\);' => '', 'get_comment\\(.*\\);' => '', 'get_comment_text\\(.*\\);' => '', 'get_comment_meta\\(.*\\);' => '', 'get_comments\\(.*\\);' => '', 'wp_list_comments\\(.*\\);' => '', 'get_enclosed\\(.*\\);' => '', 'get_lastcommentmodified\\(.*\\);' => '', 'get_pung\\(.*\\);' => '', 'get_to_ping\\(.*\\);' => '', 'have_comments\\(.*\\);' => '', 'is_trackback\\(.*\\);' => '', 'next_comments_link\\(.*\\);' => '', 'paginate_comments_links\\(.*\\);' => '', 'pingback\\(.*\\);' => '', 'previous_comments_link\\(.*\\);' => '', 'privacy_ping_filter\\(.*\\);' => '', 'sanitize_comment_cookies\\(.*\\);' => '', 'trackback\\(.*\\);' => '', 'trackback_url\\(.*\\);' => '', 'trackback_url_list\\(.*\\);' => '', 'update_comment_meta\\(.*\\);' => '', 'weblog_ping\\(.*\\);' => '', 'wp_allow_comment\\(.*\\);' => '', 'wp_count_comments\\(.*\\);' => '', 'wp_delete_comment\\(.*\\);' => '', 'wp_filter_comment\\(.*\\);' => '', 'wp_get_comment_status\\(.*\\);' => '', 'wp_get_current_commenter\\(.*\\);' => '', 'wp_insert_comment\\(.*\\);' => '', 'wp_new_comment\\(.*\\);' => '', 'wp_set_comment_status\\(.*\\);' => '', 'wp_throttle_comment_flood\\(.*\\);' => '', 'wp_update_comment\\(.*\\);' => '', 'wp_update_comment_count\\(.*\\);' => '', 'has_filter\\(.*\\);' => '', 'add_filter\\(.*\\);' => '', 'apply_filters\\(.*\\);' => '', 'current_filter\\(.*\\);' => '', 'merge_filters\\(.*\\);' => '', 'remove_filter\\(.*\\);' => '', 'remove_all_filters\\(.*\\);' => '', 'has_action\\(.*\\);' => '', 'add_action\\(.*\\);' => '', 'do_action\\(.*\\);' => '', 'do_action_ref_array\\(.*\\);' => '', 'did_action\\(.*\\);' => '', 'remove_action\\(.*\\);' => '', 'remove_all_actions\\(.*\\);' => '', 'plugin_basename\\(.*\\);' => '', 'plugins_url\\(.*\\);' => '', 'register_activation_hook\\(.*\\);' => '', 'register_deactivation_hook\\(.*\\);' => '', 'register_setting\\(.*\\);' => '', 'settings_fields\\(.*\\);' => '', 'unregister_setting\\(.*\\);' => '', 'menu_page_url\\(.*\\);' => '', 'add_shortcode\\(.*\\);' => '', 'do_shortcode\\(.*\\);' => '', 'do_shortcode_tag\\(.*\\);' => '', 'get_shortcode_regex\\(.*\\);' => '', 'remove_shortcode\\(.*\\);' => '', 'remove_all_shortcodes\\(.*\\);' => '', 'shortcode_atts\\(.*\\);' => '', 'shortcode_parse_atts\\(.*\\);' => '', 'strip_shortcodes\\(.*\\);' => '', 'comments_template\\(.*\\);' => '', 'add_custom_background\\(.*\\);' => '', 'add_custom_image_header\\(.*\\);' => '', 'add_theme_support\\(.*\\);' => '', 'current_theme_supports\\(.*\\);' => '', 'dynamic_sidebar\\(.*\\);' => '', 'get_404_template\\(.*\\);' => '$this->render(\'page_not_found\');', 'get_archive_template\\(.*\\);' => '', 'get_attachment_template\\(.*\\);' => '', 'get_author_template\\(.*\\);' => '', 'get_category_template|get_category_template\\(.*\\);' => '', 'get_comments_popup_template\\(.*\\);' => '', 'get_current_theme\\(.*\\);' => 'echo PageTheme::getSiteTheme\\(\\);;', 'get_date_template\\(.*\\);' => '', 'get_header_image\\(.*\\);' => '$f = File::getByID(1); echo "<img src="$f->getPath()"/>;', 'get_header_textcolor\\(.*\\);' => '"blank"', 'get_home_template\\(.*\\);' => '', 'get_locale_stylesheet_uri\\(.*\\);' => '', 'get_page_template\\(.*\\);' => '', 'get_paged_template\\(.*\\);' => '', 'get_query_template\\(.*\\);' => '', 'get_search_template\\(.*\\);' => '', 'get_single_template\\(.*\\);' => '', 'get_stylesheet\\((.*)\\);' => '<link rel="stylesheet" href="$1"/>', 'get_stylesheet_directory\\(.*\\);' => '', 'get_stylesheet_directory_uri\\(.*\\);' => '', 'get_stylesheet_uri\\(.*\\);' => '', 'get_tag_template\\(.*\\);' => '', 'get_taxonomy_template\\(.*\\);' => '', 'get_template\\(.*\\);' => '', 'get_template_directory\\(.*\\);' => '', 'get_template_directory_uri\\(.*\\);' => '', 'get_template_part\\(.*\\);' => '', 'get_theme\\((.*)\\);' => 'PageTheme::getByHandle($1);', 'get_theme_data\\(.*\\);' => '', 'get_theme_support\\(.*\\);' => '', 'get_theme_mod\\(.*\\);' => '', 'get_theme_root\\(.*\\);' => '', 'get_theme_root_uri\\(.*\\);' => '', 'get_themes\\(.*\\);' => '', 'header_image\\(.*\\);' => '', 'header_textcolor\\(.*\\);' => '', 'load_template\\(.*\\);' => '', 'locale_stylesheet\\(.*\\);' => '', 'locate_template\\(.*\\);' => '', 'preview_theme\\(.*\\);' => '', 'preview_theme_ob_filter\\(.*\\);' => '', 'preview_theme_ob_filter_callback\\(.*\\);' => '', 'register_nav_menu\\(.*\\);' => '', 'register_nav_menus\\(.*\\);' => '', 'register_sidebar\\(.*\\);' => '', 'register_theme_directory\\(.*\\);' => '', 'remove_theme_mod\\(.*\\);' => '', 'remove_theme_mods\\(.*\\);' => '', 'require_if_theme_supports\\(.*\\);' => '', 'search_theme_directories\\(.*\\);' => '', 'set_theme_mod\\(.*\\);' => '', 'switch_theme\\(.*\\);' => '', 'validate_current_theme\\(.*\\);' => '', 'unregister_nav_menu\\(.*\\);' => '', 'wp_get_archives\\(.*\\);' => '', 'wp_get_nav_menu_items\\(.*\\);' => '', 'wp_nav_menu\\(.*\\);' => '$a=new Area("Header Nav");$a->display($c);', 'wp_page_menu\\(.*\\);' => '$a=new Area("Header Nav");$a->display($c);', 'add_magic_quotes\\(.*\\);' => '', 'addslashes_gpc\\(.*\\);' => '', 'antispambot\\(.*\\);' => '', 'attribute_escape\\(.*\\);' => '', 'backslashit\\(.*\\);' => '', 'balanceTags\\(.*\\);' => '', 'clean_pre\\(.*\\);' => '', 'clean_url\\(.*\\);' => '', 'convert_chars\\(.*\\);' => '', 'convert_smilies\\(.*\\);' => '', 'ent2ncr\\(.*\\);' => '', 'esc_attr\\(.*\\);' => '', 'esc_textarea\\(.*\\);' => '', 'force_balance_tags\\(.*\\);' => '', 'format_to_edit\\(.*\\);' => '', 'format_to_post\\(.*\\);' => '', 'funky_javascript_fix\\(.*\\);' => '', 'htmlentities2\\(.*\\);' => '', 'is_email\\(.*\\);' => '', 'js_escape\\(.*\\);' => '', 'make_clickable\\(.*\\);' => '', 'popuplinks\\(.*\\);' => '', 'remove_accents\\(.*\\);' => '', 'sanitize_email\\(.*\\);' => '', 'sanitize_file_name\\(.*\\);' => '', 'sanitize_user\\(.*\\);' => '', 'sanitize_title\\(.*\\);' => '', 'sanitize_title_with_dashes\\(.*\\);' => '', 'seems_utf8\\(.*\\);' => '', 'stripslashes_deep\\(.*\\);' => '', 'trailingslashit\\(.*\\);' => '', 'untrailingslashit\\(.*\\);' => '', 'url_shorten\\(.*\\);' => '', 'utf8_uri_encode\\(.*\\);' => '', 'wpautop\\(.*\\);' => '', 'wptexturize\\(.*\\);' => '', 'wp_filter_kses\\(.*\\);' => '', 'wp_filter_post_kses\\(.*\\);' => '', 'wp_filter_nohtml_kses\\(.*\\);' => '', 'wp_iso_descrambler\\(.*\\);' => '', 'wp_kses\\(.*\\);' => '', 'wp_kses_array_lc\\(.*\\);' => '', 'wp_kses_attr\\(.*\\);' => '', 'wp_kses_bad_protocol\\(.*\\);' => '', 'wp_kses_bad_protocol_once\\(.*\\);' => '', 'wp_kses_bad_protocol_once2\\(.*\\);' => '', 'wp_kses_check_attr_val\\(.*\\);' => '', 'wp_kses_decode_entities\\(.*\\);' => '', 'wp_kses_hair\\(.*\\);' => '', 'wp_kses_hook\\(.*\\);' => '', 'wp_kses_html_error\\(.*\\);' => '', 'wp_kses_js_entities\\(.*\\);' => '', 'wp_kses_no_null\\(.*\\);' => '', 'wp_kses_normalize_entities\\(.*\\);' => '', 'wp_kses_normalize_entities2\\(.*\\);' => '', 'wp_kses_split\\(.*\\);' => '', 'wp_kses_split2\\(.*\\);' => '', 'wp_kses_stripslashes\\(.*\\);' => '', 'wp_kses_version\\(.*\\);' => '', 'wp_make_link_relative\\(.*\\);' => '', 'wp_rel_nofollow\\(.*\\);' => '', 'wp_richedit_pre\\(.*\\);' => '', 'wp_specialchars\\(.*\\);' => '', 'zeroise\\(.*\\);' => '', 'current_time\\((.*)\\);' => 'echo date($1);', 'date_i18n\\(.*\\);' => '', 'get_calendar\\(.*\\);' => '', 'get_date_from_gmt\\(.*\\);' => '', 'get_lastpostdate\\(.*\\);' => '', 'get_lastpostmodified\\(.*\\);' => '', 'get_day_link\\(.*\\);' => '', 'get_gmt_from_date\\(.*\\);' => '', 'get_month_link\\(.*\\);' => '', 'get_the_time\\(.*\\);' => '', 'get_weekstartend\\(.*\\);' => '', 'get_year_link\\(.*\\);' => '', 'human_time_diff\\(.*\\);' => '', 'is_new_day\\(.*\\);' => '', 'iso8601_timezone_to_offset\\(.*\\);' => '', 'iso8601_to_datetime\\(.*\\);' => '', 'mysql2date\\(.*\\);' => '', 'is_serialized\\(.*\\);' => '', 'is_serialized_string\\(.*\\);' => '', 'maybe_serialize\\(.*\\);' => '', 'maybe_unserialize\\(.*\\);' => '', 'add_option\\(.*\\);' => '', 'delete_option\\(.*\\);' => '', 'form_option\\(.*\\);' => '', 'get_alloptions\\(.*\\);' => '', 'get_site_option\\(.*\\);' => '', 'get_site_url\\(.*\\);' => '', 'get_user_option\\(.*\\);' => '', 'get_option\\(.*\\);' => '', 'update_option\\(.*\\);' => '', 'update_user_option\\(.*\\);' => '', 'add_menu_page\\(.*\\);' => '', 'add_submenu_page\\(.*\\);' => '', 'add_object_page\\(.*\\);' => '', 'add_utility_page\\(.*\\);' => '', 'checked\\(.*\\);' => '', 'disabled\\(.*\\);' => '', 'selected\\(.*\\);' => '', 'check_admin_referer\\(.*\\);' => '', 'check_ajax_referer\\(.*\\);' => '', 'wp_create_nonce\\(.*\\);' => '', 'wp_explain_nonce\\(.*\\);' => '', 'wp_get_original_referer\\(.*\\);' => '', 'wp_get_referer\\(.*\\);' => '', 'wp_nonce_ays\\(.*\\);' => '', 'wp_nonce_field\\(.*\\);' => '', 'wp_nonce_url\\(.*\\);' => '', 'wp_original_referer_field\\(.*\\);' => '', 'wp_referer_field\\(.*\\);' => '', 'wp_verify_nonce\\(.*\\);' => '', 'xmlrpc_getpostcategory\\(.*\\);' => '', 'xmlrpc_getposttitle\\(.*\\);' => '', 'xmlrpc_removepostdata\\(.*\\);' => '', 'user_pass_ok\\(.*\\);' => '', 'spawn_cron\\(.*\\);' => '', 'wp_clear_scheduled_hook\\(.*\\);' => '', 'wp_cron\\(.*\\);' => '', 'wp_get_schedule\\(.*\\);' => '', 'wp_get_schedules\\(.*\\);' => '', 'wp_next_scheduled\\(.*\\);' => '', 'wp_reschedule_event\\(.*\\);' => '', 'wp_schedule_event\\(.*\\);' => '', 'wp_schedule_single_event\\(.*\\);' => '', 'wp_unschedule_event\\(.*\\);' => '', 'add_query_arg\\(.*\\);' => '', 'admin_url\\(.*\\);' => '', 'bool_from_yn\\(.*\\);' => '', 'cache_javascript_headers\\(.*\\);' => '', 'content_url\\(.*\\);' => '', 'do_robots\\(.*\\);' => '', 'get_bloginfo\\(.*\\);' => '', 'get_num_queries\\(.*\\);' => '', 'get_query_var\\(.*\\);' => '', 'home_url\\(.*\\);' => 'BASE_URL.view::url("/");', 'includes_url\\(.*\\);' => '', 'is_blog_installed\\(.*\\);' => '', 'is_main_site\\(.*\\);' => '', 'is_ssl\\(.*\\);' => '', 'log_app\\(.*\\);' => '', 'make_url_footnote\\(.*\\);' => '', 'nocache_headers\\(.*\\);' => '', 'remove_query_arg\\(.*\\);' => '', 'site_url\\(.*\\);' => '', 'status_header\\(.*\\);' => '', 'wp\\(.*\\);' => '', 'wp_check_filetype\\(.*\\);' => '', 'wp_clearcookie\\(.*\\);' => '', 'wp_die\\(.*\\);' => '', 'wp_footer\\(.*\\);' => 'Loader::element(\'footer_required\');', 'wp_get_cookie_login\\(.*\\);' => '', 'wp_get_http_headers\\(.*\\);' => '', 'wp_hash\\(.*\\);' => '', 'wp_head\\(.*\\);' => '', 'wp_mail\\(.*\\);' => '', 'wp_mkdir_p\\(.*\\);' => '', 'wp_new_user_notification\\(.*\\);' => '', 'wp_notify_moderator\\(.*\\);' => '', 'wp_notify_postauthor\\(.*\\);' => '', 'wp_parse_args\\(.*\\);' => '', 'wp_redirect\\(.*\\);' => '', 'wp_reset_postdata\\(.*\\);' => '', 'wp_reset_query\\(.*\\);' => '', 'wp_remote_fopen\\(.*\\);' => '', 'wp_salt\\(.*\\);' => '', 'wp_set_auth_cookie\\(.*\\);' => '', 'wp_upload_bits\\(.*\\);' => '', 'wp_upload_dir\\(.*\\);' => '', 'admin_notice_feed\\(.*\\);' => '', 'avoid_blog_page_permalink_collision\\(.*\\);' => '', 'check_import_new_users\\(.*\\);' => '', 'check_upload_size\\(.*\\);' => '', 'choose_primary_blog\\(.*\\);' => '', 'confirm_delete_users\\(.*\\);' => '', 'dashboard_quota\\(.*\\);' => '', 'display_space_usage\\(.*\\);' => '', 'format_code_lang\\(.*\\);' => '', 'get_site_allowed_themes\\(.*\\);' => '', 'get_space_allowed\\(.*\\);' => '', 'get_upload_space_available\\(.*\\);' => '', 'grant_super_admin\\(.*\\);' => '', 'is_upload_space_available\\(.*\\);' => '', 'ms_deprecated_blogs_file\\(.*\\);' => '', 'mu_dropdown_languages\\(.*\\);' => '', 'new_user_email_admin_notice\\(.*\\);' => '', 'redirect_user_to_blog\\(.*\\);' => '', 'refresh_user_details\\(.*\\);' => '', 'revoke_super_admin\\(.*\\);' => '', 'secret_salt_warning\\(.*\\);' => '', 'send_confirmation_on_profile_email\\(.*\\);' => '', 'show_post_thumbnail_warning\\(.*\\);' => '', 'site_admin_notice\\(.*\\);' => '', 'sync_category_tag_slugs\\(.*\\);' => '', 'update_option_new_admin_email\\(.*\\);' => '', 'update_user_status\\(.*\\);' => '', 'upload_size_limit_filter\\(.*\\);' => '', 'upload_space_setting\\(.*\\);' => '', 'wpmu_delete_blog\\(.*\\);' => '', 'wpmu_delete_user\\(.*\\);' => '', 'wpmu_get_blog_allowedthemes\\(.*\\);' => '', '_admin_notice_multisite_activate_plugins_page\\(.*\\);' => '', 'add_blog_option\\(.*\\);' => '', 'delete_blog_option\\(.*\\);' => '', 'get_blogaddress_by_domain\\(.*\\);' => '', 'get_blogaddress_by_id\\(.*\\);' => '', 'get_blogaddress_by_name\\(.*\\);' => '', 'get_blog_details\\(.*\\);' => '', 'get_blog_option\\(.*\\);' => '', 'get_blog_status\\(.*\\);' => '', 'get_id_from_blogname\\(.*\\);' => '', 'get_last_updated\\(.*\\);' => '', 'is_archived\\(.*\\);' => '', 'refresh_blog_details\\(.*\\);' => '', 'restore_current_blog\\(.*\\);' => '', 'switch_to_blog\\(.*\\);' => '', 'update_archived\\(.*\\);' => '', 'update_blog_details\\(.*\\);' => '', 'update_blog_option\\(.*\\);' => '', 'update_blog_status\\(.*\\);' => '', 'wpmu_update_blogs_date\\(.*\\);' => '', 'ms_upload_constants\\(.*\\);' => '', 'add_user_to_blog\\(.*\\);' => '', 'create_empty_blog\\(.*\\);' => '', 'domain_exists\\(.*\\);' => '', 'force_ssl_content\\(.*\\);' => '', 'get_active_blog_for_user\\(.*\\);' => '', 'get_admin_users_for_domain\\(.*\\);' => '', 'get_blog_post\\(.*\\);' => '', 'get_current_site\\(.*\\);' => '', 'get_dirsize\\(.*\\);' => '', 'get_user_id_from_string\\(.*\\);' => '', 'global_terms\\(.*\\);' => '', 'insert_blog\\(.*\\);' => '', 'install_blog\\(.*\\);' => '', 'is_blog_user\\(.*\\);' => '', 'is_email_address_unsafe\\(.*\\);' => '', 'is_user_spammy\\(.*\\);' => '', 'newblog_notify_siteadmin\\(.*\\);' => '', 'redirect_this_site\\(.*\\);' => '', 'update_blog_public\\(.*\\);' => '', 'users_can_register_signup_filter\\(.*\\);' => '', 'welcome_user_msg_filter\\(.*\\);' => '', 'wpmu_create_blog\\(.*\\);' => '', 'wpmu_create_user\\(.*\\);' => '', 'wpmu_signup_user\\(.*\\);' => '', 'wpmu_signup_user_notification\\(.*\\);' => '', 'wpmu_welcome_user_notification\\(.*\\);' => '', 'get_current_site_name\\(.*\\);' => '', 'is_subdomain_install\\(.*\\);' => '', 'ms_not_installed\\(.*\\);' => '', 'is_singular\\(.*\\);' => '', 'wp_enqueue_script\\(.*\\);' => '', 'esc_url\\((.*)\\);' => '$1', 'has_post_thumbnail\\(.*\\);' => '', 'get_post_thumbnail_id\\(.*\\);' => '', 'HEADER_IMAGE_WIDTH;' => '"1000px"', 'HEADER_IMAGE_HEIGHT;' => '"288px"', '_e\\((.*)\\);' => 't($1);', 'esc_attr_e\\(.*\\);' => '', 'have_posts\\(.*\\);' => '', 'post_class\\(.*\\);' => '', 'the_title\\(.*\\);' => 'echo $c->getCollectionName();', 'wp_link_pages\\(.*\\);' => '', 'edit_post_link\\(.*\\);' => '', 'twentyeleven_get_theme_options(.*);' => '', 'wp_register\\(.*\\);' => 'echo view::url("/register");', 'wp_loginout\\(.*\\);' => 'echo view::url("/login/logout");', 'wp_meta\\(.*\\);' => 'echo $c->getCollectionDescription();', 'esc_attrt\\(.*\\);' => '', 'is_admin\\(.*\\);' => '', 'is_home\\(.*\\)' => '$c->getCollectionID()==HOME_CID', 'wordpress' => 'concrete5', 'ifs*\\(s*;' => '', 'ifs*\\(' => '', '<\\?php s* \\?>' => ''); foreach ($array as $wp => $c5) { $contents = preg_replace("#{$wp}#smUi", "{$c5}", $contents); } $dir = DIRNAME_THEMES . '/' . $themename; if (is_dir($dir)) { $handle = opendir($dir); if ($handle) { while (($file = readdir($handle)) !== false) { $extension = substr(strrchr($file, '.'), 1); if (substr($file, 0, 1) != '.' and $extension == "php") { rename(DIRNAME_THEMES . '/' . $themename . '/' . $file, DIRNAME_THEMES . '/' . $themename . '/wp/' . $file); } } } } file_put_contents(DIRNAME_THEMES . '/' . $themename . '/default.php', $contents); } else { throw new exception(t('Wordpress theme doesn\'t contain index.php')); } } else { throw new exception(t('Wordpress theme doesn\'t contain style.css')); } } else { throw new exception(t('File uploaded incorrectly')); } }
public function usersProfileViewSidebarAds($user) { if (!$user['total_classifieds']) { return ''; } loader::helper('classifieds/classifieds'); echo classifieds_helper::getAds(array('user' => $user, 'limit' => 4, 'select_users' => false, 'template' => 'classifieds/helpers/classifieds_list')); }
public function usersProfileViewSidebarBlogs($user) { if (!$user['total_blogs']) { return ''; } loader::helper('blogs/blogs'); echo blogs_helper::getBlogs(array('user' => $user, 'limit' => 4, 'select_users' => false, 'template' => 'blogs/helpers/blogs_list')); }
public function usersProfileViewSidebarAlbums($user) { if (!$user['total_albums']) { return ''; } loader::helper('pictures/pictures'); echo pictures_helper::getAlbums(array('user' => $user, 'limit' => 4, 'select_users' => false)); }
public function __construct($totalnum = '', $maxnum = '', $key = "", $form_vars = array()) { $this->totalnum = $totalnum; $this->maxnum = $maxnum; $this->key = $key; $has_post = false; $this->navchar = array(lang::get('first'), '[<]', '[>]', lang::get('last')); $querystring = array($_GET["controller"] . "/" . $_GET["method"]); $form_vars && $this->setFormVars($form_vars); if (count($this->form_vars) > 0) { foreach ($this->form_vars as $val) { if ($_POST[$val]) { $querystring[] = $val . "/" . urlencode($_POST[$val]); $has_post = true; } } } if (count($_GET) > 0 && !$has_post) { foreach ($_GET as $key => $val) { if (!in_array($key, array("totalnum" . $this->key, "pagenum" . $this->key, "controller", "method"))) { $querystring[] = $key . "/" . urlencode($val); } } } if (isset($_GET["maxnum" . $this->key]) && $_GET["maxnum" . $this->key] > 0) { $this->maxnum = sprintf('%d', $_GET["maxnum" . $this->key]); } if ($this->maxnum < 1) { $this->maxnum = $this->totalnum; } if ($this->totalnum < 1) { $this->totalnum = 0; $this->totalpage = 0; $this->pagenum = 0; $this->startnum = 0; $this->endnum = 0; $this->shownum = 0; } else { $this->totalpage = ceil($this->totalnum / $this->maxnum); $this->pagenum = isset($_GET["pagenum" . $this->key]) && $_GET["pagenum" . $this->key] > 0 ? sprintf('%d', $_GET["pagenum" . $this->key]) : 1; if ($this->pagenum > $this->totalpage) { $this->pagenum = $this->totalpage; } $this->startnum = max(($this->pagenum - 1) * $this->maxnum, 0); $this->endnum = min($this->startnum + $this->maxnum, $this->totalnum); $this->shownum = $this->endnum - $this->startnum; } $querystring[] = "totalnum" . $this->key . "/" . $this->totalnum; if (isset($_GET["maxnum" . $this->key])) { $querystring[] = "maxnum" . $this->key . "/" . $this->maxnum; } loader::helper("url"); $this->linkhead = site_url(implode("/", $querystring)); }
public function usersSettingsAccountOptions($settings, $user = array()) { if (input::isCP()) { if (uri::segment(3) == 'edit') { loader::helper('array'); $expiration = array('name' => __('expire_date', 'users_account'), 'keyword' => 'expire_date', 'type' => 'date', 'value' => $user ? $user['expire_date'] : 0, 'rules' => array('valid_date'), 'select' => true); $credits = array('name' => __('credits_current', 'users_account'), 'keyword' => 'total_credits', 'type' => 'number', 'value' => $user ? $user['total_credits'] : 0, 'rules' => array('required' => 1, 'min_value' => 0)); $settings = array_helper::spliceArray($settings, 'group_id', $credits, 'total_credits'); $settings = array_helper::spliceArray($settings, 'group_id', $expiration, 'expire_date'); } } else { if (config::item('subscriptions_active', 'billing')) { $settings['subscription'] = array('name' => __('plan_current', 'users_account'), 'keyword' => 'subscription', 'type' => 'static', 'value' => config::item('usergroups', 'core', session::item('group_id')) . (session::item('expire_date') ? ' (' . __('expire_date', 'users_account') . ': ' . date_helper::formatDate(session::item('expire_date'), 'date') . ')' : '') . (session::permission('plans_purchase', 'billing') ? ' - ' . html_helper::anchor('billing/plans', __('plan_change', 'users_account')) : '')); } if (config::item('credits_active', 'billing')) { $settings['credits'] = array('name' => __('credits_current', 'users_account'), 'keyword' => 'subscription', 'type' => 'static', 'value' => session::item('total_credits') . (session::permission('credits_purchase', 'billing') ? ' - ' . html_helper::anchor('billing/credits', __('credits_purchase', 'users_account')) : '')); } } return $settings; }
public function __construct() { parent::__construct(); loader::helper('money'); }
protected function _get_currencies($setting) { loader::helper('money'); $setting['items'] = money_helper::currencies(); return $setting; }
view::load('comments/likes', array('resource' => 'blog', 'itemID' => $blog['blog_id'], 'likes' => $blog['total_likes'], 'liked' => $blog['user_vote']['post_date'] ? 1 : 0, 'date' => $blog['user_vote']['post_date'])); ?> </li> <?php } ?> </ul> </footer> </article> </div> <?php if (session::permission('comments_view', 'comments') && config::item('blog_comments', 'blogs') && $blog['comments']) { ?> <?php loader::helper('comments/comments'); ?> <?php comments_helper::getComments('blog', $blog['user_id'], $blog['blog_id'], $blog['total_comments'], $blog['comments']); ?> <?php } ?> </section> <?php view::load('footer');
* $Id$ */ //包含核心文件 require_once SYSTEMPATH . 'sf/sf.class.php'; require_once SYSTEMPATH . 'sf/config.class.php'; require_once SYSTEMPATH . 'sf/sfexception.class.php'; require_once SYSTEMPATH . 'sf/router.class.php'; require_once SYSTEMPATH . 'sf/loader.class.php'; require_once SYSTEMPATH . 'sf/language.class.php'; require_once SYSTEMPATH . 'sf/input.class.php'; //加载配置文件 config::load('default'); //加载必要库文件 loader::lib(array("controller", "model")); //加载默认helper loader::helper(config::get("auto_load_helper", 'url')); //加载默认插件 config::get("auto_load_plugin") && loader::plugin(config::get("auto_load_plugin")); //初始化pathinfo router::parse(); //加载语言文件 lang::setLang(config::get("default_lang", "chinese")); lang::load("global"); //执行控制器 $controller = sf::getController(router::getController()); try { method_exists($controller, "load") && $controller->load(); //存在LOAD方法执行LOAD方法(页面执行开始执行) if (!method_exists($controller, router::getMethod())) { throw new sfException(sprintf(lang::get("Call to undefined method %s::%s"), get_class($controller), router::getMethod())); }
public function resize($file, $dimensions, $suffix = '', $method = 'preserve') { // Set dimensions if (!is_array($dimensions) && $dimensions != '') { $dimensions = explode('x', $dimensions); } if ($dimensions) { // Load image library loader::library('image'); // Set source if (!$this->image->setSource(BASEPATH . $this->relativePath . '/' . $file['path'] . '/' . $file['name'] . ($file['suffix'] != '' ? '_' . $file['suffix'] : '') . '.' . $file['extension'])) { $this->setError($this->image->getError()); return false; } // Set target if (!$this->image->setTarget(BASEPATH . $this->relativePath . '/' . $file['path'] . '/' . $file['name'] . ($suffix != '' ? '_' . $suffix : '') . '.' . $file['extension'])) { $this->setError($this->image->getError()); return false; } // Resize image if (!$this->image->resize($dimensions[0], $dimensions[1], $method)) { $this->setError($this->image->getError()); return false; } $thumb = $this->image->getData(); } else { $source = BASEPATH . $this->relativePath . '/' . $file['path'] . '/' . $file['name'] . ($file['suffix'] != '' ? '_' . $file['suffix'] : '') . '.' . $file['extension']; $target = BASEPATH . $this->relativePath . '/' . $file['path'] . '/' . $file['name'] . ($suffix != '' ? '_' . $suffix : '') . '.' . $file['extension']; loader::helper('file'); $thumb = array('path' => $file['path'], 'name' => $file['name'], 'suffix' => $suffix, 'extension' => $file['extension'], 'size' => $file['size'], 'width' => $file['width'], 'height' => $file['height']); return file_helper::copy($source, $target) ? $thumb : false; } return $thumb; }
function loadInputType($questionData, $showEdit) { $options = explode('%%', $questionData['options']); $defaultDate = $questionData['defaultDate']; $msqID = intval($questionData['msqID']); $datetime = loader::helper('form/date_time'); $html = ''; switch ($questionData['inputType']) { case 'checkboxlist': // this is looking really crappy so i'm going to make it behave the same way all the time - andrew /* if (count($options) == 1){ if(strlen(trim($options[0]))==0) continue; $checked=($_REQUEST['Question'.$msqID.'_0']==trim($options[0]))?'checked':''; $html.= '<input name="Question'.$msqID.'_0" type="checkbox" value="'.trim($options[0]).'" '.$checked.' />'; }else{ */ $html .= '<div class="checkboxList">' . "\r\n"; for ($i = 0; $i < count($options); $i++) { if (strlen(trim($options[$i])) == 0) { continue; } $checked = $_REQUEST['Question' . $msqID . '_' . $i] == trim($options[$i]) ? 'checked' : ''; $html .= ' <div class="checkbox"><label><input name="Question' . $msqID . '_' . $i . '" type="checkbox" value="' . trim($options[$i]) . '" ' . $checked . ' /> <span>' . $options[$i] . '</span></label></div>' . "\r\n"; } $html .= '</div>'; //} return $html; case 'select': if ($this->frontEndMode) { $selected = !$_REQUEST['Question' . $msqID] ? 'selected="selected"' : ''; $html .= '<option value="" ' . $selected . '>----</option>'; } foreach ($options as $option) { $checked = $_REQUEST['Question' . $msqID] == trim($option) ? 'selected="selected"' : ''; $html .= '<option ' . $checked . '>' . trim($option) . '</option>'; } return '<select class="form-control" name="Question' . $msqID . '" id="Question' . $msqID . '" >' . $html . '</select>'; case 'radios': foreach ($options as $option) { if (strlen(trim($option)) == 0) { continue; } $checked = $_REQUEST['Question' . $msqID] == trim($option) ? 'checked' : ''; $html .= '<div class="radio"><label><input name="Question' . $msqID . '" type="radio" value="' . trim($option) . '" ' . $checked . ' /> <span>' . $option . '</span></label></div>'; } return $html; case 'fileupload': $html = '<input type="file" name="Question' . $msqID . '" class="form-control" id="Question' . $msqID . '" />'; return $html; case 'text': $val = $_REQUEST['Question' . $msqID] ? Loader::helper('text')->entities($_REQUEST['Question' . $msqID]) : ''; return '<textarea name="Question' . $msqID . '" class="form-control" id="Question' . $msqID . '" cols="' . $questionData['width'] . '" rows="' . $questionData['height'] . '">' . $val . '</textarea>'; case 'url': $val = $_REQUEST['Question' . $msqID] ? $_REQUEST['Question' . $msqID] : ''; return '<input name="Question' . $msqID . '" id="Question' . $msqID . '" class="form-control" type="url" value="' . stripslashes(htmlspecialchars($val)) . '" />'; case 'telephone': $val = $_REQUEST['Question' . $msqID] ? $_REQUEST['Question' . $msqID] : ''; return '<input name="Question' . $msqID . '" id="Question' . $msqID . '" class="form-control" type="tel" value="' . stripslashes(htmlspecialchars($val)) . '" />'; case 'email': $val = $_REQUEST['Question' . $msqID] ? $_REQUEST['Question' . $msqID] : ''; return '<input name="Question' . $msqID . '" id="Question' . $msqID . '" class="form-control" type="email" value="' . stripslashes(htmlspecialchars($val)) . '" />'; case 'date': $val = $_REQUEST['Question' . $msqID] ? $_REQUEST['Question' . $msqID] : $defaultDate; return $datetime->date('Question' . $msqID, $val); case 'datetime': if (isset($_REQUEST['Question' . $msqID])) { $val = $_REQUEST['Question' . $msqID]; } elseif ($_REQUEST['Question' . $msqID . '_dt'] && $_REQUEST['Question' . $msqID . '_h'] && $_REQUEST['Question' . $msqID . '_m'] && $_REQUEST['Question' . $msqID . '_a']) { $val = $_REQUEST['Question' . $msqID . '_dt'] . ' ' . $_REQUEST['Question' . $msqID . '_h'] . ':' . $_REQUEST['Question' . $msqID . '_m'] . ' ' . $_REQUEST['Question' . $msqID . '_a']; } else { $val = $defaultDate; } return $datetime->datetime('Question' . $msqID, $val); case 'field': default: $val = $_REQUEST['Question' . $msqID] ? $_REQUEST['Question' . $msqID] : ''; return '<input name="Question' . $msqID . '" id="Question' . $msqID . '" class="form-control" type="text" value="' . stripslashes(htmlspecialchars($val)) . '" />'; } }
<div class="home-box home-box-<?php echo $i == 1 || $i == 3 ? 'left' : 'right'; ?> <?php echo $item; ?> "> <h3><?php echo __($item . '_new', 'system_navigation'); ?> </h3> <?php loader::helper($item . '/' . $item); ?> <?php if ($item == 'blogs') { ?> <?php echo blogs_helper::getBlogs(array('join_columns' => array(), 'limit' => 5, 'truncate' => 200)); ?> <?php } elseif ($item == 'news') { ?> <?php echo news_helper::getNews(array('join_columns' => array(), 'limit' => 5, 'truncate' => 200)); ?> <?php
<?php /** * $Id: functions.php 273 2011-11-23 08:46:22Z lingter@gmail.com $ * Global functions * @author : Lingter * @support : http://meiupic.meiu.cn * @copyright : (c)2011 meiu.cn lingter@gmail.com */ loader::helper('system'); loader::helper('filesystem'); loader::helper('http'); loader::helper('string'); loader::helper('ui'); loader::helper('validate');
<?php defined('C5_EXECUTE') or die("Access Denied."); $datetime = loader::helper('form/date_time'); $publishDate = ''; if (isset($page) && is_object($page)) { $v = CollectionVersion::get($page, "RECENT"); $publishDate = $v->getPublishDate(); } if (Config::get('concrete.misc.user_timezones')) { $user = new User(); $userInfo = $user->getUserInfoObject(); $timezone = $userInfo->getUserTimezone(); } else { $timezone = Config::get('app.timezone'); } ?> <div class="form-group form-group-last"> <label class="control-label"><?php echo t('Date/Time'); ?> </label> <?php echo $datetime->datetime('check-in-scheduler', $publishDate, false, true, 'dark-panel-calendar'); ?> <span class="help-block" style="display: block"><?php echo t('Time Zone: %s', $timezone); ?> </span> </div>
public function delete($language) { loader::helper('file'); $path = DOCPATH . 'languages/' . $language; // Delete files if (@is_dir($path)) { foreach (file_helper::scanFileNames($path) as $file) { @unlink($path . '/' . $file); } @rmdir($path); } return true; }