Changeset 1131247
- Timestamp:
- 04/09/2015 02:54:07 PM (11 years ago)
- Location:
- questions
- Files:
-
- 66 added
- 9 deleted
- 11 edited
-
tags/1.0.0 beta 5 (added)
-
tags/1.0.0 beta 5/README.txt (added)
-
tags/1.0.0 beta 5/components (added)
-
tags/1.0.0 beta 5/components/admin (added)
-
tags/1.0.0 beta 5/components/admin/admin.php (added)
-
tags/1.0.0 beta 5/components/admin/includes (added)
-
tags/1.0.0 beta 5/components/admin/includes/js (added)
-
tags/1.0.0 beta 5/components/admin/includes/js/admin-questions-post-type.js (added)
-
tags/1.0.0 beta 5/components/admin/pages (added)
-
tags/1.0.0 beta 5/components/admin/pages/settings.php (added)
-
tags/1.0.0 beta 5/components/charts (added)
-
tags/1.0.0 beta 5/components/charts/chart-creator-c3.php (added)
-
tags/1.0.0 beta 5/components/charts/chart-creator-dimple.php (added)
-
tags/1.0.0 beta 5/components/charts/chart-creator.php (added)
-
tags/1.0.0 beta 5/components/charts/charts.php (added)
-
tags/1.0.0 beta 5/components/charts/data-abstraction.php (added)
-
tags/1.0.0 beta 5/components/charts/includes (added)
-
tags/1.0.0 beta 5/components/charts/includes/3rdparty (added)
-
tags/1.0.0 beta 5/components/charts/includes/3rdparty/d3 (added)
-
tags/1.0.0 beta 5/components/charts/includes/3rdparty/d3/LICENSE (added)
-
tags/1.0.0 beta 5/components/charts/includes/3rdparty/d3/d3.js (added)
-
tags/1.0.0 beta 5/components/charts/includes/3rdparty/d3/d3.min.js (added)
-
tags/1.0.0 beta 5/components/charts/includes/3rdparty/dimple (added)
-
tags/1.0.0 beta 5/components/charts/includes/3rdparty/dimple/dimple.v2.1.0.js (added)
-
tags/1.0.0 beta 5/components/charts/includes/3rdparty/dimple/dimple.v2.1.0.min.js (added)
-
tags/1.0.0 beta 5/components/charts/shortcodes.php (added)
-
tags/1.0.0 beta 5/components/component.php (added)
-
tags/1.0.0 beta 5/components/core (added)
-
tags/1.0.0 beta 5/components/core/core.php (added)
-
tags/1.0.0 beta 5/components/core/export.php (added)
-
tags/1.0.0 beta 5/components/core/process-response.php (added)
-
tags/1.0.0 beta 5/components/core/questions.php (added)
-
tags/1.0.0 beta 5/components/core/shortcodes.php (added)
-
tags/1.0.0 beta 5/components/core/tools (added)
-
tags/1.0.0 beta 5/components/core/tools/post.php (added)
-
tags/1.0.0 beta 5/components/core/tools/survey.php (added)
-
tags/1.0.0 beta 5/components/element.php (added)
-
tags/1.0.0 beta 5/components/elements (added)
-
tags/1.0.0 beta 5/components/elements/description.php (added)
-
tags/1.0.0 beta 5/components/elements/dropdown.php (added)
-
tags/1.0.0 beta 5/components/elements/elements.php (added)
-
tags/1.0.0 beta 5/components/elements/multiplechoice.php (added)
-
tags/1.0.0 beta 5/components/elements/onechoice.php (added)
-
tags/1.0.0 beta 5/components/elements/separator.php (added)
-
tags/1.0.0 beta 5/components/elements/splitter.php (added)
-
tags/1.0.0 beta 5/components/elements/text.php (added)
-
tags/1.0.0 beta 5/components/elements/textarea.php (added)
-
tags/1.0.0 beta 5/components/survey.php (added)
-
tags/1.0.0 beta 5/functions.php (added)
-
tags/1.0.0 beta 5/includes (added)
-
tags/1.0.0 beta 5/includes/css (added)
-
tags/1.0.0 beta 5/includes/css/admin.css (added)
-
tags/1.0.0 beta 5/includes/css/display.css (added)
-
tags/1.0.0 beta 5/includes/css/fonts (added)
-
tags/1.0.0 beta 5/includes/css/fonts.css (added)
-
tags/1.0.0 beta 5/includes/css/fonts/questions.eot (added)
-
tags/1.0.0 beta 5/includes/css/fonts/questions.svg (added)
-
tags/1.0.0 beta 5/includes/css/fonts/questions.ttf (added)
-
tags/1.0.0 beta 5/includes/css/fonts/questions.woff (added)
-
tags/1.0.0 beta 5/init.php (added)
-
tags/1.0.0 beta 5/languages (added)
-
tags/1.0.0 beta 5/languages/plugin.po (added)
-
tags/1.0.0 beta 5/languages/questions-locale-de_DE.mo (added)
-
tags/1.0.0 beta 5/languages/questions-locale-de_DE.po (added)
-
tags/1.0.0 beta 5/testing (added)
-
tags/1.0.0 beta 5/testing/main.php (added)
-
trunk/README.txt (modified) (1 diff)
-
trunk/assets/banner-772x250.png (deleted)
-
trunk/assets/icon-128x128.png (deleted)
-
trunk/assets/icon-256x256.png (deleted)
-
trunk/assets/screenshot-1.png (deleted)
-
trunk/assets/screenshot-2.png (deleted)
-
trunk/assets/screenshot-3.png (deleted)
-
trunk/assets/screenshot-4.png (deleted)
-
trunk/assets/screenshot-5.png (deleted)
-
trunk/assets/screenshot-6.png (deleted)
-
trunk/components/admin/admin.php (modified) (3 diffs)
-
trunk/components/charts/shortcodes.php (modified) (2 diffs)
-
trunk/components/core/process-response.php (modified) (2 diffs)
-
trunk/components/core/shortcodes.php (modified) (1 diff)
-
trunk/components/element.php (modified) (1 diff)
-
trunk/components/survey.php (modified) (1 diff)
-
trunk/includes/css/admin.css (modified) (2 diffs)
-
trunk/init.php (modified) (1 diff)
-
trunk/languages/questions-locale-de_DE.mo (modified) (previous)
-
trunk/languages/questions-locale-de_DE.po (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
questions/trunk/README.txt
r1130499 r1131247 66 66 == Changelog == 67 67 68 = 1.0.0 beta 5 = 69 * Added Questions Shortcode for embedding surveys 70 * Fixed some translation fails 71 68 72 = 1.0.0 beta 4 = 69 73 * Min length of 0 is possible too now -
questions/trunk/components/admin/admin.php
r1128186 r1131247 288 288 $checked_yes = ' checked="checked"'; 289 289 290 $html = '<div class="questions- resultsettings-value">';290 $html = '<div class="questions-options">'; 291 291 $html.= '<p><label for="show_results">' . __( 'Show results after finishing survey', 'questions-locale' ) . '</label></p>'; 292 292 $html.= '<input type="radio" name="show_results" value="yes"' . $checked_yes .'>' . __( 'Yes') . ' '; … … 295 295 296 296 ob_start(); 297 do_action( 'questions_survey_ result_settings', $survey_id );297 do_action( 'questions_survey_options', $survey_id ); 298 298 $html.= ob_get_clean(); 299 299 … … 341 341 add_meta_box( 342 342 'survey-options', 343 __( ' Result Settings', 'questions-locale' ),343 __( 'Options', 'questions-locale' ), 344 344 array( $this, 'meta_box_survey_options' ), 345 345 'questions', -
questions/trunk/components/charts/shortcodes.php
r1128186 r1131247 39 39 add_shortcode( 'question_results', array( __CLASS__ , 'sc_question_results' ) ); 40 40 41 add_action( 'questions_survey_ result_settings', array( __CLASS__ , 'show_survey_result_shortcode' ) );41 add_action( 'questions_survey_options', array( __CLASS__ , 'show_survey_result_shortcode' ) ); 42 42 add_action( 'questions_element_admin_tabs_content', array( __CLASS__ , 'show_question_result_shortcode' ) ); 43 43 } … … 91 91 92 92 public static function show_survey_result_shortcode( $survey_id ){ 93 $html = '<div class="questions- resultsettings-valueshortcode">';94 $html.= '<label for="survey_results_shortcode">' . __( ' Shortcode:', 'questions-locale' ) . '</label>';95 $html.= '<input type="text" id="survey_ results_shortcode" value="[survey_results id=' . $survey_id . ']" />';93 $html = '<div class="questions-options shortcode">'; 94 $html.= '<label for="survey_results_shortcode">' . __( 'Results Shortcode:', 'questions-locale' ) . '</label><br />'; 95 $html.= '<input type="text" id="survey_questions_shortcode" value="[survey_results id=' . $survey_id . ']" />'; 96 96 $html.= '</div>'; 97 97 -
questions/trunk/components/core/process-response.php
r1128186 r1131247 67 67 } 68 68 69 p rivatefunction show_survey( $survey_id ){69 public function show_survey( $survey_id ){ 70 70 if( TRUE === $this->check_restrictions( $survey_id ) ): 71 71 return $this->survey_form( $survey_id ); … … 233 233 return; 234 234 235 $questions_survey_id = $_POST[ 'questions_id' ]; 236 235 237 // Post Type is questions or die 236 if( 'questions' != $wp_object->query_vars[ 'post_type' ] ) 237 return; 238 239 // Getting Survey id from post or die 240 if( array_key_exists( 'name', $wp_object->query_vars) ): 241 $sql = $wpdb->prepare( "SELECT ID FROM {$wpdb->prefix}posts WHERE post_name = %s AND post_type='questions'", $wp_object->query_vars[ 'name' ] ); 242 $questions_survey_id = $wpdb->get_var( $sql ); 243 elseif( array_key_exists( 'p', $wp_object->query_vars) ): 244 $questions_survey_id = $wp_object->query_vars[ 'p' ]; 245 else: 246 return; 247 endif; 238 if( !qu_survey_exists( $questions_survey_id ) ) 239 return; 248 240 249 241 if( TRUE !== $this->check_restrictions( $questions_survey_id ) ) -
questions/trunk/components/core/shortcodes.php
r1127623 r1131247 35 35 var $question_types = array(); 36 36 37 public function __construct(){ 38 add_shortcode( 'questions', array( $this, 'questions' ) ); 37 public static function init(){ 38 add_shortcode( 'survey', array( __CLASS__, 'survey' ) ); 39 add_action( 'questions_survey_options', array( __CLASS__ , 'show_survey_shortcode' ), 5 ); 39 40 } 40 41 41 public function questions( $atts ){42 public static function survey( $atts ){ 42 43 global $Questions_ProcessResponse; 43 extract( shortcode_atts( array( 44 45 $atts = shortcode_atts( array( 44 46 'id' => '', 45 47 'title' => __( 'Survey', 'questions-locale' ) 46 48 ), 47 $atts ) );49 $atts ); 48 50 49 if( '' == = $id):51 if( '' == $atts[ 'id' ] ): 50 52 _e( 'Please enter an id in the survey shortcode!', 'questions-locale' ); 51 53 return; 52 54 endif; 53 55 54 echo $Questions_ProcessResponse->get_survey( $id ); 56 if( !qu_survey_exists( $atts[ 'id' ] ) ): 57 _e( 'Survey not found. Please enter another ID in your shortcode.', 'questions-locale' ); 58 return; 59 endif; 60 61 echo $Questions_ProcessResponse->show_survey( $atts[ 'id' ] ); 62 } 63 64 public static function show_survey_shortcode( $survey_id ){ 65 $html = '<div class="questions-options shortcode">'; 66 $html.= '<label for="survey_results_shortcode">' . __( 'Survey Shortcode:', 'questions-locale' ) . '</label><br />'; 67 $html.= '<input type="text" id="survey_results_shortcode" value="[survey id=' . $survey_id . ']" />'; 68 $html.= '</div>'; 69 70 echo $html; 55 71 } 56 72 } 57 $QuestionsShortCodes = new QuestionsShortCodes();73 QuestionsShortCodes::init(); -
questions/trunk/components/element.php
r1130499 r1131247 520 520 private function admin_widget_settings_tab_field( $name, $field ){ 521 521 $widget_id = $this->admin_get_widget_id(); 522 $value = ''; 522 523 523 524 if( array_key_exists( $name, $this->settings ) ) -
questions/trunk/components/survey.php
r1128186 r1131247 224 224 } 225 225 } 226 function qu_survey_exists( $survey_id ){ 227 global $wpdb; 228 229 $sql = $wpdb->prepare( "SELECT COUNT( ID ) FROM {$wpdb->prefix}posts WHERE ID = %d and post_type = 'questions'", $survey_id ); 230 $var = $wpdb->get_var( $sql ); 231 232 if( $var > 0 ) 233 return TRUE; 234 235 return FALSE; 236 } -
questions/trunk/includes/css/admin.css
r1128186 r1131247 97 97 } 98 98 .survey_element_tabs .shortcode, 99 .questions- resultsettings-value.shortcode{99 .questions-options.shortcode{ 100 100 background-color: #f7f7f7; 101 101 margin-top:20px; … … 103 103 border: 1px solid #e5e5e5; 104 104 } 105 #questions-content .survey_element_tabs .shortcode .shortcode_input, 106 .questions-resultsettings-value #survey_results_shortcode{ 105 .questions-options input[type="text"]{ 106 background-color: #f7f7f7; 107 font-size: 11px; 108 height: 25px; 109 width:100%; 110 } 111 #questions-content .survey_element_tabs .shortcode .shortcode_input{ 107 112 background-color: #f7f7f7; 108 113 font-size: 11px; -
questions/trunk/init.php
r1130499 r1131247 4 4 Plugin URI: http://www.awesome.ug 5 5 Description: Drag & drop your survey/poll with the WordPress Questions plugin. 6 Version: 1.0.0 beta 46 Version: 1.0.0 beta 5 7 7 Author: awesome.ug 8 8 Author URI: http://www.awesome.ug -
questions/trunk/languages/questions-locale-de_DE.po
r1128186 r1131247 3 3 "Project-Id-Version: SurveyVal v1.0\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2015-04-0 5 14:50+0100\n"6 "PO-Revision-Date: 2015-04-0 5 15:02+0100\n"5 "POT-Creation-Date: 2015-04-09 15:39+0100\n" 6 "PO-Revision-Date: 2015-04-09 15:41+0100\n" 7 7 "Last-Translator: Sven Wagener <sven.wagener@rheinschmiede.de>\n" 8 8 "Language-Team: \n" … … 45 45 46 46 # @ surveyval-locale 47 #: ../components/admin/admin.php:72 ../components/element.php:32 247 #: ../components/admin/admin.php:72 ../components/element.php:323 48 48 msgid "Settings" 49 49 msgstr "Einstellungen" … … 66 66 #: ../components/admin/admin.php:163 67 67 msgid "All visitors of the site can participate the poll" 68 msgstr "Alle Besucher der Seite kön enn an der Umfrage teilnehmen"68 msgstr "Alle Besucher der Seite können an der Umfrage teilnehmen" 69 69 70 70 #: ../components/admin/admin.php:164 71 71 msgid "All members of the site can participate the poll" 72 msgstr "Alle Mitglieder der Seite kön enn an der Umfrage teilnehmen"72 msgstr "Alle Mitglieder der Seite können an der Umfrage teilnehmen" 73 73 74 74 #: ../components/admin/admin.php:165 … … 130 130 # @ surveyval-locale 131 131 #: ../components/admin/admin.php:251 ../components/admin/admin.php:850 132 #: ../components/element.php:44 7 ../components/element.php:490132 #: ../components/element.php:448 ../components/element.php:491 133 133 msgid "Delete" 134 134 msgstr "Löschen" … … 141 141 # @ surveyval-locale 142 142 #: ../components/admin/admin.php:292 ../components/admin/admin.php:851 143 #: ../components/element.php:6 48143 #: ../components/element.php:650 144 144 msgid "Yes" 145 145 msgstr "Ja" … … 147 147 # @ surveyval-locale 148 148 #: ../components/admin/admin.php:293 ../components/admin/admin.php:852 149 #: ../components/element.php:65 0149 #: ../components/element.php:652 150 150 msgid "No" 151 151 msgstr "Nein" … … 176 176 "Sie könenn Teilnehmer einladen, sobald die Umfrage gespeichert ist." 177 177 178 # @ surveyval-locale179 178 #: ../components/admin/admin.php:343 180 msgid " Result Settings"181 msgstr " Ergebnis-Einstellungen"179 msgid "Options" 180 msgstr "Optionen" 182 181 183 182 #: ../components/admin/admin.php:350 … … 347 346 348 347 #: ../components/charts/shortcodes.php:94 348 msgid "Results Shortcode:" 349 msgstr "Ergebnis-Shortcode:" 350 349 351 #: ../components/charts/shortcodes.php:103 352 msgid "(CTRL+C and paste into post to embed question results in post)" 353 msgstr "" 354 "(STRG +C und anschließend in Post einfügen um die Ergebnisse der Frage " 355 "anzuzeigen)" 356 357 #: ../components/charts/shortcodes.php:104 350 358 msgid "Shortcode:" 351 359 msgstr "Shortcode:" 352 353 #: ../components/charts/shortcodes.php:102354 msgid "(CTRL+C and paste into post to embed question results in post)"355 msgstr ""356 "(STRG +C und anschließend in Post einfügen um die Ergebnisse der Frage "357 "anzuzeigen)"358 360 359 361 # @ surveyval-locale … … 425 427 426 428 # @ surveyval-locale 427 #: ../components/core/core.php:88 ../components/core/shortcodes.php:4 5429 #: ../components/core/core.php:88 ../components/core/shortcodes.php:47 428 430 msgid "Survey" 429 431 msgstr "Umfrage" … … 508 510 509 511 # @ surveyval-locale 510 #: ../components/core/shortcodes.php:5 0512 #: ../components/core/shortcodes.php:52 511 513 msgid "Please enter an id in the survey shortcode!" 512 514 msgstr "Bitte geb eine id im Umfragen-Shortcode an!" 513 515 514 516 # @ surveyval-locale 515 #: ../components/element.php:59 517 #: ../components/core/shortcodes.php:57 518 msgid "Survey not found. Please enter another ID in your shortcode." 519 msgstr "" 520 "Umfrage nicht gefunden. Bitte geben Sie eine andere ID im Sportcode an." 521 522 #: ../components/core/shortcodes.php:66 523 msgid "Survey Shortcode:" 524 msgstr "Umfrage-Shortcode:" 525 526 # @ surveyval-locale 527 #: ../components/element.php:60 516 528 msgid "This is a Questions Survey Element." 517 529 msgstr "Dies ist ein Questions Umfrage-Element." 518 530 519 #: ../components/element.php:24 5531 #: ../components/element.php:246 520 532 msgid "No HTML for Element given. Please check element sourcecode." 521 533 msgstr "" … … 524 536 525 537 # @ surveyval-locale 526 #: ../components/element.php:31 8538 #: ../components/element.php:319 527 539 msgid "Question" 528 540 msgstr "Frage" 529 541 530 542 # @ surveyval-locale 531 #: ../components/element.php:35 4 ../components/element.php:579543 #: ../components/element.php:355 ../components/element.php:581 532 544 msgid "Delete element" 533 545 msgstr "Element löschen" 534 546 535 547 # @ surveyval-locale 536 #: ../components/element.php:39 4548 #: ../components/element.php:395 537 549 msgid "Answer/s:" 538 550 msgstr "Antwort/en:" 539 551 540 552 # @ surveyval-locale 541 #: ../components/element.php:50 4553 #: ../components/element.php:505 542 554 msgid "Add Answer" 543 555 msgstr "Antwort hinzufügen" … … 545 557 # @ surveyval-locale 546 558 #: ../components/elements/description.php:18 547 #: ../components/elements/dropdown.php:6 1548 #: ../components/elements/multiplechoice.php:5 2549 #: ../components/elements/onechoice.php:5 1../components/elements/text.php:32559 #: ../components/elements/dropdown.php:62 560 #: ../components/elements/multiplechoice.php:53 561 #: ../components/elements/onechoice.php:52 ../components/elements/text.php:32 550 562 #: ../components/elements/textarea.php:32 551 563 msgid "Description" … … 574 586 "Eine Frage hinzufügen, die mittels eines Dropdown Feldes beantwortet wird." 575 587 576 #: ../components/elements/dropdown.php:3 8577 #: ../components/elements/multiplechoice.php:3 4578 #: ../components/elements/onechoice.php:3 4588 #: ../components/elements/dropdown.php:39 589 #: ../components/elements/multiplechoice.php:35 590 #: ../components/elements/onechoice.php:35 579 591 msgid "You don´t entered any answers. Please add some to display answers here." 580 592 msgstr "Es wird keine Antwort vorgegeben." 581 593 582 #: ../components/elements/dropdown.php:4 2594 #: ../components/elements/dropdown.php:43 583 595 msgid "Please select" 584 596 msgstr "Bitte wählen" 585 597 586 #: ../components/elements/dropdown.php:6 3587 #: ../components/elements/multiplechoice.php:5 4588 #: ../components/elements/onechoice.php:5 3../components/elements/text.php:34598 #: ../components/elements/dropdown.php:64 599 #: ../components/elements/multiplechoice.php:55 600 #: ../components/elements/onechoice.php:54 ../components/elements/text.php:34 589 601 #: ../components/elements/textarea.php:34 590 602 msgid "The description will be shown after the question." 591 603 msgstr "Die Beschreibung wird unter der Frage angezeigt." 592 604 593 #: ../components/elements/dropdown.php:7 3594 #: ../components/elements/onechoice.php:6 3605 #: ../components/elements/dropdown.php:74 606 #: ../components/elements/onechoice.php:64 595 607 msgid "Please select a value." 596 608 msgstr "Bitte wählen Sie einen Wert" … … 614 626 615 627 # @ surveyval-locale 616 #: ../components/elements/multiplechoice.php:5 8628 #: ../components/elements/multiplechoice.php:59 617 629 msgid "Minimum Answers" 618 630 msgstr "Minimale Anzahl an Antworten" 619 631 620 632 # @ surveyval-locale 621 #: ../components/elements/multiplechoice.php:6 0633 #: ../components/elements/multiplechoice.php:61 622 634 msgid "The minimum number of answers which have to be choosed." 623 635 msgstr "Die minimale Anzahl an Antworten, welche gewählt werden kann." 624 636 625 637 # @ surveyval-locale 626 #: ../components/elements/multiplechoice.php:6 4638 #: ../components/elements/multiplechoice.php:65 627 639 msgid "Maximum Answers" 628 640 msgstr "Maximale Anzahl an Antworten" 629 641 630 642 # @ surveyval-locale 631 #: ../components/elements/multiplechoice.php:6 6643 #: ../components/elements/multiplechoice.php:67 632 644 msgid "The maximum number of answers which can be choosed." 633 645 msgstr "Die maximale Anzahl an Antworten, welche eingegeben werden kann." 634 646 635 #: ../components/elements/multiplechoice.php:8 0647 #: ../components/elements/multiplechoice.php:81 636 648 msgid "Too less choices." 637 649 msgstr "Zu wenig Angaben." 638 650 639 651 # @ surveyval-locale 640 #: ../components/elements/multiplechoice.php:8 0641 #: ../components/elements/multiplechoice.php:8 6652 #: ../components/elements/multiplechoice.php:81 653 #: ../components/elements/multiplechoice.php:87 642 654 #, php-format 643 655 msgid "You have to choose between %d and %d answers." 644 656 msgstr "Sie müssen zwischen %d und %d Antworten auswählen." 645 657 646 #: ../components/elements/multiplechoice.php:8 6658 #: ../components/elements/multiplechoice.php:87 647 659 msgid "Too many choices." 648 660 msgstr "Zu viele Angaben." … … 776 788 #: ../components/elements/textarea.php:18 777 789 msgid "Textarea" 778 msgstr "Text ara"790 msgstr "Textfeld" 779 791 780 792 # @ surveyval-locale … … 892 904 msgstr "Vergessen Sie nicht, die Umfrage zu beantworten" 893 905 906 # @ surveyval-locale 907 #~ msgid "Result Settings" 908 #~ msgstr "Ergebnis-Einstellungen" 909 894 910 #~ msgid "Show Results" 895 911 #~ msgstr "Ergebnisse anzeigen" 896 897 #~ msgid "Survey Options"898 #~ msgstr "Umfrage-Optionen"899 912 900 913 #~ msgid "Size"
Note: See TracChangeset
for help on using the changeset viewer.