diff --git a/inc/lang/ar_arabic/admin/general.ini b/inc/lang/ar_arabic/admin/general.ini new file mode 100644 index 0000000..a2f94cf --- /dev/null +++ b/inc/lang/ar_arabic/admin/general.ini @@ -0,0 +1,34 @@ +hello = "ما الجديد، %s؟" +add = "أضف" +save = "حفظ" +cancel = "إلغاء" +say_yes = "نعم" +say_no = "لا" +close = "إغلاق" +manage = "إدارة" +upload = "رفع" +delete = "حذف" +edit = "تحرير" +change = "تغيير" +login_failure = "!اسم المستخدم أو كلمة المرور خاطئة" +login_attempts = "تم بلوغ أقصى حد للمحاولة. انتظر %s " +sign_in = "الدخول" +remember_me = "تذكرني" +username = "اسم المستخدم" +password = "كلمة السر" +actions = "أعمال" +title = "العنوان" +name = "اسم" +lang = "لغة" +theme = "السمة" +template = "قالب" +can_be_empty = "يمكن أن تكون فارغة" +empty_inputs = "املأ جميع الحقول المطلوبة!" +logout = "خروج" +show_site = "عرض الموقع" +settings = "إعدادات" +unsaved_warning = "لم تحفظ التغييرات! هل أنت متأكد أنك تريد مغادرة هذه الصفحة؟" +update_available = "التحديث متاح" +file = "ملف" +unknown_method = "المسار المطلوب غير موجود." +empty_array = "لا توجد عناصر لعرضها." \ No newline at end of file diff --git a/inc/modules/blog/lang/admin/ar_arabic.ini b/inc/modules/blog/lang/admin/ar_arabic.ini new file mode 100644 index 0000000..2a332c9 --- /dev/null +++ b/inc/modules/blog/lang/admin/ar_arabic.ini @@ -0,0 +1,72 @@ +module_name = "المدونة" +module_desc = "إنشاء مداخل في مدونة." +add_new = "اضف جديد" +new_post = "اضف جديد" +categories = "فئات" +post_count = "المشاركات:" +edit_post = "تعديل المنشور" +post_del_confirm = "هل أنت متأكد من حذف المشاركات المختارة؟" +settings = "إعدادات" +blog_title = "عنوان المدونة" +blog_desc = "وصف" +perpage = "المشاركات في كل صفحة" +latest_posts_count = "عدد المشاركات في كل صفحة" +disqus_shortname = "Disqus الاسم المختصر" +date_format = "صيغة التاريخ" +settings_saved = "تم حفظ الإعدادات" +manage_title = "عنوان" +manage_status = "حالة" +manage_author = "كاتب" +manage_comments = "تعليقات" +manage_date = "تاريخ" +comments_on = "مفعل" +comments_off = "غير مفعل" +post_hidden = "غير منشور" +post_sketch = "مسودة" +post_published = "منشور" +content = "محتوى" +intro = "مقدمة" +slug = "رابط مختصر" +status = "حالة" +tags = "وسم" +add_a_tag = "أضف وسم" +author = "كاتب" +publish = "انشر في" +options = "خيارات" +display_comments = "إظهار تعليقات Disqus" +markdown = "تمكين Markdown" +cover = "صورة الغلاف" +delete_photo = "حذف" +save_success = "تم حفظ المنشور بنجاح" +save_failure = "فشل حفظ المنشور" +delete_success = "تم حذف المنشور بنجاح" +delete_failure = "فشل حذف المنشور" +cover_deleted = "تم حذف صورة الغلاف" +not_found = "عفوًا .. المنشور غير موجود :(" +editor_upload_fail = "لا يمكن تحميل الصورة. ربما نوع غير مدعوم." +today = "اليوم" +yesterday = "الأمس" +janx = "يناير" +febx = "فبراير" +marx = "مارس" +aprx = "أبريل" +mayx = "ماي" +junx = "يونيو" +julx = "يوليوز" +augx = "غشت" +sepx = "شتنبر" +octx = "أكتوبر" +novx = "نونبر" +decx = "ديسمبر" +jan = "يناير" +feb = "فبراير" +mar = "مارس" +apr = "أبريل" +may = "ماي" +jun = "يونيو" +jul = "يوليوز" +aug = "غشت" +sep = "شتنبر" +oct = "أكتوبر" +nov = "نونبر" +dec = "دجنبر" \ No newline at end of file diff --git a/inc/modules/blog/lang/ar_arabic.ini b/inc/modules/blog/lang/ar_arabic.ini new file mode 100644 index 0000000..c061695 --- /dev/null +++ b/inc/modules/blog/lang/ar_arabic.ini @@ -0,0 +1,36 @@ +post_draft = "هذه المشاركة لها حالة مسودة . يمكن للمسؤول فقط رؤية هذا." +post_time = "لم يتم نشر هذا المنشور بعد. يمكن للمسؤول فقط رؤية هذا." +latest_posts = "آخر المشاركات" +categories = "فئات" +readmore = "أكمل القراءة" +share = "مشاركة" +posted = "كتبها %s في %s" +older = "أقدم المشاركات" +newer = "أحدث المشاركات" +no_comments = "بدون تعليقات" +today = "اليوم" +yesterday = "الأمس" +janx = "يناير" +febx = "فبراير" +marx = "مارس" +aprx = "أبريل" +mayx = "ماي" +junx = "يونيو" +julx = "يوليوز" +augx = "غشت" +sepx = "شتنبر" +octx = "أكتوبر" +novx = "نونبر" +decx = "ديسمبر" +jan = "يناير" +feb = "فبراير" +mar = "مارس" +apr = "أبريل" +may = "ماي" +jun = "يونيو" +jul = "يوليوز" +aug = "غشت" +sep = "شتنبر" +oct = "أكتوبر" +nov = "نونبر" +dec = "دجنبر" \ No newline at end of file diff --git a/inc/modules/carousel/lang/admin/ar_arabic.ini b/inc/modules/carousel/lang/admin/ar_arabic.ini new file mode 100644 index 0000000..a465158 --- /dev/null +++ b/inc/modules/carousel/lang/admin/ar_arabic.ini @@ -0,0 +1,2 @@ +module_name = "دائري" +module_desc = "عرض شرائح دوري. يتطلب وحدة المعرض." \ No newline at end of file diff --git a/inc/modules/contact/lang/admin/ar_arabic.ini b/inc/modules/contact/lang/admin/ar_arabic.ini new file mode 100644 index 0000000..4a061ad --- /dev/null +++ b/inc/modules/contact/lang/admin/ar_arabic.ini @@ -0,0 +1,20 @@ +module_name = "اتصال" +module_desc = "عرض نموذج الاتصال على الصفحة." +recipient = "متلقي" +custom = "- عنوان بريد إلكتروني مخصص -" +or_mail = "أو عنوان بريد إلكتروني مخصص" +example = "مثال: contact@johndoe.com" +save_success = "تم حفظ بيانات الاتصال." +save_failure = "فشل في حفظ بيانات الاتصال." +info = "ضع هذه العلامة في قالب الموقع" +checkbox = "مطلوب حقل مربع" +checkbox_content = "المحتوى لقبوله" +phpmailer_error = "معذرةً ، لا يمكنني العثور على فئة PHPMailer. من فضلك ، قم بتنفيذ الملحن يتطلب phpmailer / phpmailer في محطة مشروعك." +driver = "سائق البريد" +mail = "mail() (default)" +phpmailer = "PHPMailer (SMTP)" +server = "خادم" +port = "البوابة" +username = "اسم المستخدم" +password = "كلمة السر" +name = "اسم المرسل" \ No newline at end of file diff --git a/inc/modules/contact/lang/ar_arabic.ini b/inc/modules/contact/lang/ar_arabic.ini new file mode 100644 index 0000000..2a6d1a1 --- /dev/null +++ b/inc/modules/contact/lang/ar_arabic.ini @@ -0,0 +1,10 @@ +full_name = "الإسم الكامل" +email = "البريد الإلكتروني" +subject = "الموضوع" +message = "الرسالة" +send = "إرسال" +send_success = "تم إرسال البريد بنجاح. وسوف نتصل بك قريبا." +send_failure = "غير قادر على إرسال رسالة. ربما تم تعطيل وظيفة mail () على الخادم." +wrong_email = "عنوان البريد الإلكتروني المقدم غير صحيح." +empty_inputs = "املأ جميع الحقول المطلوبة لإرسال رسالة." +antiflood = "عليك أن تنتظر قليلاً قبل أن ترسل رسالة أخرى." \ No newline at end of file diff --git a/inc/modules/dashboard/lang/admin/ar_arabic.ini b/inc/modules/dashboard/lang/admin/ar_arabic.ini new file mode 100644 index 0000000..0d5080b --- /dev/null +++ b/inc/modules/dashboard/lang/admin/ar_arabic.ini @@ -0,0 +1,5 @@ +module_name = "لوحة التحكم" +module_desc = "الوصول السريع إلى الوحدات والأخبار." +news = "أخبار" +rss_fail_title = "انتهى وقت محاولة الاتصال" +rss_fail_desc = "تعذر تنزيل آخر الأخبار من Batflat.org." \ No newline at end of file diff --git a/inc/modules/devbar/lang/admin/ar_arabic.ini b/inc/modules/devbar/lang/admin/ar_arabic.ini new file mode 100644 index 0000000..c610c3d --- /dev/null +++ b/inc/modules/devbar/lang/admin/ar_arabic.ini @@ -0,0 +1,2 @@ +module_name = "شريط التشخيص" +module_desc = "يظهر معلومات مفيدة للمطورين" \ No newline at end of file diff --git a/inc/modules/embededvideoplayer/Admin.php b/inc/modules/embededvideoplayer/Admin.php new file mode 100644 index 0000000..cbaebe8 --- /dev/null +++ b/inc/modules/embededvideoplayer/Admin.php @@ -0,0 +1,134 @@ + +* @copyright 2018 Piotr Płaczek +* @license MIT https://github.com/piotr-placzek/BatFlat-EmbededVideoPlayer/blob/master/LICENSE.md +* @link https://github.com/piotr-placzek/BatFlat-EmbededVideoPlayer +*/ + + +namespace Inc\Modules\EmbededVideoPlayer; + +use Inc\Core\AdminModule; + +/** + * EmbededVideoPlayer admin class + */ +class Admin extends AdminModule +{ + /** + * Initialize module. Add fontawesome css. + */ + public function init(){ + } + + /** + * Module navigation + * Items of the returned array will be displayed in the administration sidebar + * + * @return array + */ + public function navigation() + { + return [ + $this->lang('index') => 'index', + ]; + } + + /** + * GET: /admin/embededvideoplayer/index + * Subpage method of the module + * + * @return string + */ + public function getIndex() + { + $entries = $this->core->db('pdev_evp')->toArray(); + return $this->draw('index.html', ['entries' => $entries]); + } + + /** + * Upload file into ~/uploads/pdev_evp directory and add data into db + */ + public function postSaveFile() + { + dump($_FILES); + if(is_uploaded_file($_FILES['file_path']['tmp_name'])) { + $dir = UPLOADS.'/pdev_evp'; + move_uploaded_file($_FILES['file_path']['tmp_name'], $dir."/".$_FILES['file_path']['name']); + + $row = array( + 'name' => $_POST['file_name'], + 'slug' => $_POST['file_slug'], + 'file' => $_FILES['file_path']['name'], + 'path' => url(UPLOADS.'/pdev_evp/'.$_FILES['file_path']['name']) + ); + + if($query = $this->core->db('pdev_evp')->save($row)){ + $this->notify('success', $this->core->lang['embededvideoplayer']['db_save_ok'].' '.$_POST['file_name'].' ('.$_FILES['file_path']['size'].'B)'); + } + else{ + $this->notify('failure', $this->core->lang['embededvideoplayer']['no_files']); + } + } + else{ + $this->notify('failure', $this->core->lang['embededvideoplayer']['no_files']); + } + + redirect(url([ADMIN, 'embededvideoplayer', 'index'])); + } + + /** + * GET: /admin/embededvideoplayer/modify + * Subpage method of the module + * @param id + * @return string + */ + public function getModify($id){ + $row = $this->core->db('pdev_evp')->oneArray($id); + return $this->draw('modify.html', ['element' => $row]); + } + + /** + * Modify row in db + */ + public function postModifyFile(){ + if($this->core->db('pdev_evp')->where('id', $_POST['id'])->update( + [ + 'name' => $_POST['file_name'], + 'slug' => $_POST['file_slug'] + ] + )){ + $this->notify('success', $this->core->lang['embededvideoplayer']['modify_file_success']); + } + else{ + $this->notify('failure', $this->core->lang['embededvideoplayer']['modify_file_failure']); + } + + redirect(url([ADMIN, 'embededvideoplayer', 'index'])); + } + + /** + * Remove row from db + * @param $id + */ + public function getRemove($id){ + $row = $this->core->db('pdev_evp')->oneArray($id); + $file = UPLOADS.'/pdev_evp/'.$row['file']; + + dump($file); + + if (file_exists($file)) { + if (!unlink($file)) { + $this->notify('failure', $this->core->lang['embededvideoplayer']['delete_file_failure']); + } else { + $this->notify('success', $this->core->lang['embededvideoplayer']['delete_file_success']); + $this->core->db('pdev_evp')->delete($id); + } + } + redirect(url([ADMIN, 'embededvideoplayer', 'index'])); + } +} diff --git a/inc/modules/embededvideoplayer/Info.php b/inc/modules/embededvideoplayer/Info.php new file mode 100644 index 0000000..816e2c3 --- /dev/null +++ b/inc/modules/embededvideoplayer/Info.php @@ -0,0 +1,39 @@ + +* @copyright 2018 Piotr Płaczek +* @license MIT https://github.com/piotr-placzek/BatFlat-EmbededVideoPlayer/blob/master/LICENSE.md +* @link https://github.com/piotr-placzek/BatFlat-EmbededVideoPlayer +*/ + +return [ + 'name' => $core->lang['embededvideoplayer']['module_name'], + 'description' => $core->lang['embededvideoplayer']['module_desc'], + 'author' => 'p.dev', + 'version' => '1.0.1', + 'compatibility' => '1.3.*', // Compatibility with Batflat version + 'icon' => 'film', // Icon from http://fontawesome.io/icons/ + + 'install' => function () use ($core) { + $core->db()->pdo()->exec("CREATE TABLE IF NOT EXISTS `pdev_evp` ( + `id` integer NOT NULL PRIMARY KEY AUTOINCREMENT, + `name` text NOT NULL, + `slug` text NOT NULL, + `file` text NOT NULL, + `path` text NOT NULL + )"); + + if (!file_exists(UPLOADS.'/pdev_evp')) { + mkdir(UPLOADS.'/pdev_evp', 0755, true); + } + }, + 'uninstall' => function () use ($core) { + // If you uncomment line bellow then you lost all data but not files + $core->db()->pdo()->exec("DROP TABLE `pdev_evp`"); + // If you uncomment block bellow then you lost all files but not data + deleteDir(UPLOADS.'/pdev_evp'); + } +]; diff --git a/inc/modules/embededvideoplayer/LICENSE.md b/inc/modules/embededvideoplayer/LICENSE.md new file mode 100644 index 0000000..44d7a64 --- /dev/null +++ b/inc/modules/embededvideoplayer/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Piotr Płaczek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/inc/modules/embededvideoplayer/README.md b/inc/modules/embededvideoplayer/README.md new file mode 100644 index 0000000..f8284b6 --- /dev/null +++ b/inc/modules/embededvideoplayer/README.md @@ -0,0 +1,24 @@ +# EmbededVideoPlayer module for BatFlat +Allows you to upload a video clip and play it using the html5 player. + +## Version +1.0.0 + +## Requirements +Batflat 1.3.x + +## Changelog +### 1.0.0 +Forked from [FilesToDownload](https://github.com/piotr-placzek/BatFlat-FilesToDownload) + +## How to install +1. Download this repository +2. Unzip the downloaded files +3. Move catalog with theme to the `/inc/modules` +4. Activate form modules admin panel + +## Usage +Use the appropriate tag in the place where you want to place the videa player. + +### Example +`{$pdev_evp.my_file}` where `my_file` is the slug given to the file in the administration panel. diff --git a/inc/modules/embededvideoplayer/Site.php b/inc/modules/embededvideoplayer/Site.php new file mode 100644 index 0000000..12e3ce1 --- /dev/null +++ b/inc/modules/embededvideoplayer/Site.php @@ -0,0 +1,48 @@ + +* @copyright 2018 Piotr Płaczek +* @license MIT https://github.com/piotr-placzek/BatFlat-EmbededVideoPlayer/blob/master/LICENSE.md +* @link https://github.com/piotr-placzek/BatFlat-EmbededVideoPlayer +*/ + + +namespace Inc\Modules\EmbededVideoPlayer; + +use Inc\Core\SiteModule; + +/** + * EmbededVideoPlayer site class + */ +class Site extends SiteModule +{ + /** + * Module initialization + * Here everything is done while the module starts + * + * @return void + */ + public function init() + { + // Add styles + $this->core->addCss(url('inc/modules/embededvideoplayer/view/pdev_evp.css')); + + // Get db items + $files = $this->core->db('pdev_evp')->toArray(); + + // Create assigns array + $assign = array(); + dump($files); + foreach ($files as $file) { + dump($file); + $view = $this->draw('embededVideoPlayer.html', ['evp' => $file]); + $assign[$file['slug']] = $view; + } + + // Create user tag + $this->tpl->set('pdev_evp', $assign); + } +} diff --git a/inc/modules/embededvideoplayer/lang/admin/ar_arabic.ini b/inc/modules/embededvideoplayer/lang/admin/ar_arabic.ini new file mode 100644 index 0000000..9cec436 --- /dev/null +++ b/inc/modules/embededvideoplayer/lang/admin/ar_arabic.ini @@ -0,0 +1,24 @@ +module_name = "مشغل فيديو مضمن" +module_desc = "يسمح لك بتحميل مقطع فيديو وتشغيله باستخدام مشغل html5" +mkdir_fail = "لا يمكن إنشاء مسار للملفات المرفوعة" +rmdir_fail = "لا يمكن إزالة مسار للملفات التي تم تحميلها" +manage = "إدارة" +th_name = "اسم مرئي" +th_slug = "اسم الرابط" +th_tag = "وسم" +th_icon = "أيقونة" +th_file = "ملف" +th_actions = "أعمال" +btn_change = "تعديل" +btn_remove = "حذف" +btn_add = "أضف" +add_new = "أضف ملف جديد" +modify_exist = "تعديل معلومات الملف" +btn_cancel = "إلغاء" +no_files = "خطأ في التحميل" +db_save_fail = "خطأ في قاعدة البيانات" +db_save_ok = "ملف مرفوع" +delete_file_success = "تم الحذف" +delete_file_failure = "فشل الحذف" +modify_file_success = "تم التعديل" +modify_file_failure = "فشل التعديل" \ No newline at end of file diff --git a/inc/modules/embededvideoplayer/lang/admin/en_english.ini b/inc/modules/embededvideoplayer/lang/admin/en_english.ini new file mode 100644 index 0000000..c4e2c4a --- /dev/null +++ b/inc/modules/embededvideoplayer/lang/admin/en_english.ini @@ -0,0 +1,25 @@ +module_name = "Embeded Video Player" +module_desc = "Allows you to upload a video clip and play it using the html5 player" + +mkdir_fail = "Can not create dir for uploaded files" +rmdir_fail = "Can not remove dir for uploaded files" +manage = "Manage" +th_name = "Visible name" +th_slug = "Slug" +th_tag = "Tag" +th_icon = "Icon" +th_file = "File" +th_actions = "Actions" +btn_change = "Modify" +btn_remove = "Delete" +btn_add = "Add" +add_new = "Add new file" +modify_exist = "Modify file info" +btn_cancel = "Cancel" +no_files = "Uploading error" +db_save_fail = "Database error" +db_save_ok = "File uploaded" +delete_file_success = "Delete ok" +delete_file_failure = "Delete fail" +modify_file_success = "Modify ok" +modify_file_failure = "Modify fail" \ No newline at end of file diff --git a/inc/modules/embededvideoplayer/lang/admin/pl_polski.ini b/inc/modules/embededvideoplayer/lang/admin/pl_polski.ini new file mode 100644 index 0000000..8c68a8e --- /dev/null +++ b/inc/modules/embededvideoplayer/lang/admin/pl_polski.ini @@ -0,0 +1,25 @@ +module_name = "Odwarzacz wideo" +module_desc = "Pozwala na dodanie plików wideo i ich odtworzenie za pomocą tagu