$socialnetworkoptions = array(); foreach (ArtefactTypeSocialprofile::$socialnetworks as $socialnetwork) { $socialnetworkoptions[$socialnetwork] = get_string($socialnetwork . '.input', 'artefact.internal'); } $editform = array('name' => 'editprofileform', 'class' => 'form-editprofile', 'plugintype' => 'artefact', 'pluginname' => 'internal', 'elements' => array('id' => array('type' => 'hidden', 'value' => $id), 'profiletype' => array('type' => 'select', 'class' => 'select-with-input', 'title' => get_string('profiletype', 'artefact.internal'), 'options' => $socialnetworkoptions, 'allowother' => true, 'defaultvalue' => $note, 'width' => 171, 'rules' => array('required' => true)), 'profileurl' => array('type' => 'text', 'title' => get_string('profileurl', 'artefact.internal'), 'description' => get_string('profileurldesc', 'artefact.internal'), 'defaultvalue' => $title, 'size' => 40, 'rules' => array('required' => true)), 'submit' => array('type' => 'submitcancel', 'class' => 'btn-success', 'value' => array(get_string('save'), get_string('cancel')), 'goto' => get_config('wwwroot') . 'artefact/internal/index.php?fs=social'))); $form = pieform($editform); $message = null; if ($id > 0) { $subheading = get_string('editthisprofile', 'artefact.internal', $toedit->get('description')); } else { $subheading = get_string('newsocialprofile', 'artefact.internal'); } } $smarty = smarty(); $smarty->assign('PAGEHEADING', TITLE); $smarty->assign('navtabs', PluginArtefactInternal::submenu_items()); $smarty->assign('subheading', $subheading); $smarty->assign('form', $form); $smarty->assign('message', $message); $smarty->display('artefact:internal:socialprofile.tpl'); // Delete social profile function deleteprofileform_submit(Pieform $form, $values) { global $SESSION, $todelete; $todelete->delete(); $SESSION->add_ok_msg(get_string('profiledeletedsuccessfully', 'artefact.internal')); redirect(get_config('wwwroot') . 'artefact/internal/index.php?fs=social'); } function editprofileform_validate(Pieform $form, $values) { global $USER;
$socialnetworkoptions = array(); foreach (ArtefactTypeSocialprofile::$socialnetworks as $socialnetwork) { $socialnetworkoptions[$socialnetwork] = get_string($socialnetwork . '.input', 'artefact.internal'); } $editform = array('name' => 'editprofileform', 'plugintype' => 'artefact', 'pluginname' => 'internal', 'elements' => array('id' => array('type' => 'hidden', 'value' => $id), 'profiletype' => array('type' => 'select', 'title' => get_string('profiletype', 'artefact.internal'), 'options' => $socialnetworkoptions, 'allowother' => true, 'defaultvalue' => $note, 'width' => 171, 'rules' => array('required' => true)), 'profileurl' => array('type' => 'text', 'title' => get_string('profileurl', 'artefact.internal'), 'description' => get_string('profileurldesc', 'artefact.internal'), 'defaultvalue' => $title, 'size' => 40, 'rules' => array('required' => true)), 'submit' => array('type' => 'submitcancel', 'value' => array(get_string('save'), get_string('cancel')), 'goto' => get_config('wwwroot') . '/artefact/internal/index.php?fs=social'))); $form = pieform($editform); $message = null; if ($id > 0) { $subheading = get_string('editthisprofile', 'artefact.internal', $toedit->get('description')); } else { $subheading = get_string('newsocialprofile', 'artefact.internal'); } } $smarty = smarty(); $smarty->assign('PAGEHEADING', TITLE); $smarty->assign('SUBPAGENAV', PluginArtefactInternal::submenu_items()); $smarty->assign('subheading', $subheading); $smarty->assign('form', $form); $smarty->assign('message', $message); $smarty->display('artefact:internal:socialprofile.tpl'); // Delete social profile function deleteprofileform_submit(Pieform $form, $values) { global $SESSION, $todelete; $todelete->delete(); $SESSION->add_ok_msg(get_string('profiledeletedsuccessfully', 'artefact.internal')); redirect('/artefact/internal/index.php?fs=social'); } function editprofileform_validate(Pieform $form, $values) { global $USER;