当前位置: 首页>>代码示例>>PHP>>正文


PHP EfrontLesson::export方法代码示例

本文整理汇总了PHP中EfrontLesson::export方法的典型用法代码示例。如果您正苦于以下问题:PHP EfrontLesson::export方法的具体用法?PHP EfrontLesson::export怎么用?PHP EfrontLesson::export使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EfrontLesson的用法示例。


在下文中一共展示了EfrontLesson::export方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: serialize

     $fields_insert['options'] = serialize($copyPropertiesLesson->options);
 }
 //Create the new lesson
 $newLesson = EfrontLesson::createLesson($fields_insert);
 //If a recurring payment is set, set this up to the lesson properties
 if ($values['price'] && $values['recurring'] && in_array($values['recurring'], array_keys($recurringOptions))) {
     $newLesson->options['recurring'] = $values['recurring'];
     if ($newLesson->options['recurring']) {
         $newLesson->options['recurring_duration'] = $form->exportValue($newLesson->options['recurring'] . '_duration');
     }
     $newLesson->persist();
 }
 //Import file, if any specified
 if ($values['clone_lesson']) {
     $cloneLesson = new EfrontLesson($values['clone_lesson']);
     $file = $cloneLesson->export();
     $exportedFile = $file->copy($newLesson->getDirectory() . '/' . $exportedFile['name']);
 }
 if (isset($exportedFile)) {
     $newLesson->import($exportedFile);
 } else {
     //There was no file imported, then it's safe to add a default completion condition
     $fields = array('lessons_ID' => $newLesson->lesson['id'], 'type' => 'all_units', 'relation' => 'and');
     eF_insertTableData('lesson_conditions', $fields);
 }
 if ($newLesson->lesson['course_only']) {
     //For course-only lessons, redirect to lessons list, not to "edit lesson" page
     eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=lessons&message=" . urlencode(_SUCCESSFULLYCREATEDLESSON) . "&message_type=success");
 } else {
     eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=lessons&edit_lesson=" . $newLesson->lesson['id'] . "&tab=users&message=" . urlencode(_SUCCESSFULLYCREATEDLESSON) . "&message_type=success");
 }
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:lessons.php

示例2: createInstance

 /**
  * Create lesson instance
  *
  * This function is used to create a lesson instance.
  * <br/>Example:
  * <code>
  * $instance = EfrontLesson :: createInstance(43);
  * </code>
  *
  * @param mixed $instanceSource Either a lesson id or an EfrontLesson object.
  * @return EfrontLesson The new lesson instance
  * @since 3.6.1
  * @access public
  * @static
  */
 public static function createInstance($instanceSource, $originateCourse)
 {
     if (!$instanceSource instanceof EfrontLesson) {
         $instanceSource = new EfrontLesson($instanceSource);
     }
     if (!$originateCourse instanceof EfrontCourse) {
         $originateCourse = new EfrontCourse($originateCourse);
     }
     $result = eF_getTableData("lessons", "*", "id=" . $instanceSource->lesson['id']);
     unset($result[0]['id']);
     //unset($result[0]['directions_ID']);			//Instances don't belong to a category
     if (!$result[0]['share_folder']) {
         $result[0]['share_folder'] = $instanceSource->lesson['id'];
     }
     //$result[0]['name'] .= ' ('._INSTANCE.')';
     $result[0]['originating_course'] = $originateCourse->course['id'];
     $result[0]['instance_source'] = $instanceSource->lesson['id'];
     $file = $instanceSource->export(false, true, false);
     $instance = EfrontLesson::createLesson($result[0]);
     $instance->import($file, true, true, true);
     $instance->course['originating_course'] = $originateCourse->course['id'];
     $instance->course['instance_source'] = $instanceSource->lesson['id'];
     $instance->persist();
     $modules = eF_loadAllModules();
     foreach ($modules as $module) {
         $module->onCreateInstance($instance->lesson['id'], $instanceSource->lesson['id']);
     }
     return $instance;
 }
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:44,代码来源:lesson.class.php


注:本文中的EfrontLesson::export方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。