Ejemplo n.º 1
0
 private function updateProfileFields()
 {
     $view = new \Cunity\Profile\View\ProfileEdit();
     /** @noinspection PhpUndefinedMethodInspection */
     $user = $this->user->getTable()->get($_SESSION['user']->userid);
     /** @var User $user */
     $profile = $user->toArray(["userid", "username", "email", "firstname", "lastname", "registered", "pimg", "timg", "palbumid", "talbumid"]);
     $table = new Db\Table\Privacy();
     $privacy = $table->getPrivacy();
     $table = new NotificationSettings();
     $notificationSettings = $table->getSettings();
     $profileFields = new ProfileFields();
     $view->assign('profileFields', $profileFields->getAll());
     $view->assign("profile", array_merge($profile, ["privacy" => $privacy, 'notificationSettings' => $notificationSettings]));
     $view->render();
 }
Ejemplo n.º 2
0
 /**
  * @throws \Exception
  */
 private function loadData()
 {
     $langIterator = new \DirectoryIterator("modules/Core/languages");
     $designIterator = new \DirectoryIterator("../style");
     foreach ($designIterator as $design) {
         if ($design->isDir() && $design->isReadable() && !$design->isDot()) {
             $this->assignments['availableDesigns'][] = [$design->getBasename(), file_get_contents($design->getRealPath() . DIRECTORY_SEPARATOR . "name.txt")];
         }
     }
     foreach ($langIterator as $lang) {
         if ($lang->isReadable() && $lang->getExtension() == "csv") {
             $this->assignments['availableLanguages'][] = $lang->getBasename('.csv');
         }
     }
     $profileFields = new ProfileFields();
     $this->assignments['profileFields'] = $profileFields->getAll();
     $this->assignments['fieldTypes'] = ProfileFields::$types;
     $this->assignments["config"] = Cunity::get("config");
 }